CKEditor 4 в Laravel 5 не показывает значок iFrame на панели инструментов - PullRequest
0 голосов
/ 29 октября 2018

Я использую CkEditor в проекте Laravel 5.

В config.js под bower_component/ckeditor/ я использовал следующий код:

CKEDITOR.editorConfig = function (config) {
    // Define changes to default configuration here.
    // For complete reference see:
    // http://docs.ckeditor.com/#!/api/CKEDITOR.config

    // The toolbar groups arrangement, optimized for two toolbar rows.
    config.toolbarGroups = [
        {name: 'clipboard', groups: ['clipboard', 'undo']},
        {name: 'editing', groups: ['find', 'selection', 'spellchecker']},
        {name: 'links'},
        {name: 'insert'},
        {name: 'forms'},
        {name: 'tools'},
        {name: 'document', groups: ['mode', 'document', 'doctools']},
        {name: 'others'},
        '/',
        {name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
        {name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align', 'bidi']},
        {name: 'styles'},
        {name: 'colors'},
        {name: 'about'}
    ];

    // Remove some buttons provided by the standard plugins, which are
    // not needed in the Standard(s) toolbar.
    config.removeButtons = 'Underline,Subscript,Superscript';

    // Set the most common block elements.
    config.format_tags = 'p;h1;h2;h3;pre';

    // Simplify the dialog windows.
    config.removeDialogTabs = 'image:advanced;link:advanced';

    config.FormatOutput = false;

    config.allowedContent = true;
};

Также в js на соответствующей странице я использовал следующий код:

$(function () {

    CKEDITOR.replace('editor2', {
        allowedContent: true,
    });
});

В HTML я использовал следующий код:

<textarea name="content" rows="10" cols="80" id="editor2"></textarea>

В папке plugins в папке bower_component/ckeditor/plugins я вижу, что папка "iframe" существует. Тем не менее, я не вижу значок iframe на панели инструментов ckeditot. Я настроил «allowContent» как true, как указано выше. Вот снимок экрана:

enter image description here

В чем проблема?

1 Ответ

0 голосов
/ 30 октября 2018

Я нашел решение.

Откройте config.js в bower_component/ckeditor и напишите следующий код:

config.extraPlugins = 'iframe';

и вуаля! Вы увидите значок iframe на панели инструментов ckeditor.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...