]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - 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
1 (function($){
2         $.ui.dialog.prototype.options.closeOnEscape = false;
3         $.widget("wp.wpdialog", $.ui.dialog, {
4                 options: {
5                         closeOnEscape: false
6                 },
7
8                 open: function() {
9                         var ed;
10
11                         // Initialize tinyMCEPopup if it exists and is the editor is active.
12                         if ( tinyMCEPopup && typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
13                                 tinyMCEPopup.init();
14                         }
15
16                         // Add beforeOpen event.
17                         if ( this._isOpen || false === this._trigger('beforeOpen') ) {
18                                 return;
19                         }
20
21                         // Open the dialog.
22                         $.ui.dialog.prototype.open.apply( this, arguments );
23                         // WebKit leaves focus in the TinyMCE editor unless we shift focus.
24                         this.element.focus();
25                         this._trigger('refresh');
26                 }
27         });
28 })(jQuery);