0
代碼0:ckeditor 4 jQuery適配器,如何添加自定義按鈕?
$editor.ckeditor(function() {
var editor = this;
editor.ui.add('MyButton', CKEDITOR.UI_BUTTON, {
label: 'My Button',
command: 'test'
});
}, {toolbar: [['MyButton']]});
代碼1:
var editor = CKEDITOR.replace('editor', {toolbar: [['MyButton']]});
editor.ui.add('MyButton', CKEDITOR.UI_BUTTON, {
label: 'My Button',
command: 'test'
});
[代碼1]是OK,正常在工具欄顯示,但[代碼0]是不行的,如何使用jQuery Adapter添加自定義按鈕?
更新[代碼0]:
$editor.ckeditor(function() {
var editor = this;
editor.on('pluginsLoaded', function(event) {
editor.ui.add('MyButton', CKEDITOR.UI_BUTTON, {
label: 'My Button',
command: 'test'
});
});
},
{
customConfig: '/ckeditor-config.js'
});
我不知道這一點,肯定比我的答案這麼好我刪除它。 – jazZRo
你好oleq,我更新了[code 0],使用自定義配置js,然後仍然不適合我。 – CAM