gpt4 book ai didi

javascript - BB 代码列表 JavaScript

转载 作者:行者123 更新时间:2023-11-28 02:26:16 24 4
gpt4 key购买 nike

我目前正在实现一个易于编辑的 BB 代码脚本,该脚本是用 Jquery/Javascript 编写的。唯一的问题是它并不像我想要的那么容易,所以我需要一些帮助。

该脚本运行良好(将内容添加到文本区域)。不过,我正在努力使演示文稿变得更好一点。

如果有人能告诉我如何取消列出这些项目或至少隐藏对接点(可能使用 CSS 来做到这一点),我将不胜感激,否则我可以编辑 javascript/jquery。

此外,当我滚动某个选项(对于粗体按钮)时,它会显示按钮的代码(作为标题),我想删除它,但我看不到要编辑它的代码的位置。

Screenshot of list/bb options

这是我的 JavaScript 代码:

    // ----------------------------------------------------------------------------
// markItUp!
// ----------------------------------------------------------------------------
// Copyright (C) 2008 Jay Salvat
// http://markitup.jaysalvat.com/
// ----------------------------------------------------------------------------
myBbcodeSettings = {
nameSpace: "bbcode", // Useful to prevent multi-instances CSS conflict
previewParserPath: "~/sets/bbcode/preview.php",
markupSet: [
{name:"<img src='_img/bold_icon.gif'>", key:'B', openWith:'[b]', closeWith:'[/b]'},
{name:'Italic', key:'I', openWith:'[i]', closeWith:'[/i]'},
{name:'Underline', key:'U', openWith:'[u]', closeWith:'[/u]'},
{separator:'---------------' },
{name:'Picture', key:'P', replaceWith:'[img][![Url]!][/img]'},
{name:'Link', key:'L', openWith:'[url=[![Url]!]]', closeWith:'[/url]', placeHolder:'Your text to link here...'},
{separator:'---------------' },
{name:'Colors', openWith:'[color=[![Color]!]]', closeWith:'[/color]', dropMenu: [
{name:'Yellow', openWith:'[color=yellow]', closeWith:'[/color]', className:"col1-1" },
{name:'Orange', openWith:'[color=orange]', closeWith:'[/color]', className:"col1-2" },
{name:'Red', openWith:'[color=red]', closeWith:'[/color]', className:"col1-3" },
{name:'Blue', openWith:'[color=blue]', closeWith:'[/color]', className:"col2-1" },
{name:'Purple', openWith:'[color=purple]', closeWith:'[/color]', className:"col2-2" },
{name:'Green', openWith:'[color=green]', closeWith:'[/color]', className:"col2-3" },
{name:'White', openWith:'[color=white]', closeWith:'[/color]', className:"col3-1" },
{name:'Gray', openWith:'[color=gray]', closeWith:'[/color]', className:"col3-2" },
{name:'Black', openWith:'[color=black]', closeWith:'[/color]', className:"col3-3" }
]},
{name:'Size', key:'S', openWith:'[size=[![Text size]!]]', closeWith:'[/size]', dropMenu :[
{name:'Big', openWith:'[size=200]', closeWith:'[/size]' },
{name:'Normal', openWith:'[size=100]', closeWith:'[/size]' },
{name:'Small', openWith:'[size=50]', closeWith:'[/size]' }
]},
{separator:'---------------' },
{name:'Bulleted list', openWith:'[list]\n', closeWith:'\n[/list]'},
{name:'Numeric list', openWith:'[list=[![Starting number]!]]\n', closeWith:'\n[/list]'},
{name:'List item', openWith:'[*] '},
{separator:'---------------' },
{name:'Quotes', openWith:'[quote]', closeWith:'[/quote]'},
{name:'Code', openWith:'[code]', closeWith:'[/code]'},
{separator:'---------------' },
{name:'Clean', className:"clean", replaceWith:function(h) { return h.selection.replace(/\[(.*?)\]/g, "") } },
{name:'Preview', className:"preview", call:'preview' }
]
}

感谢您给我的任何帮助! :)

最佳答案

使用 PHP 进行解析并使用简单的脚本添加文本。

关于javascript - BB 代码列表 JavaScript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14886899/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com