CKEditor:按钮没有出现

Rab*_*eel 5 ckeditor

我想在CKEditor的工具栏中添加一个按钮,但按钮没有出现.这是用于创建保存的插件的代码 _source/plugins/footnote/

CKEDITOR.plugins.add('footnote',
{
    init: function(editor)
    {
        var pluginName = 'footnote';
        CKEDITOR.dialog.add(pluginName, this.path + 'dialogs/footnote.js');
        editor.addCommand(pluginName, new CKEDITOR.dialogCommand(pluginName));
        editor.ui.addButton('Footnote',
            {
                label: 'Footnote or Citation',
                command: pluginName
            });
    }
});
Run Code Online (Sandbox Code Playgroud)

这是config.js的代码

CKEDITOR.editorConfig = function( config )

{

    config.toolbar = 'MyToolbar';

    config.extraPlugins = 'footnote';

    config.toolbar_MyToolbar =
      [

    ['Bold','Footnote','Italic']

    ];

};
Run Code Online (Sandbox Code Playgroud)

只是粗体和斜体出现在工具栏中.但是脚注按钮没有出现.谢谢你的帮助.

r3m*_*ark 6

您没有提供图标:

CKEDITOR.plugins.add('footnote', 
{
    icons: 'myfootnote',
    init: function (editor) {
        var pluginName = 'footnote';
        CKEDITOR.dialog.add(pluginName, this.path + 'dialogs/footnote.js');
        editor.addCommand(pluginName, new CKEDITOR.dialogCommand(pluginName));
        editor.ui.addButton('Footnote',
            {
                label: 'Footnote or Citation',
                icon: 'myfootnote',
                command: pluginName
            });
    }
});
Run Code Online (Sandbox Code Playgroud)

请务必在/plugins/footnote/icons/myfootnote.png上创建一个图标.

只接受PNG.