Commits

Sasha Milovanov committed 48ecd9c

MediaEmbed fix

  • Participants
  • Parent commits 56a30f1

Comments (0)

Files changed (4)

File ckeditor/media/ckeditor/ckeditor/config.js

 
 CKEDITOR.editorConfig = function( config )
 {
-    config.extraPlugins = 'mediaembed';
+    config.extraPlugins = 'MediaEmbed';
 	// Define changes to default configuration here. For example:
 	// config.language = 'fr';
 	// config.uiColor = '#AADC6E';

File ckeditor/media/ckeditor/ckeditor/plugins/MediaEmbed/dialogs/mediaembed.html

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+	<head>
+		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+		<style>
+			body { font: normal 12px Arial,Helvetica,Tahoma,Verdana,Sans-Serif; }
+			#embed { width: 100%; height: 110px; margin: 5px 0 0 0; border: 1px solid #a0a0a0; font: normal 11px Courier, Fixedsys, serif; color: #333; }
+		</style>
+	</head>
+	<body>
+		Paste Embed Code Here:
+		<textarea id="embed" /></textarea>
+	</body>
+</html>

File ckeditor/media/ckeditor/ckeditor/plugins/MediaEmbed/images/icon.gif

Added
New image

File ckeditor/media/ckeditor/ckeditor/plugins/MediaEmbed/plugin.js

+/*
+* @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 ()
+           {
+              return {
+                 title : 'Embed Media Dialog',
+                 minWidth : 550,
+                 minHeight : 200,
+                 contents :
+                       [
+                          {
+                             id : 'iframe',
+                             label : 'Embed Media',
+                             expand : true,
+                             elements :
+                                   [
+                                      {
+						               type : 'html',
+						               id : 'pageMediaEmbed',
+						               label : 'Embed Media',
+						               style : 'width : 100%;',
+						               html : '<iframe src="'+me.path+'/dialogs/mediaembed.html" frameborder="0" name="iframeMediaEmbed" id="iframeMediaEmbed" allowtransparency="1" style="width:100%;margin:0;padding:0;"></iframe>'
+						              }
+                                   ]
+                          }
+                       ],
+                 onOk : function()
+                 {
+					for (var i=0; i<window.frames.length; i++) {
+					   if(window.frames[i].name == 'iframeMediaEmbed') {
+					      var content = window.frames[i].document.getElementById("embed").value;
+					   }
+					}
+                    editor.insertHtml('<div class="media_embed">'+content+'</div>');
+                 }
+              };
+           } );
+
+            editor.addCommand( 'MediaEmbed', new CKEDITOR.dialogCommand( 'MediaEmbedDialog' ) );
+
+            editor.ui.addButton( 'MediaEmbed',
+            {
+                label: 'Embed Media',
+                command: 'MediaEmbed',
+                icon: this.path + 'images/icon.gif'
+            } );
+        }
+    } );
+} )();