【问题标题】:CKEditor plugin button disabled in source mode在源代码模式下禁用 CKEditor 插件按钮
【发布时间】: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


    【解决方案1】:

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

    modes : { enhancedsource : 1 }
    

    【讨论】:

    • 在哪里添加这个配置选项?有特定的文件吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-20
    • 2023-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-01
    相关资源
    最近更新 更多