CKEditor映像插件配置

Sil*_*l05 3 javascript wysiwyg ckeditor

我真的需要在图像插件中摆脱这些属性,我只需要允许用户设置src,这就是全部,但我无法弄清楚是怎么做的,因为javascript和ckeditor不是我强大的一面.有谁知道吗?

我正在使用CKEditor 4.3.1

在此输入图像描述

Bha*_*a K 5

HTML

<textarea id="editor" name="editor1">&lt;p&gt;Initial value.&lt;/p&gt;</textarea>
Run Code Online (Sandbox Code Playgroud)

脚本

<script type="text/javascript">
    CKEDITOR.on('dialogDefinition', function (ev) {
        // Take the dialog name and its definition from the event data.
        var dialogName = ev.data.name;
        var dialogDefinition = ev.data.definition;
        // Check if the definition is from the dialog we're
        // interested in (the 'image' dialog).
        if (dialogName == 'image') {
            // Get a reference to the 'Image Info' tab.
            var infoTab = dialogDefinition.getContents('info');
            // Remove unnecessary widgets/elements from the 'Image Info' tab.
            infoTab.remove('browse');
            infoTab.remove('txtHSpace');
            infoTab.remove('txtVSpace');
            infoTab.remove('txtBorder');
            infoTab.remove('txtAlt');
            infoTab.remove('txtWidth');
            infoTab.remove('txtHeight');
            infoTab.remove('htmlPreview');
            infoTab.remove('cmbAlign');
            infoTab.remove('ratioLock');
        }
    });
    CKEDITOR.replace('editor');
</script>
Run Code Online (Sandbox Code Playgroud)