【发布时间】:2013-02-17 21:08:14
【问题描述】:
我试图在 CKEditor 中添加我自己的工具栏按钮(在 vBulletin 中)。以下是我的代码:
CKEDITOR.plugins.add( 'app',
{
init: function( editor )
{
editor.addCommand( 'AppWidget',
{
modes : { source : 1, wysiwyg : 1 },
exec : function( editor )
{
alert("foo");
}
});
editor.ui.addButton( 'app',
{
label: 'App Widget',
command: 'AppWidget',
icon: this.path + 'app.png'
} );
}
} );
问题是:它会在 WYSIWYG 模式下显示,但在源模式下会被禁用(灰显)。但我需要在源模式下启用此按钮。如果我写:
modes : { source : 1 },
在两种模式下都将被禁用。
这里有什么提示吗?提前致谢。
【问题讨论】:
标签: javascript ckeditor toolbar