3 tinymce.create('tinymce.plugins.WPDialogs', {
4 init : function( ed ) {
5 tinymce.create('tinymce.WPWindowManager:tinymce.InlineWindowManager', {
6 WPWindowManager : function(ed) {
10 open : function(f, p) {
11 var t = this, element;
14 return this.parent( f, p );
18 element = jQuery('#' + f.id);
19 if ( ! element.length )
24 t.onOpen.dispatch(t, f, p);
25 t.element = t.windows[ f.id ] = element;
28 t.bookmark = t.editor.selection.getBookmark(1);
30 // Create the dialog if necessary
31 if ( ! element.data('wpdialog') ) {
37 dialogClass: 'wp-dialog',
42 element.wpdialog('open');
45 if ( ! this.features.wpDialog )
46 return this.parent.apply( this, arguments );
48 this.element.wpdialog('close');
52 // Replace window manager
53 ed.onBeforeRenderUI.add(function() {
54 ed.windowManager = new tinymce.WPWindowManager(ed);
58 getInfo : function() {
60 longname : 'WPDialogs',
62 authorurl : 'http://wordpress.org',
63 infourl : 'http://wordpress.org',
70 tinymce.PluginManager.add('wpdialogs', tinymce.plugins.WPDialogs);