SalesSystemOnline/ckeditor_3.6/ckeditor/_source/plugins/iframedialog/plugin.js

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
Copyright (c) 2003-2011, 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()
	{
		/**
		 * An iframe base dialog.
		 * @param {String} name Name of the dialog
		 * @param {String} title Title of the dialog
		 * @param {Number} minWidth Minimum width of the dialog
		 * @param {Number} minHeight Minimum height of the dialog
		 * @param {Function} [onContentLoad] Function called when the iframe has been loaded.
		 * If it isn't specified, the inner frame is notified of the dialog events ('load',
		 * 'resize', 'ok' and 'cancel') on a function called 'onDialogEvent'
		 * @param {Object} [userDefinition] Additional properties for the dialog definition
		 * @example
		 */
		CKEDITOR.dialog.addIframe = function( name, title, src, minWidth, minHeight, onContentLoad, userDefinition )
		{
			var element =
			{
				type : 'iframe',
				src : src,
				width : '100%',
				height : '100%'
			};

			if ( typeof( onContentLoad ) == 'function' )
				element.onContentLoad = onContentLoad;
			else
				element.onContentLoad = function()
				{
					var element = this.getElement(),
						childWindow = element.$.contentWindow;

					// If the inner frame has defined a "onDialogEvent" function, setup listeners
					if ( childWindow.onDialogEvent )
					{
						var dialog = this.getDialog(),
							notifyEvent = function(e)
							{
								return childWindow.onDialogEvent(e);
							};

						dialog.on( 'ok', notifyEvent );
						dialog.on( 'cancel', notifyEvent );
						dialog.on( 'resize', notifyEvent );

						// Clear listeners
						dialog.on( 'hide', function(e)
							{
后面还有 128 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。