parent
530dff515b
commit
14c5a5b9df
Binary file not shown.
After Width: | Height: | Size: 680 B |
Binary file not shown.
After Width: | Height: | Size: 369 B |
62
htmlarea/ckeditor/ckeditor/plugins/mediaembed/plugin.js
Normal file
62
htmlarea/ckeditor/ckeditor/plugins/mediaembed/plugin.js
Normal file
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Embed Media Dialog based on http://www.fluidbyte.net/embed-youtube-vimeo-etc-into-ckeditor
|
||||
*
|
||||
* Plugin name: mediaembed
|
||||
* Menu button name: MediaEmbed
|
||||
*
|
||||
* Youtube Editor Icon
|
||||
* http://paulrobertlloyd.com/
|
||||
*
|
||||
* @author Fabian Vogelsteller [frozeman.de]
|
||||
* @version 0.5
|
||||
*/
|
||||
( function() {
|
||||
CKEDITOR.plugins.add( 'mediaembed',
|
||||
{
|
||||
icons: 'mediaembed', // %REMOVE_LINE_CORE%
|
||||
hidpi: true, // %REMOVE_LINE_CORE%
|
||||
init: function( editor )
|
||||
{
|
||||
var me = this;
|
||||
CKEDITOR.dialog.add( 'MediaEmbedDialog', function (instance)
|
||||
{
|
||||
return {
|
||||
title : 'Embed Media',
|
||||
minWidth : 550,
|
||||
minHeight : 200,
|
||||
contents :
|
||||
[
|
||||
{
|
||||
id : 'iframe',
|
||||
expand : true,
|
||||
elements :[{
|
||||
id : 'embedArea',
|
||||
type : 'textarea',
|
||||
label : 'Paste Embed Code Here',
|
||||
'autofocus':'autofocus',
|
||||
setup: function(element){},
|
||||
commit: function(element){}
|
||||
}]
|
||||
}
|
||||
],
|
||||
onOk: function() {
|
||||
var div = instance.document.createElement('div');
|
||||
div.setHtml(this.getContentElement('iframe', 'embedArea').getValue());
|
||||
instance.insertElement(div);
|
||||
}
|
||||
};
|
||||
} );
|
||||
|
||||
editor.addCommand( 'MediaEmbed', new CKEDITOR.dialogCommand( 'MediaEmbedDialog',
|
||||
{ allowedContent: 'iframe[*]' }
|
||||
) );
|
||||
|
||||
editor.ui.addButton( 'MediaEmbed',
|
||||
{
|
||||
label: 'Embed Media',
|
||||
command: 'MediaEmbed',
|
||||
toolbar: 'mediaembed'
|
||||
} );
|
||||
}
|
||||
} );
|
||||
} )();
|
Loading…
x
Reference in New Issue
Block a user