我在一个laravel5项目中使用CkEditor。
bower_component/ckeditor/
我使用了以下代码:
CKEDITOR.editorConfig = function (config) {
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'}
];
config.removeButtons = 'Underline,Subscript,Superscript';
config.format_tags = 'p;h1;h2;h3;pre';
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
如上所述。以下是屏幕抓图:
问题是什么?