我想在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']];
但它无效并在控制台中给我一个错误。