dist/js/medium-editor-insert-plugin.js
function Core(el, options) {
        var editor;

        this.el = el;
        this.$el = $(el);
        this.templates = window.MediumInsert.Templates;

        if (options) {
            // Fix #142
            // Avoid deep copying editor object, because since v2.3.0 it contains circular references which causes jQuery.extend to break
            // Instead copy editor object to this.options manually
            editor = options.editor;
            options.editor = null;
        }
        this.options = $.extend(true, {}, defaults, options);
        this.options.editor = editor;
        if (options) {
            options.editor = editor; // Restore original object definition
        }

        this._defaults = defaults;
        this._name = pluginName;

        // Extend editor's functions
        if (this.options && this.options.editor) {
            if (this.options.editor._serialize === undefined) {
                this.options.editor._serialize = this.options.editor.serialize;
            }
            if (this.options.editor._destroy === undefined) {
                this.options.editor._destroy = this.options.editor.destroy;
            }
            if (this.options.editor._setup === undefined) {
                this.options.editor._setup = this.options.editor.setup;
            }
            this.options.editor._hideInsertButtons = this.hideButtons;

            this.options.editor.serialize = this.editorSerialize;
            this.options.editor.destroy = this.editorDestroy;
            this.options.editor.setup = this.editorSetup;

            if (this.options.editor.getExtensionByName('placeholder') !== undefined) {
                this.options.editor.getExtensionByName('placeholder').updatePlaceholder = this.editorUpdatePlaceholder;
            }
        }
    }
function Core(el, options) {
        var editor;

        this.el = el;
        this.$el = $(el);
        this.templates = window.MediumInsert.Templates;

        if (options) {
            // Fix #142
            // Avoid deep copying editor object, because since v2.3.0 it contains circular references which causes jQuery.extend to break
            // Instead copy editor object to this.options manually
            editor = options.editor;
            options.editor = null;
        }
        this.options = $.extend(true, {}, defaults, options);
        this.options.editor = editor;
        if (options) {
            options.editor = editor; // Restore original object definition
        }

        this._defaults = defaults;
        this._name = pluginName;

        // Extend editor's functions
        if (this.options && this.options.editor) {
            if (this.options.editor._serialize === undefined) {
                this.options.editor._serialize = this.options.editor.serialize;
            }
            if (this.options.editor._destroy === undefined) {
                this.options.editor._destroy = this.options.editor.destroy;
            }
            if (this.options.editor._setup === undefined) {
                this.options.editor._setup = this.options.editor.setup;
            }
            this.options.editor._hideInsertButtons = this.hideButtons;

            this.options.editor.serialize = this.editorSerialize;
            this.options.editor.destroy = this.editorDestroy;
            this.options.editor.setup = this.editorSetup;

            if (this.options.editor.getExtensionByName('placeholder') !== undefined) {
                this.options.editor.getExtensionByName('placeholder').updatePlaceholder = this.editorUpdatePlaceholder;
            }
        }
    }
function Core ( el , options ) { var editor ; this . el = el ; this . $el = $ ( el ) ; this . templates = window . MediumInsert . Templates ; if ( options ) { // Fix #142 // Avoid deep copying editor object, because since v2.3.0 it contains circular references which causes jQuery.extend to break // Instead copy editor object to this.options manually editor = options . editor ; options . editor = null ; } this . options = $ . extend ( true , { } , defaults , options ) ; this . options . editor = editor ; if ( options ) { options . editor = editor ; // Restore original object definition } this . _defaults = defaults ; this . _name = pluginName ; // Extend editor's functions if ( this . options && this . options . editor ) { if ( this . options . editor . _serialize === undefined ) { this . options . editor . _serialize = this . options . editor . serialize ; } if ( this . options . editor . _destroy === undefined ) { this . options . editor . _destroy = this . options . editor . destroy ; } if ( this . options . editor . _setup === undefined ) { this . options . editor . _setup = this . options . editor . setup ; } this . options . editor . _hideInsertButtons = this . hideButtons ; this . options . editor . serialize = this . editorSerialize ; this . options . editor . destroy = this . editorDestroy ; this . options . editor . setup = this . editorSetup ; if ( this . options . editor . getExtensionByName ( 'placeholder' ) !== undefined ) { this . options . editor . getExtensionByName ( 'placeholder' ) . updatePlaceholder = this . editorUpdatePlaceholder ; } } }
Core plugin's object

Sets options, variables and calls init() function

@constructor
@param {DOM} el - DOM element to init the plugin on
@param {object} options - Options to override defaults
@return {void}
Core plugin s object