我试图在 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'
} );
}
} );
问题是:它将在所见即所得模式下显示,但在源模式下将被禁用(灰显)。但我需要在源模式下启用此按钮。如果我写:
modes : { source : 1 },
它将在两种模式下被禁用。
这里有什么提示吗?提前致谢。
问题解决了。我注意到编辑器模式应该是:
modes : { enhancedsource : 1 }
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)