Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CKEditor image plugin configuration

I really need to get rid of these properties in image plugin, I need only allow users to set src, that's all, but I can't figure out how is that done, because javascript and ckeditor is not my strong side. Does anyone knows?

I'm using CKEditor 4.3.1

enter image description here

like image 956
Silverfall05 Avatar asked Apr 08 '26 06:04

Silverfall05


1 Answers

HTML

<textarea id="editor" name="editor1">&lt;p&gt;Initial value.&lt;/p&gt;</textarea>

Script

<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>
like image 78
Bhalchandra K Avatar answered Apr 09 '26 19:04

Bhalchandra K



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!