CKEditor 工具栏缺少样式等项目

CKEditor toolbar missing items such as styling

我的编辑器的工具栏缺少选项。例如,我无法创建 headers.

我在 JS 文件中尝试了多种不同的配置,尽管编辑器似乎没有改变。

if (typeof(CKEDITOR) != 'undefined') {
  CKEDITOR.editorConfig = function( config ) {
    config.toolbar = [
        { name: 'document', items: [ 'Print' ] },
        { name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', '-', 'Undo', 'Redo' ] },
        { name: 'editing', items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
        '/',
        { name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-' ] },
        { 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', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', ] },
        '/',
        { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
        { name: 'colors', items: [ 'TextColor', 'BGColor' ] },
        { name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] },
        { name: 'about', items: [ 'About' ] }
    ];
  };
}

我正在尝试拥有一个完整的工具栏,因为我正在创建一个包含博客文章的网站并且需要所有可能的样式选项。

这取决于您的配置,但我猜您有一些陈旧的资产。您可能需要 运行 rake:assets:clobber。之后你可以重启你的开发服务器,刷新页面,资产应该re-compile.