2

我试图在 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 },

它将在两种模式下都被禁用。

这里有任何提示吗?提前致谢。

4

1 回答 1

2

问题解决了。我注意到编辑器模式应该是:

modes : { enhancedsource : 1 }
于 2013-02-18T19:11:22.067 回答