首页 文章

CKEditor插件不工作/出现

提问于
浏览
1

我已经按照文档添加了两个插件:

  • 增强图像(图像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';
};

非常感谢任何帮助 .

1 回答

  • 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';
    

    NOTE: 插件如 buttontoolbardialogdialogui 应该可以在任何预设中使用,因此除非您有一些非常自定义的包,否则不需要使用 extraPlugins 设置添加它们 . 他们应该已经在包中 .

相关问题