将自定义按钮添加到CKEditor

时间:2015-08-13 23:50:48

标签: ckeditor

我已经下载了'时间戳'插件示例,但无论我做什么,我都无法在工具栏中显示新按钮。否则,CKEditor似乎工作得很好。

我的config.js:

CKEDITOR.editorConfig = function( config ) {

config.extraPlugins = 'timestamp';

config.toolbar = [
    { name: 'basicstyles', items: [ 'Bold', 'Italic','Underline','Strike' ] },
    { name: 'paragraph', items: [ 'NumberedList', 'BulletedList' ] },
    { name: 'links', items: [ 'Link', 'Unlink' ] },
];

config.removeDialogTabs = 'link:advanced;link:target';

};

1 个答案:

答案 0 :(得分:2)

确保清除了浏览器缓存。还可以在按钮的位置添加按钮

config.toolbar = [
    { name: 'basicstyles', items: [ 'Bold', 'TimeStamp', 'Italic','Underline','Strike' ] },
    { name: 'paragraph', items: [ 'NumberedList', 'BulletedList' ] },
    { name: 'links', items: [ 'Link', 'Unlink' ] },
];