wp/wp-includes/js/wpdialog.js
author ymh <ymh.work@gmail.com>
Fri, 05 Sep 2025 18:52:52 +0200
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
permissions -rw-r--r--
Update WordPress to latest version (6.7) - Sync WordPress core files from latest release - Updated admin interface, blocks, and core functionality - Enhanced block editor features and performance - Security updates and bug fixes - Preserved custom wp-content directory and configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9
177826044cd9 upgrade wordpress to 5.2.3
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     1
/**
177826044cd9 upgrade wordpress to 5.2.3
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     2
 * @output wp-includes/js/wpdialog.js
177826044cd9 upgrade wordpress to 5.2.3
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     3
 */
177826044cd9 upgrade wordpress to 5.2.3
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     4
177826044cd9 upgrade wordpress to 5.2.3
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     5
/*
177826044cd9 upgrade wordpress to 5.2.3
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     6
 * Wrap the jQuery UI Dialog open function remove focus from tinyMCE.
177826044cd9 upgrade wordpress to 5.2.3
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     7
 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
( function($) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
	$.widget('wp.wpdialog', $.ui.dialog, {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
		open: function() {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
			// Add beforeOpen event.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
			if ( this.isOpen() || false === this._trigger('beforeOpen') ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
				return;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
			}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
			// Open the dialog.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
			this._super();
9
177826044cd9 upgrade wordpress to 5.2.3
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    18
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
			// WebKit leaves focus in the TinyMCE editor unless we shift focus.
21
48c4eec2b7e6 Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents: 9
diff changeset
    20
			this.element.trigger('focus');
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
			this._trigger('refresh');
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
		}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
	});
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
	$.wp.wpdialog.prototype.options.closeOnEscape = false;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
})(jQuery);