CoreFiles by mySites.guru
editor_plugin_src.js71 lines, 1,591 bytes, from wordpress-3.8.25.zip
Raw History Compare with 3.8.24
md5
90e1aaca98ff9c022b8b92e5a4f95c60
sha1
0ab8c32b5cc1dad0f4757c7ab086563cc51660bb
sha256
99a7dec61bf62f403e4a5852a6495a5ff9e7ffac0885975e5b1de8e9bcb1acab
/* global tinymce */
(function() {
	tinymce.create('tinymce.plugins.WPDialogs', {
		init : function( ed ) {
			tinymce.create('tinymce.WPWindowManager:tinymce.InlineWindowManager', {
				WPWindowManager : function(ed) {
					this.parent(ed);
				},

				open : function(f, p) {
					var t = this, element;

					if ( ! f.wpDialog )
						return this.parent( f, p );
					else if ( ! f.id )
						return;

					element = jQuery('#' + f.id);
					if ( ! element.length )
						return;

					t.features = f;
					t.params = p;
					t.onOpen.dispatch(t, f, p);
					t.element = t.windows[ f.id ] = element;

					// Store selection
					t.bookmark = t.editor.selection.getBookmark(1);

					// Create the dialog if necessary
					if ( ! element.data('wpdialog') ) {
						element.wpdialog({
							title: f.title,
							width: f.width,
							height: f.height,
							modal: true,
							dialogClass: 'wp-dialog',
							zIndex: 300000
						});
					}

					element.wpdialog('open');
				},
				close : function() {
					if ( ! this.features.wpDialog )
						return this.parent.apply( this, arguments );

					this.element.wpdialog('close');
				}
			});

			// Replace window manager
			ed.onBeforeRenderUI.add(function() {
				ed.windowManager = new tinymce.WPWindowManager(ed);
			});
		},

		getInfo : function() {
			return {
				longname : 'WPDialogs',
				author : 'WordPress',
				authorurl : 'http://wordpress.org',
				infourl : 'http://wordpress.org',
				version : '0.1'
			};
		}
	});

	// Register plugin
	tinymce.PluginManager.add('wpdialogs', tinymce.plugins.WPDialogs);
})();

The same content is in 46 releases, WordPress 3.8-beta-1 to 3.8.41. See them all, or every version of this file.