Skip to content

fixed version of the plugin #3

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'
        } );
    }
    

    } );
    } )();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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