WordPress/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js
Andrew Ozz 855889f7aa TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
Built from https://develop.svn.wordpress.org/trunk@26876


git-svn-id: http://core.svn.wordpress.org/trunk@26759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-28 23:53:15 +00:00

60 lines
1.3 KiB
JavaScript

/* global tinymce */
tinymce.WPWindowManager = function( editor ) {
var element;
this.parent = editor.windowManager;
this.editor = editor;
tinymce.extend( this, this.parent )
this.open = function( args, params ) {
var self = this, element;
if ( ! args.wpDialog )
return this.parent.open( args, params );
else if ( ! args.id )
return;
self.element = element = jQuery('#' + args.id);
if ( ! element.length )
return;
self.features = args;
self.params = params;
self.onOpen.dispatch( self, args, params );
self.windows.push( element );
// Store selection
// self.bookmark = self.editor.selection.getBookmark(1);
// Create the dialog if necessary
if ( ! element.data('wpdialog') ) {
element.wpdialog({
title: args.title,
width: args.width,
height: args.height,
modal: true,
dialogClass: 'wp-dialog',
zIndex: 300000
});
}
element.wpdialog('open');
};
this.close = function() {
if ( ! this.features.wpDialog )
return this.parent.close.apply( this, arguments );
this.element.wpdialog('close');
};
}
tinymce.PluginManager.add( 'wpdialogs', function( editor ) {
// Replace window manager
editor.on( 'init', function() {
editor.windowManager = new tinymce.WPWindowManager( editor );
});
});