]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js
Wordpress 3.2
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / wpdialogs / js / wpdialog.dev.js
diff --git a/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js b/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js
new file mode 100644 (file)
index 0000000..6e25a1f
--- /dev/null
@@ -0,0 +1,28 @@
+(function($){
+       $.ui.dialog.prototype.options.closeOnEscape = false;
+       $.widget("wp.wpdialog", $.ui.dialog, {
+               options: {
+                       closeOnEscape: false
+               },
+
+               open: function() {
+                       var ed;
+
+                       // Initialize tinyMCEPopup if it exists and is the editor is active.
+                       if ( tinyMCEPopup && typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
+                               tinyMCEPopup.init();
+                       }
+
+                       // Add beforeOpen event.
+                       if ( this._isOpen || false === this._trigger('beforeOpen') ) {
+                               return;
+                       }
+
+                       // Open the dialog.
+                       $.ui.dialog.prototype.open.apply( this, arguments );
+                       // WebKit leaves focus in the TinyMCE editor unless we shift focus.
+                       this.element.focus();
+                       this._trigger('refresh');
+               }
+       });
+})(jQuery);