<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[41797] trunk/src: Customize: Eliminate use of customize-loader in core so Customizer is opened consistently in `top` window.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/41797">41797</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/41797","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>westonruter</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2017-10-09 16:03:35 +0000 (Mon, 09 Oct 2017)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Customize: Eliminate use of customize-loader in core so Customizer is opened consistently in `top` window.
* Open the door for future browser history feature in <a href="https://core.trac.wordpress.org/ticket/28536">#28536</a>, which is currently not feasible when customize-loader is used.
* Remove customizer-loader from being used on admin screens for Dashboard, Themes, non-shiny theme install/update.
* Keep the customize-loader functionality available for plugins, for the time being. It may become deprecated.
* Ensure `return` param in customizer links in Themes screen update to reflect `search` updated by `pushState`.
* Persist `return` when reloading Customizer due to theme switch, autosave restoration, or changeset trashing.
* Use `location.replace()` instead of changing `location.href` when trashing.
* Hide theme browser while Themes screen is loading when there is a `search` to prevent flash of unfiltered themes.
* Use throttling instead of debouncing when searching themes to ensure that screen is updated immediately on page load.
* Fix encoding and decoding of `search` param between URL and search field.
* Add support for dismissing autosaves when closing customize-loader, when it is used by plugins.
* Skip sending changeset UUID to customize-loader for population in browser location if changeset branching is not enabled.
See <a href="https://core.trac.wordpress.org/ticket/28536">#28536</a>.
Fixes <a href="https://core.trac.wordpress.org/ticket/40254">#40254</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincssthemescss">trunk/src/wp-admin/css/themes.css</a></li>
<li><a href="#trunksrcwpadminincludesclassthemeinstallerskinphp">trunk/src/wp-admin/includes/class-theme-installer-skin.php</a></li>
<li><a href="#trunksrcwpadminincludesclassthemeupgraderskinphp">trunk/src/wp-admin/includes/class-theme-upgrader-skin.php</a></li>
<li><a href="#trunksrcwpadminindexphp">trunk/src/wp-admin/index.php</a></li>
<li><a href="#trunksrcwpadminjscustomizecontrolsjs">trunk/src/wp-admin/js/customize-controls.js</a></li>
<li><a href="#trunksrcwpadminjsthemejs">trunk/src/wp-admin/js/theme.js</a></li>
<li><a href="#trunksrcwpadminthemesphp">trunk/src/wp-admin/themes.php</a></li>
<li><a href="#trunksrcwpadminupdatephp">trunk/src/wp-admin/update.php</a></li>
<li><a href="#trunksrcwpincludesclasswpcustomizemanagerphp">trunk/src/wp-includes/class-wp-customize-manager.php</a></li>
<li><a href="#trunksrcwpincludesjscustomizeloaderjs">trunk/src/wp-includes/js/customize-loader.js</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincssthemescss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/themes.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/themes.css 2017-10-09 15:21:51 UTC (rev 41796)
+++ trunk/src/wp-admin/css/themes.css 2017-10-09 16:03:35 UTC (rev 41797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,6 +7,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 16.1 - Manage Themes
</span><span class="cx" style="display: block; padding: 0 10px"> ------------------------------------------------------------------------------*/
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body.js .theme-browser.search-loading {
+ display: none;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .theme-browser .themes {
</span><span class="cx" style="display: block; padding: 0 10px"> clear: both;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesclassthemeinstallerskinphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-theme-installer-skin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-theme-installer-skin.php 2017-10-09 15:21:51 UTC (rev 41796)
+++ trunk/src/wp-admin/includes/class-theme-installer-skin.php 2017-10-09 16:03:35 UTC (rev 41797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,7 +64,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $install_actions = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $install_actions['preview'] = '<a href="' . wp_customize_url( $stylesheet ) . '" class="hide-if-no-customize load-customize"><span aria-hidden="true">' . __( 'Live Preview' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Live Preview “%s”' ), $name ) . '</span></a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $customize_url = add_query_arg(
+ array(
+ 'theme' => urlencode( $stylesheet ),
+ 'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ),
+ ),
+ admin_url( 'customize.php' )
+ );
+ $install_actions['preview'] = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize"><span aria-hidden="true">' . __( 'Live Preview' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Live Preview “%s”' ), $name ) . '</span></a>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $install_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink"><span aria-hidden="true">' . __( 'Activate' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Activate “%s”' ), $name ) . '</span></a>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminincludesclassthemeupgraderskinphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-theme-upgrader-skin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-theme-upgrader-skin.php 2017-10-09 15:21:51 UTC (rev 41796)
+++ trunk/src/wp-admin/includes/class-theme-upgrader-skin.php 2017-10-09 16:03:35 UTC (rev 41797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,13 +49,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ), admin_url('themes.php') );
</span><span class="cx" style="display: block; padding: 0 10px"> $activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $customize_url = add_query_arg(
+ array(
+ 'theme' => urlencode( $stylesheet ),
+ 'return' => urlencode( admin_url( 'themes.php' ) ),
+ ),
+ admin_url( 'customize.php' )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( get_stylesheet() == $stylesheet ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $update_actions['preview'] = '<a href="' . wp_customize_url( $stylesheet ) . '" class="hide-if-no-customize load-customize"><span aria-hidden="true">' . __( 'Customize' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Customize “%s”' ), $name ) . '</span></a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $update_actions['preview'] = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize"><span aria-hidden="true">' . __( 'Customize' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Customize “%s”' ), $name ) . '</span></a>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( current_user_can( 'switch_themes' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $update_actions['preview'] = '<a href="' . wp_customize_url( $stylesheet ) . '" class="hide-if-no-customize load-customize"><span aria-hidden="true">' . __( 'Live Preview' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Live Preview “%s”' ), $name ) . '</span></a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $update_actions['preview'] = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize"><span aria-hidden="true">' . __( 'Live Preview' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Live Preview “%s”' ), $name ) . '</span></a>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $update_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink"><span aria-hidden="true">' . __( 'Activate' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Activate “%s”' ), $name ) . '</span></a>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminindexphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/index.php 2017-10-09 15:21:51 UTC (rev 41796)
+++ trunk/src/wp-admin/index.php 2017-10-09 16:03:35 UTC (rev 41797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,8 +16,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'dashboard' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( current_user_can( 'edit_theme_options' ) )
- wp_enqueue_script( 'customize-loader' );
</del><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'install_plugins' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'plugin-install' );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'updates' );
</span></span></pre></div>
<a id="trunksrcwpadminjscustomizecontrolsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/customize-controls.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/customize-controls.js 2017-10-09 15:21:51 UTC (rev 41796)
+++ trunk/src/wp-admin/js/customize-controls.js 2017-10-09 16:03:35 UTC (rev 41797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -106,7 +106,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param {string|wp.customize.Notification} - Notification object to add. Alternatively code may be supplied, and in that case the second notificationObject argument must be supplied.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param {string|wp.customize.Notification} notification - Notification object to add. Alternatively code may be supplied, and in that case the second notificationObject argument must be supplied.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {wp.customize.Notification} [notificationObject] - Notification to add when first argument is the code string.
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {wp.customize.Notification} Added notification (or existing instance if it was already added).
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3014,7 +3014,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> api.utils.parseQueryString( urlParser.search.substr( 1 ) ),
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> theme: themeId,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- changeset_uuid: api.settings.changeset.uuid
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ changeset_uuid: api.settings.changeset.uuid,
+ 'return': api.settings.url['return']
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3044,7 +3045,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> request.done( function() {
</span><span class="cx" style="display: block; padding: 0 10px"> deferred.resolve();
</span><span class="cx" style="display: block; padding: 0 10px"> $( window ).off( 'beforeunload.customize-confirm' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- window.location.href = urlParser.href; // @todo Use location.replace()?
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ location.replace( urlParser.href );
</ins><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px"> request.fail( function() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6958,7 +6959,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'changeset_already_published' === response.code && response.next_changeset_uuid ) {
</span><span class="cx" style="display: block; padding: 0 10px"> api.settings.changeset.uuid = response.next_changeset_uuid;
</span><span class="cx" style="display: block; padding: 0 10px"> api.state( 'changesetStatus' ).set( '' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- parent.send( 'changeset-uuid', api.settings.changeset.uuid );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( api.settings.changeset.branching ) {
+ parent.send( 'changeset-uuid', api.settings.changeset.uuid );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> api.previewer.send( 'changeset-uuid', api.settings.changeset.uuid );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6989,7 +6992,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> api.state( 'changesetStatus' ).set( '' );
</span><span class="cx" style="display: block; padding: 0 10px"> api.settings.changeset.uuid = response.next_changeset_uuid;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- parent.send( 'changeset-uuid', api.settings.changeset.uuid );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( api.settings.changeset.branching ) {
+ parent.send( 'changeset-uuid', api.settings.changeset.uuid );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Prevent subsequent requestChangesetUpdate() calls from including the settings that have been saved.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7065,6 +7070,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> urlParser.href = location.href;
</span><span class="cx" style="display: block; padding: 0 10px"> queryParams = api.utils.parseQueryString( urlParser.search.substr( 1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> delete queryParams.changeset_uuid;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ queryParams['return'] = api.settings.url['return'];
</ins><span class="cx" style="display: block; padding: 0 10px"> urlParser.search = $.param( queryParams );
</span><span class="cx" style="display: block; padding: 0 10px"> location.replace( urlParser.href );
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7418,6 +7424,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> queryParams.customize_autosaved = 'on';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ queryParams['return'] = api.settings.url['return'];
</ins><span class="cx" style="display: block; padding: 0 10px"> urlParser.search = $.param( queryParams );
</span><span class="cx" style="display: block; padding: 0 10px"> return urlParser.href;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7915,16 +7922,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> api.bind( 'change', startPromptingBeforeUnload );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- closeBtn.on( 'click.customize-controls-close', function( event ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function requestClose() {
</ins><span class="cx" style="display: block; padding: 0 10px"> var clearedToClose = $.Deferred();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- event.preventDefault();
-
- /*
- * The isInsideIframe condition is because Customizer is not able to use a confirm()
- * since customize-loader.js will also use one. So autosave restorations are disabled
- * when customize-loader.js is used.
- */
- if ( isInsideIframe || isCleanState() ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isCleanState() ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> clearedToClose.resolve();
</span><span class="cx" style="display: block; padding: 0 10px"> } else if ( confirm( api.l10n.saveAlert ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7954,15 +7954,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> clearedToClose.reject();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return clearedToClose.promise();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- clearedToClose.done( function() {
- $( window ).off( 'beforeunload.customize-confirm' );
- if ( isInsideIframe ) {
- parent.send( 'close' );
- } else {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parent.bind( 'confirm-close', function() {
+ requestClose().done( function() {
+ parent.send( 'confirmed-close', true );
+ } ).fail( function() {
+ parent.send( 'confirmed-close', false );
+ } );
+ } );
+
+ closeBtn.on( 'click.customize-controls-close', function( event ) {
+ event.preventDefault();
+ if ( isInsideIframe ) {
+ parent.send( 'close' ); // See confirm-close logic above.
+ } else {
+ requestClose().done( function() {
+ $( window ).off( 'beforeunload.customize-confirm' );
</ins><span class="cx" style="display: block; padding: 0 10px"> window.location.href = closeBtn.prop( 'href' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> })();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7978,7 +7990,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent.send( 'title', newTitle );
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- parent.send( 'changeset-uuid', api.settings.changeset.uuid );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( api.settings.changeset.branching ) {
+ parent.send( 'changeset-uuid', api.settings.changeset.uuid );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Initialize the connection with the parent frame.
</span><span class="cx" style="display: block; padding: 0 10px"> parent.send( 'ready' );
</span></span></pre></div>
<a id="trunksrcwpadminjsthemejs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/theme.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/theme.js 2017-10-09 15:21:51 UTC (rev 41796)
+++ trunk/src/wp-admin/js/theme.js 2017-10-09 16:03:35 UTC (rev 41797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,6 +77,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Render search form.
</span><span class="cx" style="display: block; padding: 0 10px"> this.search();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.$el.removeClass( 'search-loading' );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Render and append
</span><span class="cx" style="display: block; padding: 0 10px"> this.view.render();
</span><span class="cx" style="display: block; padding: 0 10px"> this.$el.empty().append( this.view.el ).addClass( 'rendered' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1345,17 +1347,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> event.target.value = '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * Since doSearch is debounced, it will only run when user input comes to a rest
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Note that doSearch is throttled.
</ins><span class="cx" style="display: block; padding: 0 10px"> this.doSearch( event );
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Runs a search on the theme collection.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- doSearch: _.debounce( function( event ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ doSearch: _.throttle( function( event ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var options = {};
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.collection.doSearch( event.target.value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.collection.doSearch( event.target.value.replace( /\+/g, ' ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // if search is initiated and key is not return
</span><span class="cx" style="display: block; padding: 0 10px"> if ( this.searching && event.which !== 13 ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1376,7 +1376,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var url = themes.router.baseUrl( '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( event.target.value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- url = themes.router.baseUrl( themes.router.searchPath + event.target.value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ url = themes.router.baseUrl( themes.router.searchPath + encodeURIComponent( event.target.value ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.searching = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1385,6 +1385,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Navigate router.
+ *
+ * @since 4.9.0
+ *
+ * @param {string} url - URL to navigate to.
+ * @param {object} state - State.
+ * @returns {void}
+ */
+function navigateRouter( url, state ) {
+ var router = this;
+ if ( Backbone.history._hasPushState ) {
+ Backbone.Router.prototype.navigate.call( router, url, state );
+ }
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Sets up the routes events for relevant url queries
</span><span class="cx" style="display: block; padding: 0 10px"> // Listens to [theme] and [search] params
</span><span class="cx" style="display: block; padding: 0 10px"> themes.Router = Backbone.Router.extend({
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1405,18 +1421,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> searchPath: '?search=',
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> search: function( query ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( '.wp-filter-search' ).val( query );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( '.wp-filter-search' ).val( query.replace( /\+/g, ' ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> themes: function() {
</span><span class="cx" style="display: block; padding: 0 10px"> $( '.wp-filter-search' ).val( '' );
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- navigate: function() {
- if ( Backbone.history._hasPushState ) {
- Backbone.Router.prototype.navigate.apply( this, arguments );
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ navigate: navigateRouter
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1508,7 +1520,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> this.doSearch( event.target.value );
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- doSearch: _.debounce( function( value ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ doSearch: _.throttle( function( value ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var request = {};
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Don't do anything if the search terms haven't changed.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1551,7 +1563,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> this.collection.query( request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set route
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- themes.router.navigate( themes.router.baseUrl( themes.router.searchPath + value ), { replace: true } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ themes.router.navigate( themes.router.baseUrl( themes.router.searchPath + encodeURIComponent( value ) ), { replace: true } );
</ins><span class="cx" style="display: block; padding: 0 10px"> }, 500 )
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1887,14 +1899,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> searchPath: '?search=',
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> search: function( query ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( '.wp-filter-search' ).val( query );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( '.wp-filter-search' ).val( query.replace( /\+/g, ' ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- navigate: function() {
- if ( Backbone.history._hasPushState ) {
- Backbone.Router.prototype.navigate.apply( this, arguments );
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ navigate: navigateRouter
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2003,6 +2011,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> themes.Run.init();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Update the return param just in time.
+ $( document.body ).on( 'click', '.load-customize', function() {
+ var link = $( this ), urlParser = document.createElement( 'a' );
+ urlParser.href = link.prop( 'href' );
+ urlParser.search = $.param( _.extend(
+ wp.customize.utils.parseQueryString( urlParser.search.substr( 1 ) ),
+ {
+ 'return': window.location.href
+ }
+ ) );
+ link.prop( 'href', urlParser.href );
+ });
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $( '.broken-themes .delete-theme' ).on( 'click', function() {
</span><span class="cx" style="display: block; padding: 0 10px"> return confirm( _wpThemeSettings.settings.confirmDelete );
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span></span></pre></div>
<a id="trunksrcwpadminthemesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/themes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/themes.php 2017-10-09 15:21:51 UTC (rev 41796)
+++ trunk/src/wp-admin/themes.php 2017-10-09 16:03:35 UTC (rev 41797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,14 +146,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_thickbox();
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'theme' );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'updates' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-wp_enqueue_script( 'customize-loader' );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . 'wp-admin/admin-header.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <h1 class="wp-heading-inline"><?php esc_html_e( 'Themes' ); ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <span class="title-count theme-count"><?php echo count( $themes ); ?></span>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <span class="title-count theme-count"><?php echo ! empty( $_GET['search'] ) ? __( '…' ) : count( $themes ); ?></span>
</ins><span class="cx" style="display: block; padding: 0 10px"> </h1>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -234,7 +233,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<div class="theme-browser">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+$class_name = 'theme-browser';
+if ( ! empty( $_GET['search'] ) ) {
+ $class_name .= ' search-loading';
+}
+?>
+<div class="<?php echo esc_attr( $class_name ); ?>">
</ins><span class="cx" style="display: block; padding: 0 10px"> <div class="themes wp-clearfix">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span></span></pre></div>
<a id="trunksrcwpadminupdatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/update.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/update.php 2017-10-09 15:21:51 UTC (rev 41796)
+++ trunk/src/wp-admin/update.php 2017-10-09 16:03:35 UTC (rev 41797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -173,7 +173,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> check_admin_referer('upgrade-theme_' . $theme);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_enqueue_script( 'customize-loader' );
</del><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'updates' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $title = __('Update Theme');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -223,11 +222,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> check_admin_referer( 'install-theme_' . $theme );
</span><span class="cx" style="display: block; padding: 0 10px"> $api = themes_api('theme_information', array('slug' => $theme, 'fields' => array('sections' => false, 'tags' => false) ) ); //Save on a bit of bandwidth.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_wp_error($api) )
- wp_die($api);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_wp_error( $api ) ) {
+ wp_die( $api );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_enqueue_script( 'customize-loader' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $title = __('Install Themes');
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_file = 'themes.php';
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu_file = 'themes.php';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,8 +251,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $file_upload = new File_Upload_Upgrader('themezip', 'package');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_enqueue_script( 'customize-loader' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $title = __('Upload Theme');
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_file = 'themes.php';
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu_file = 'theme-install.php';
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpcustomizemanagerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-customize-manager.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-customize-manager.php 2017-10-09 15:21:51 UTC (rev 41796)
+++ trunk/src/wp-includes/class-wp-customize-manager.php 2017-10-09 16:03:35 UTC (rev 41797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4236,6 +4236,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'url' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'preview' => esc_url_raw( $this->get_preview_url() ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'return' => esc_url_raw( $this->get_return_url() ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'parent' => esc_url_raw( admin_url() ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'activated' => esc_url_raw( home_url( '/' ) ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'ajax' => esc_url_raw( admin_url( 'admin-ajax.php', 'relative' ) ),
</span></span></pre></div>
<a id="trunksrcwpincludesjscustomizeloaderjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/customize-loader.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/customize-loader.js 2017-10-09 15:21:51 UTC (rev 41796)
+++ trunk/src/wp-includes/js/customize-loader.js 2017-10-09 16:03:35 UTC (rev 41797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,4 +1,4 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/* global _wpCustomizeLoaderSettings, confirm */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* global _wpCustomizeLoaderSettings */
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Expose a public API that allows the customizer to be
</span><span class="cx" style="display: block; padding: 0 10px"> * loaded on any page.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -208,25 +208,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Close the Customizer overlay.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> close: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! this.active ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var self = this, onConfirmClose;
+ if ( ! self.active ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Display AYS dialog if Customizer is dirty
- if ( ! this.saved() && ! confirm( Loader.settings.l10n.saveAlert ) ) {
- // Go forward since Customizer is exited by history.back()
- history.forward();
- return;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ onConfirmClose = function( confirmed ) {
+ if ( confirmed ) {
+ self.active = false;
+ self.trigger( 'close' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.active = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Restore document title prior to opening the Live Preview
+ if ( self.originalDocumentTitle ) {
+ document.title = self.originalDocumentTitle;
+ }
+ } else {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.trigger( 'close' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Go forward since Customizer is exited by history.back()
+ history.forward();
+ }
+ self.messenger.unbind( 'confirmed-close', onConfirmClose );
+ };
+ self.messenger.bind( 'confirmed-close', onConfirmClose );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Restore document title prior to opening the Live Preview
- if ( this.originalDocumentTitle ) {
- document.title = this.originalDocumentTitle;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Loader.messenger.send( 'confirm-close' );
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesscriptloaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/script-loader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/script-loader.php 2017-10-09 15:21:51 UTC (rev 41796)
+++ trunk/src/wp-includes/script-loader.php 2017-10-09 16:03:35 UTC (rev 41797)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -725,7 +725,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $scripts->add( 'text-widgets', "/wp-admin/js/widgets/text-widgets$suffix.js", array( 'jquery', 'backbone', 'editor', 'wp-util', 'wp-a11y' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $scripts->add( 'custom-html-widgets', "/wp-admin/js/widgets/custom-html-widgets$suffix.js", array( 'code-editor', 'jquery', 'backbone', 'wp-util', 'jquery-ui-core', 'wp-a11y' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $scripts->add( 'theme', "/wp-admin/js/theme$suffix.js", array( 'wp-backbone', 'wp-a11y' ), false, 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $scripts->add( 'theme', "/wp-admin/js/theme$suffix.js", array( 'wp-backbone', 'wp-a11y', 'customize-base' ), false, 1 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'tags-suggest', 'wp-a11y' ), false, 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> did_action( 'init' ) && $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
</span></span></pre>
</div>
</div>
</body>
</html>