CKEditor插件按钮在源代码模式下被禁用 [英] CKEditor plugin button disabled in source mode

查看:184
本文介绍了CKEditor插件按钮在源代码模式下被禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在CKEditor中(vBulletin内部)添加自己的工具栏按钮。以下是我的代码:

I was trying to add my own toolbar button in CKEditor (inside vBulletin). Following is my Code:

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模式显示,但在源代码模式下将被禁用(灰色) 。但是我需要在源代码模式下启用此按钮。如果我写:

Problem is: It will show in WYSIWYG mode, but will be disabled (greyed out) in source mode. But I need this button to be enabled in source mode. If I write:

modes : { source : 1 },

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

it will be disabled in both modes.

这里有任何提示吗?

推荐答案

问题已解决。我注意到编辑器模式应为:

Problem is solved. I noticed the editor mode should be:

modes : { enhancedsource : 1 }

这篇关于CKEditor插件按钮在源代码模式下被禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆