CKEditor Config - 如何在已经使用 Builder 自动构建后手动安装 1 个附加插件

CKEditor Config - How to install 1 additional plugin manually after already using the Builder to Automatically build

我使用Builder 自动构建了一个CKEditor 4.7。我看到 a build-config.js 的内容开头如下:

var CKBUILDER_CONFIG = { ...

我现在想手动安装一个名为 "bootstrapGrid" 的插件。我将此添加到我的 config.js:

CKEDITOR.editorConfig = function( config ) {
    config.extraPlugins = 'panelbutton,floatpanel,bootstrapGrid';
    config.contentsCss = 
     'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css';
    config.mj_variables_bootstrap_css_path = 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css';
    config.allowedContent = true;
    config.bootstrapGrid_container_large_desktop = 1170;
    config.bootstrapGrid_container_desktop = 970;
    config.bootstrapGrid_container_tablet = 750;
    config.bootstrapGrid_grid_columns = 12;

    config.toolbar = [
        { name: 'insert', items: [ 'BootstrapGrid', 'BootstrapGridAdd', 
         'BootstrapGridDelete', 'BootstrapGridSettings', 'Source' ] }
    ];
}; 

出于某种原因,只显示了 bootstrapGrid 插件的工具栏,所有其他工具栏都消失了。我怎样才能 'add an extra plugin' 而不是覆盖我最初的 CKEditor 插件?

当您使用 config.toolbar 时,您会覆盖默认工具栏。因此,如果您想修改工具栏,请转到 CKEditor 安装中的 samples 文件夹并打开 index.html。然后,点击 TOOLBAR CONFIGURATOR 按钮,在视觉上重新排列您的工具栏,最后点击 Advanced 以获得您制作的 config.toolbar。之后,您可以将其粘贴到您的网页中并根据需要进行更改(从其他插件添加更多按钮等)

工具栏配置器的在线版本(目前适用于 v4.8,但应该适用于 v4.7)在这里:https://ckeditor.com/latest/samples/toolbarconfigurator/#basic

更多信息:https://docs.ckeditor.com/ckeditor4/docs/?mobile=/guide/dev_toolbar