2017-09-19 38 views
1

我按照说明文件,并添加两个插件:CKEditor的插件不工作/出现

  • 增强图像(图像2)
  • 增强颜色按钮

但也出现在我的工具栏。我已经添加了所有的依赖关系。

这里是我的config.js

CKEDITOR.editorConfig = function(config) { 
config.toolbarGroups = [ 
    { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, 
    { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, 
    { name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] }, 
    { name: 'forms', groups: [ 'forms' ] }, 
    '/', 
    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, 
    { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] }, 
    { name: 'links', groups: [ 'links' ] }, 
    { name: 'insert', groups: [ 'insert' ] }, 
    '/', 
    { name: 'styles', groups: [ 'styles' ] }, 
    { name: 'colors', groups: [ 'colors' ] }, 
    { name: 'tools', groups: [ 'tools' ] }, 
    { name: 'others', groups: [ 'others' ] }, 
    { name: 'about', groups: [ 'about' ] } 
]; 

config.height = 500;  // 500 pixels. 

/*config.removePlugins = 'colorbutton';*/ 

config.extraPlugins = 'button', 'toolbar', 'notification', 'clipboard', 'lineutils', 'dialogui', 'dialog', 'widgetselection', 'widget', 'image2', 'panel', 'floatpanel', 'panelbutton', 'enhancedcolorbutton'; 

config.removeButtons = 'NewPage,Source,Scayt,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Outdent,Indent,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,Anchor,Flash,SpecialChar,PageBreak,Iframe,BGColor,Maximize,ShowBlocks'; 
}; 

任何援助深表感谢。

回答

0

请参阅:https://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraPlugins

插件列表应该用逗号分隔值的一个字符串输入:

config.extraPlugins = 'button,toolbar,notification,clipboard,lineutils,dialogui,dialog,widgetselection,widget,image2,panel,floatpanel,panelbutton,enhancedcolorbutton'; 

注:插件,像buttontoolbardialogdialogui,应可以在任何预设中使用,除非您有一些非常定制的套餐,否则应该不需要使用extraPlugins设置添加它们。他们应该已经在包装中。

+0

谢谢,对于延误表示歉意,我已经离开了一段时间。我更改了config.js,但额外的插件没有显示在我的面板中;他们应该自动在那里,还是我必须改变一些东西? –

+0

从附加的插件,你只会看到图像2,也许增强colorbutton(抱歉,我不知道这一个)在工具栏中。其余的额外插件没有工具栏按钮。你可以点击图像按钮,并检查是否可以看到它的新对话框(https://ckeditor.com/cke4/addon/image2 - 你可以检查一个屏幕截图中的对话框的样子)。如果您看不到它,请打开开发工具并告诉我您是否在控制台中发现任何错误。 –

+0

image2是我的主要,我可以管理没有颜色之一。 我得到[违反]避免使用document.write。 ckeditor.js:557和 [违例]'setTimeout'处理程序花费了137ms ckeditor.js:250 –