Skip to content

fixed version of the plugin #3

@frozeman

Description

@frozeman

/*

  • Taken from http://jsfiddle.net/redsun/ws9Vh/

  • @example An iframe-based dialog with custom button handling logics.
    */
    ( function() {
    CKEDITOR.plugins.add( 'MediaEmbed',
    {
    requires: [ 'iframedialog' ],
    init: function( editor )
    {
    var me = this;
    CKEDITOR.dialog.add( 'MediaEmbedDialog', function (ck)
    {
    return {
    title : 'Embed Media Dialog',
    minWidth : 550,
    minHeight : 200,
    contents :
    [
    {
    id : 'embed_media_dialog',
    label : 'Embed Media',
    expand : true,
    elements :
    [
    {
    type : 'textarea',
    label : 'Paste Embed Code Here:',
    id : 'embedmediatextarea',
    rows : 7,
    cols : 40
    }
    ]
    }
    ],
    onOk : function()
    {
    var contentField = this.getContentElement( 'embed_media_dialog', 'embedmediatextarea' );
    var content = contentField.getValue();
    final_html = ''+content+'';
    ck.insertHtml(final_html);
    }
    };
    });

        editor.addCommand( 'MediaEmbed', new CKEDITOR.dialogCommand( 'MediaEmbedDialog' ) );
    
        editor.ui.addButton( 'MediaEmbed',
        {
            label: 'Embed Media',
            command: 'MediaEmbed',
            icon: this.path + 'images/icon.gif'
        } );
    }
    

    } );
    } )();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions