代码之家  ›  专栏  ›  技术社区  ›  Niladri Banerjee - Uttarpara

Laravel 5中的CKEditor 4未在工具栏中显示iFrame图标

  •  0
  • Niladri Banerjee - Uttarpara  · 技术社区  · 6 年前

    我在一个laravel5项目中使用CkEditor。

    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”文件夹存在。但是,我在ckeditot工具栏中看不到iframe图标。我将“allowedContent”配置为 true 如上所述。以下是屏幕抓图:

    enter image description here

    问题是什么?

    1 回复  |  直到 6 年前
        1
  •  0
  •   Niladri Banerjee - Uttarpara    6 年前

    我找到了解决办法。

    打开 config.js bower_component/ckeditor 并编写以下代码:

    config.extraPlugins = 'iframe';
    

    瞧!您将在编辑器工具栏上看到iframe图标。