Как упомянуть плагины в конфигурационном файле CKEditor 5 - PullRequest
0 голосов
/ 05 ноября 2018

В CKEditor 4 мы можем использовать приведенную ниже конфигурацию для добавления дополнительных плагинов. Как мы можем достичь этого в ckeditor 5?

toolbar: [
      { name: 'document', items: ['Source', '-', 'DocProps', 'Preview', 'Print', '-', 'Templates'] },
      { name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
      { name: 'editing', items: ['Find', 'Replace', '-', 'SelectAll', '-', 'SpellChecker', 'Scayt'] },
      { name: 'tools', items: ['Maximize', 'ShowBlocks', '-', ] },
        '/',
      { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'] },
      { name: 'colors', items: ['TextColor', 'BGColor'] },
      { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent',
       '-', 'Blockquote', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl'] },
        '/',
      { name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
      { name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] }
    ]

Спасибо.

1 Ответ

0 голосов
/ 05 ноября 2018

Это на самом деле неверно. В CKEditor 4 вы добавляете новые плагины, используя параметр extraPlugins . То, что вы показали выше, это панель инструментов конфигурация, о которой вы можете прочитать подробнее здесь: https://ckeditor.com/docs/ckeditor4/latest/guide/dev_toolbarconcepts.html.

Если вы хотите добавить новые плагины в CKEditor 5, смотрите: https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/installing-plugins.html#adding-a-plugin-to-a-build и https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editorconfig-EditorConfig.html#member-plugins.

Если вы хотите настроить панель инструментов в CKEditor 5 и добавить к ней новые кнопки, см. https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/configuration.html#toolbar-setup и https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editorconfig-EditorConfig.html#member-toolbar.

...