嗨,我想在 drupal 中为 CKEditor 添加一个自定义按钮。我创建了一个插件,但它没有显示在我的 ckeditor 工具栏中。有人能帮我吗?代码如下
插件.js
CKEDITOR.plugins.add('newplugin',
{
init: function(editor)
{
var pluginName = 'newplugin';
CKEDITOR.dialog.add(pluginName, this.path + 'plugin.js');
editor.addCommand(pluginName, new CKEDITOR.dialogCommand(pluginName));
editor.ui.addButton('Newplugin',
{
label: 'Footnote or Citation',
icon: this.path + 'newplugin.png',
command: pluginName
});
}
});
config.js
CKEDITOR.editorConfig = function( config )
{
config.extraPlugins = 'newplugin';
config.toolbar = [
['Bold'],['Italic'],['newplugin']
]
};