【问题标题】:CKEditor 4.10 not all toolbar options are being renderedCKEditor 4.10 并非所有工具栏选项都被呈现
【发布时间】:2019-01-18 05:29:18
【问题描述】:

我在不同页面上有多个 CKEditor 实例,因此我不想修改 config.js 或为每个页面设置单独的 config.js 实例。

我正在使用这个在运行时创建工具栏:

 $(document).ready(function() {
    CKEDITOR.replace('Description');

    var editor = CKEDITOR.instances['Description'];
    if (editor) {
        editor.destroy(true);
    }

    CKEDITOR.config.toolbar_Basic = [
        { name: 'document', items: [ 'Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates' ] },
        { name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
        { name: 'editing', items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
        { name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
        '/',
        { name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat' ] },
        { name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language' ] },
        { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
        { name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] },
        '/',
        { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
        { name: 'colors', items: [ 'TextColor', 'BGColor' ] },
        { name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] },
        { name: 'about', items: [ 'About' ] }

    ];
    CKEDITOR.config.toolbar = 'Basic';
    CKEDITOR.config.width=650;
    CKEDITOR.config.height=400;
    CKEDITOR.config.extraAllowedContent = 'span;ul;li;table;td;style;*[id];*(*);*{*}';
    CKEDITOR.replace('Description', CKEDITOR.config);

    });

并非我的所有工具栏选项都显示出来。例如,

    { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
    { name: 'colors', items: [ 'TextColor', 'BGColor' ] },

样式和格式可见,但 Font、FontSize、TextColor 和 BGColor 不可见。

如何让那些缺少的工具栏项显示出来。

【问题讨论】:

    标签: ckeditor config toolbar


    【解决方案1】:

    这只是没有安装完整的 CKEditor 的问题。我安装的是标准版,不包含字体和颜色插件。

    安装完整版纠正了这种情况。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-06
      • 2019-04-11
      • 1970-01-01
      • 2013-02-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多