CLICK HERE TO BUY IT TODAY! OR GET IT FREE VIA TRIALPAY  

PHP Demo Application - Source Code

/Framework/Model/Vendor/CkEditor/_source/plugins/iframedialog/plugin.js



/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
/**
 * @fileOverview Plugin for making iframe based dialogs.
 */
CKEDITOR.plugins.add'iframedialog',
{
	    requires : [ 'dialog' ],
	    onLoad : function()
	    {
		        CKEDITOR.dialog.addIframe = function( nametitlesrcwidthheightonContentLoad )
		        {
			            var element =
			            {
				                type 'iframe',
				                src src,
				                width '100%',
				                height '100%'
				            };
			            if ( typeofonContentLoad ) == 'function' )
			                element.onContentLoad onContentLoad;
			            var definition =
			            {
				                title title,
				                minWidth width,
				                minHeight height,
				                contents :
				                [
				                    {
					                        id 'iframe',
					                        label title,
					                        expand true,
					                        elements : [ element ]
					                    }
				                ]
				            };
			            return this.addname, function(){ return definition;
				} );
			        };
		        (function()
		        {
			            /**
			             * An iframe element.
			             * @extends CKEDITOR.ui.dialog.uiElement
			             * @example
			             * @constructor
			             * @param {CKEDITOR.dialog} dialog
			             * Parent dialog object.
			             * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
			             * The element definition. Accepted fields:
			             * <ul>
			             *     <li><strong>src</strong> (Required) The src field of the iframe. </li>
			             *     <li><strong>width</strong> (Required) The iframe's width.</li>
			             *     <li><strong>height</strong> (Required) The iframe's height.</li>
			             *     <li><strong>onContentLoad</strong> (Optional) A function to be executed
			             *     after the iframe's contents has finished loading.</li>
			             * </ul>
			             * @param {Array} htmlList
			             * List of HTML code to output to.
			             */
			            var iframeElement = function( dialogelementDefinitionhtmlList )
			            {
				                if ( arguments.length )
				                    return;
				                var = ( this.|| ( this.{} ) ),
				                    contentLoad elementDefinition.onContentLoad && CKEDITOR.tools.bindelementDefinition.onContentLoadthis ),
				                    cssWidth CKEDITOR.tools.cssLengthelementDefinition.width ),
				                    cssHeight CKEDITOR.tools.cssLengthelementDefinition.height );
				                _.frameId CKEDITOR.tools.getNextNumber() + '_iframe';
				                // IE BUG: Parent container does not resize to contain the iframe automatically.
				                dialog.on'load', function()
				                    {
					                        var iframe CKEDITOR.document.getById_.frameId ),
					                            parentContainer iframe.getParent();
					                        parentContainer.setStyles(
					                            {
						                                width cssWidth,
						                                height cssHeight
						                            } );
					                    } );
				                var attributes =
				                {
					                    src '%2',
					                    id _.frameId,
					                    frameborder 0,
					                    allowtransparency true
					                };
				                var myHtml [];
				                if ( typeofelementDefinition.onContentLoad ) == 'function' )
				                    attributes.onload 'CKEDITOR.tools.callFunction(%1);
				';
				                CKEDITOR.ui.dialog.uiElement.callthisdialogelementDefinitionmyHtml'iframe',
				                        {
					                            width cssWidth,
					                            height cssHeight
					                        }, attributes'' );
				                // Put a placeholder for the first time.
				                htmlList.push'<div style="width:' cssWidth ';
				height:' cssHeight ';
				" id="' this.domId '"></div>' );
				                // Iframe elements should be refreshed whenever it is shown.
				                myHtml myHtml.join'' );
				                dialog.on'show', function()
				                    {
					                        var iframe CKEDITOR.document.getById_.frameId ),
					                            parentContainer iframe.getParent(),
					                            callIndex CKEDITOR.tools.addFunctioncontentLoad ),
					                            html myHtml.replace'%1'callIndex ).replace'%2'CKEDITOR.tools.htmlEncodeelementDefinition.src ) );
					                        parentContainer.setHtmlhtml );
					                    } );
				            };
			            iframeElement.prototype = new CKEDITOR.ui.dialog.uiElement;
			            CKEDITOR.dialog.addUIElement'iframe',
			                {
				                    build : function( dialogelementDefinitionoutput )
				                    {
					                        return new iframeElementdialogelementDefinitionoutput );
					                    }
				                } );
			        })();
		    }
	} );





PHP Demo Source Code Index