JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-4.0_full
[ckeditor.git] / _source / plugins / iframedialog / plugin.js
diff --git a/_source/plugins/iframedialog/plugin.js b/_source/plugins/iframedialog/plugin.js
deleted file mode 100644 (file)
index e95c4c0..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-/*\r
-Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
-For licensing, see LICENSE.html or http://ckeditor.com/license\r
-*/\r
-\r
-/**\r
- * @fileOverview Plugin for making iframe based dialogs.\r
- */\r
-\r
-CKEDITOR.plugins.add( 'iframedialog',\r
-{\r
-       requires : [ 'dialog' ],\r
-       onLoad : function()\r
-       {\r
-               /**\r
-                * An iframe base dialog.\r
-                * @param {String} name Name of the dialog\r
-                * @param {String} title Title of the dialog\r
-                * @param {Number} minWidth Minimum width of the dialog\r
-                * @param {Number} minHeight Minimum height of the dialog\r
-                * @param {Function} [onContentLoad] Function called when the iframe has been loaded.\r
-                * If it isn't specified, the inner frame is notified of the dialog events ('load',\r
-                * 'resize', 'ok' and 'cancel') on a function called 'onDialogEvent'\r
-                * @param {Object} [userDefinition] Additional properties for the dialog definition\r
-                * @example\r
-                */\r
-               CKEDITOR.dialog.addIframe = function( name, title, src, minWidth, minHeight, onContentLoad, userDefinition )\r
-               {\r
-                       var element =\r
-                       {\r
-                               type : 'iframe',\r
-                               src : src,\r
-                               width : '100%',\r
-                               height : '100%'\r
-                       };\r
-\r
-                       if ( typeof( onContentLoad ) == 'function' )\r
-                               element.onContentLoad = onContentLoad;\r
-                       else\r
-                               element.onContentLoad = function()\r
-                               {\r
-                                       var element = this.getElement(),\r
-                                               childWindow = element.$.contentWindow;\r
-\r
-                                       // If the inner frame has defined a "onDialogEvent" function, setup listeners\r
-                                       if ( childWindow.onDialogEvent )\r
-                                       {\r
-                                               var dialog = this.getDialog(),\r
-                                                       notifyEvent = function(e)\r
-                                                       {\r
-                                                               return childWindow.onDialogEvent(e);\r
-                                                       };\r
-\r
-                                               dialog.on( 'ok', notifyEvent );\r
-                                               dialog.on( 'cancel', notifyEvent );\r
-                                               dialog.on( 'resize', notifyEvent );\r
-\r
-                                               // Clear listeners\r
-                                               dialog.on( 'hide', function(e)\r
-                                                       {\r
-                                                               dialog.removeListener( 'ok', notifyEvent );\r
-                                                               dialog.removeListener( 'cancel', notifyEvent );\r
-                                                               dialog.removeListener( 'resize', notifyEvent );\r
-\r
-                                                               e.removeListener();\r
-                                                       } );\r
-\r
-                                               // Notify child iframe of load:\r
-                                               childWindow.onDialogEvent( {\r
-                                                               name : 'load',\r
-                                                               sender : this,\r
-                                                               editor : dialog._.editor\r
-                                                       } );\r
-                                       }\r
-                               };\r
-\r
-                       var definition =\r
-                       {\r
-                               title : title,\r
-                               minWidth : minWidth,\r
-                               minHeight : minHeight,\r
-                               contents :\r
-                               [\r
-                                       {\r
-                                               id : 'iframe',\r
-                                               label : title,\r
-                                               expand : true,\r
-                                               elements : [ element ]\r
-                                       }\r
-                               ]\r
-                       };\r
-\r
-                       for ( var i in userDefinition )\r
-                               definition[i] = userDefinition[i];\r
-\r
-                       this.add( name, function(){ return definition; } );\r
-               };\r
-\r
-               (function()\r
-               {\r
-                       /**\r
-                        * An iframe element.\r
-                        * @extends CKEDITOR.ui.dialog.uiElement\r
-                        * @example\r
-                        * @constructor\r
-                        * @param {CKEDITOR.dialog} dialog\r
-                        * Parent dialog object.\r
-                        * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition\r
-                        * The element definition. Accepted fields:\r
-                        * <ul>\r
-                        *      <li><strong>src</strong> (Required) The src field of the iframe. </li>\r
-                        *      <li><strong>width</strong> (Required) The iframe's width.</li>\r
-                        *      <li><strong>height</strong> (Required) The iframe's height.</li>\r
-                        *      <li><strong>onContentLoad</strong> (Optional) A function to be executed\r
-                        *      after the iframe's contents has finished loading.</li>\r
-                        * </ul>\r
-                        * @param {Array} htmlList\r
-                        * List of HTML code to output to.\r
-                        */\r
-                       var iframeElement = function( dialog, elementDefinition, htmlList )\r
-                       {\r
-                               if ( arguments.length < 3 )\r
-                                       return;\r
-\r
-                               var _ = ( this._ || ( this._ = {} ) ),\r
-                                       contentLoad = elementDefinition.onContentLoad && CKEDITOR.tools.bind( elementDefinition.onContentLoad, this ),\r
-                                       cssWidth = CKEDITOR.tools.cssLength( elementDefinition.width ),\r
-                                       cssHeight = CKEDITOR.tools.cssLength( elementDefinition.height );\r
-                               _.frameId = CKEDITOR.tools.getNextId() + '_iframe';\r
-\r
-                               // IE BUG: Parent container does not resize to contain the iframe automatically.\r
-                               dialog.on( 'load', function()\r
-                                       {\r
-                                               var iframe = CKEDITOR.document.getById( _.frameId ),\r
-                                                       parentContainer = iframe.getParent();\r
-\r
-                                               parentContainer.setStyles(\r
-                                                       {\r
-                                                               width : cssWidth,\r
-                                                               height : cssHeight\r
-                                                       } );\r
-                                       } );\r
-\r
-                               var attributes =\r
-                               {\r
-                                       src : '%2',\r
-                                       id : _.frameId,\r
-                                       frameborder : 0,\r
-                                       allowtransparency : true\r
-                               };\r
-                               var myHtml = [];\r
-\r
-                               if ( typeof( elementDefinition.onContentLoad ) == 'function' )\r
-                                       attributes.onload = 'CKEDITOR.tools.callFunction(%1);';\r
-\r
-                               CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, myHtml, 'iframe',\r
-                                               {\r
-                                                       width : cssWidth,\r
-                                                       height : cssHeight\r
-                                               }, attributes, '' );\r
-\r
-                               // Put a placeholder for the first time.\r
-                               htmlList.push( '<div style="width:' + cssWidth + ';height:' + cssHeight + ';" id="' + this.domId + '"></div>' );\r
-\r
-                               // Iframe elements should be refreshed whenever it is shown.\r
-                               myHtml = myHtml.join( '' );\r
-                               dialog.on( 'show', function()\r
-                                       {\r
-                                               var iframe = CKEDITOR.document.getById( _.frameId ),\r
-                                                       parentContainer = iframe.getParent(),\r
-                                                       callIndex = CKEDITOR.tools.addFunction( contentLoad ),\r
-                                                       html = myHtml.replace( '%1', callIndex ).replace( '%2', CKEDITOR.tools.htmlEncode( elementDefinition.src ) );\r
-                                               parentContainer.setHtml( html );\r
-                                       } );\r
-                       };\r
-\r
-                       iframeElement.prototype = new CKEDITOR.ui.dialog.uiElement;\r
-\r
-                       CKEDITOR.dialog.addUIElement( 'iframe',\r
-                               {\r
-                                       build : function( dialog, elementDefinition, output )\r
-                                       {\r
-                                               return new iframeElement( dialog, elementDefinition, output );\r
-                                       }\r
-                               } );\r
-               })();\r
-       }\r
-} );\r