1

我想在 ckeditor 工具栏上添加一个自定义按钮。但它给了我一个未捕获异常的javascript错误。我的javascript代码如下。

文件名 :/ckeditor/plugins/linkbutton/plugin.js

(function(){
    //Section 1 : Code to execute when the toolbar button is pressed
    var a= {
        exec:function(editor){
            var theSelectedText = editor.getSelection().getNative();
            CallCfWindow(theSelectedText);
        }
    },

    //Section 2 : Create the button and add the functionality to it
    b=’linkbutton’;
    CKEDITOR.plugins.add(b,{
        init:function(editor){
            editor.addCommand(b,a);
            editor.ui.addButton(‘linkbutton’,{
                label:’Link Button’,
                icon: this.path + ‘logo_ckeditor.png’,
                command:b
            });
        }
    });
})();

然后在 config.js 文件中我写了这段代码,

config.extraPlugins = 'linkbutton';
config.toolbar_Full =  [['Styles', 'Bold', 'Italic', 'Underline', 'SpellChecker', 'Scayt', '-', 'NumberedList', 'BulletedList'],['Link', 'Unlink'], ['Undo', 'Redo', '-', 'SelectAll', 'linkbutton']];

但它不起作用并在控制台中给我一个错误。

4

0 回答 0