2012-12-04 79 views
1

我想在ckeditor中添加一個外部插件,但它看起來我沒有正確註冊我的插件,它不顯示。在CKEditor中添加外部插件3.6

1.-我試着直接將它添加到CKEditor配置文件,它不起作用。

CKEDITOR.editorConfig = function(config) { 
config.toolbar = [ 
['Bold'],['Italic'],['myplugin'] 
] 
}; 

2.-試圖在啓動CKEditor時將其添加到html文件中,但也沒有工作。

var editor = CKEDITOR.replace('editor1', 
{ 

removePlugins : 'forms,table,tabletools', 
extraPlugins : 'msugetprop,msuforms,msutable,msutabletools,msumobile', 

toolbar : 
    [ 
     ['Cut','Copy','PasteText','Preview'], 
     ['Undo','Redo','-','SelectAll'], 
    ['MsuForm','MsuGetProp','MsuCheckbox', 'MsuRadio', 'MsuTextField',   'MsuTextarea', 'MsuSelect', 'MsuButton', 'MsuTable', 'MsuHiddenField'], 
    '/', 
    ['Styles','-','NumberedList','BulletedList','-','CreateDiv'], 
                         ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], 
    ['Link','Unlink','Anchor'], 
    ['Source','-','About'], 
    ['myplugin'], 
    ] 
}); 

3 .-我的插件是在/ CKEditor的/插件/爲myplugin與文件名plugin.js

(function() { 
var o = { exec: function(p) { 
url = baseUrl + "/GetSomeData"; 
$.post(url, function(response) { 
alert(response) 
}); 
} 
}; 
CKEDITOR.plugins.add('myplugin', { 
init: function(editor) { 
editor.addCommand('myplugin', o); 
editor.ui.addButton('myplugin', { 
label: 'myplugin', 
icon: this.path + 'myplugin.png', 
command: 'myplugin' 
}); 
} 
}); 
})(); 

我缺少什麼?

回答

1

已解決。

忘了在extraPlugins下添加'myplugin'