4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
12 tinymce.create('tinymce.plugins.WPDialogs', {
13 init : function(ed, url) {
14 tinymce.create('tinymce.WPWindowManager:tinymce.InlineWindowManager', {
15 WPWindowManager : function(ed) {
19 open : function(f, p) {
20 var t = this, element;
23 return this.parent( f, p );
27 element = jQuery('#' + f.id);
28 if ( ! element.length )
33 t.onOpen.dispatch(t, f, p);
34 t.element = t.windows[ f.id ] = element;
37 t.bookmark = t.editor.selection.getBookmark(1);
39 // Create the dialog if necessary
40 if ( ! element.data('wpdialog') ) {
46 dialogClass: 'wp-dialog',
51 element.wpdialog('open');
54 if ( ! this.features.wpDialog )
55 return this.parent.apply( this, arguments );
57 this.element.wpdialog('close');
61 // Replace window manager
62 ed.onBeforeRenderUI.add(function() {
63 ed.windowManager = new tinymce.WPWindowManager(ed);
67 getInfo : function() {
69 longname : 'WPDialogs',
71 authorurl : 'http://wordpress.org',
72 infourl : 'http://wordpress.org',
79 tinymce.PluginManager.add('wpdialogs', tinymce.plugins.WPDialogs);