Changeset 30306
- Timestamp:
- 11/11/2014 10:28:38 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/customize.php
r30164 r30306 77 77 $is_ios = wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] ); 78 78 79 if ( $is_ios ) 79 if ( $is_ios ) { 80 80 $body_class .= ' ios'; 81 82 if ( is_rtl() ) 83 $body_class .= ' rtl'; 81 } 82 83 if ( is_rtl() ) { 84 $body_class .= ' rtl'; 85 } 84 86 $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 85 87 86 $admin_title = sprintf( __( '%1$s — WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $wp_customize->theme()->display('Name') ) ) ); 88 if ( $wp_customize->is_theme_active() ) { 89 $document_title_tmpl = _x( 'Customize: %s', 'Placeholder is the document title from the preview' ); 90 } else { 91 $document_title_tmpl = _x( 'Live Preview: %s', 'Placeholder is the document title from the preview' ); 92 } 93 $document_title_tmpl = html_entity_decode( $document_title_tmpl, ENT_QUOTES, 'UTF-8' ); // because exported to JS and assigned to document.title 94 $admin_title = sprintf( $document_title_tmpl, __( 'Loading…' ) ); 95 87 96 ?><title><?php echo $admin_title; ?></title> 88 97 … … 254 263 ), 255 264 'autofocus' => array(), 265 'documentTitleTmpl' => $document_title_tmpl, 256 266 ); 257 267 -
trunk/src/wp-admin/js/customize-controls.js
r30214 r30306 1501 1501 1502 1502 /** 1503 * Set the document title of the customizer 1504 * 1505 * @param {string} documentTitle 1506 */ 1507 api.setDocumentTitle = function ( documentTitle ) { 1508 var tmpl, title; 1509 tmpl = api.settings.documentTitleTmpl; 1510 title = tmpl.replace( '%s', documentTitle ); 1511 document.title = title; 1512 if ( window !== window.parent ) { 1513 window.parent.document.title = document.title; 1514 } 1515 }; 1516 1517 /** 1503 1518 * @constructor 1504 1519 * @augments wp.customize.Messenger … … 1618 1633 // Update the URL when the iframe sends a URL message. 1619 1634 this.bind( 'url', this.previewUrl ); 1635 1636 // Update the document title when the preview changes 1637 this.bind( 'documentTitle', function ( title ) { 1638 api.setDocumentTitle( title ); 1639 } ); 1620 1640 }, 1621 1641 -
trunk/src/wp-includes/js/customize-loader.js
r29903 r30306 79 79 } 80 80 81 if ( ! hash && ! $.support.history ) {81 if ( ! hash && ! $.support.history ) { 82 82 Loader.close(); 83 83 } … … 105 105 return window.location = src; 106 106 } 107 108 // Store the document title prior to opening the Live Preview 109 this.originalDocumentTitle = document.title; 107 110 108 111 this.active = true; … … 135 138 Loader.close(); 136 139 } 137 } 140 }); 138 141 139 142 // Prompt AYS dialog when navigating away … … 159 162 160 163 pushState: function ( src ) { 161 var hash ;164 var hash = src.split( '?' )[1]; 162 165 163 166 // Ensure we don't call pushState if the user hit the forward button. … … 165 168 history.pushState( { customize: src }, '', src ); 166 169 } else if ( ! $.support.history && $.support.hashchange && hash ) { 167 hash = src.split( '?' )[1];168 170 window.location.hash = 'wp_customize=on&' + hash; 169 171 } 172 173 this.trigger( 'open' ); 170 174 }, 171 175 … … 195 199 196 200 this.trigger( 'close' ); 201 202 // Restore document title prior to opening the Live Preview 203 if ( this.originalDocumentTitle ) { 204 document.title = this.originalDocumentTitle; 205 } 197 206 198 207 // Return focus to link that was originally clicked. -
trunk/src/wp-includes/js/customize-preview.js
r30102 r30306 102 102 }); 103 103 104 preview.bind( 'active', function() { 105 if ( api.settings.nonce ) 106 preview.send( 'nonce', api.settings.nonce ); 107 }); 104 preview.bind( 'active', function() { 105 if ( api.settings.nonce ) { 106 preview.send( 'nonce', api.settings.nonce ); 107 } 108 109 preview.send( 'documentTitle', document.title ); 110 }); 108 111 109 112 preview.send( 'ready', {
Note: See TracChangeset
for help on using the changeset viewer.