Message info
 
To:wp-svn@lists.automattic.com From:m@wordpress.org Subject:[wp-svn] [20864] trunk: Theme Customizer: Change \'Return to...\' link to \'Cancel\' and move \'Save\' button to header. Date:Thu, 24 May 2012 03:29:51 +0000 (UTC)
 

Revision
20864
Author
koopersmith
Date
2012-05-24 03:29:51 +0000 (Thu, 24 May 2012)

Log Message

Theme Customizer: Change 'Return to...' link to 'Cancel' and move 'Save' button to header. props helenyhou, fixes #20692, see #19910.

Modified Paths

Diff

Modified: trunk/wp-admin/customize.php (20863 => 20864)


--- trunk/wp-admin/customize.php	2012-05-24 02:07:16 UTC (rev 20863)
+++ trunk/wp-admin/customize.php	2012-05-24 03:29:51 UTC (rev 20864)
@@ -50,8 +50,13 @@
 	<form id="customize-controls" class="wrap wp-full-overlay-sidebar">
 		<?php wp_nonce_field( 'customize_controls' ); ?>
 		<div id="customize-header-actions" class="wp-full-overlay-header">
-			<a class="back" href="<?php echo esc_url( admin_url( 'themes.php' ) ); ?>">
-				<?php printf( __( '&larr; Return to %s' ), __('Manage Themes') ); ?>
+			<?php
+				$save_text = $wp_customize->is_theme_active() ? __( 'Save' ) : __( 'Save and Activate' );
+				submit_button( $save_text, 'primary', 'save', false );
+			?>
+			<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" />
+			<a class="back button" href="<?php echo esc_url( admin_url( 'themes.php' ) ); ?>">
+				<?php _e( 'Cancel' ); ?>
 			</a>
 		</div>
 
@@ -81,12 +86,6 @@
 		</div>
 
 		<div id="customize-footer-actions" class="wp-full-overlay-footer">
-			<?php
-			$save_text = $wp_customize->is_theme_active() ? __('Save') : __('Save and Activate');
-			submit_button( $save_text, 'primary', 'save', false );
-			?>
-			<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" />
-
 			<a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>">
 				<span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>
 				<span class="collapse-sidebar-arrow"></span>

Modified: trunk/wp-includes/css/customize-controls.dev.css (20863 => 20864)


--- trunk/wp-includes/css/customize-controls.dev.css	2012-05-24 02:07:16 UTC (rev 20863)
+++ trunk/wp-includes/css/customize-controls.dev.css	2012-05-24 03:29:51 UTC (rev 20864)
@@ -131,20 +131,20 @@
 	margin: 0;
 }
 
-#customize-footer-actions img {
-	display: none;
-	position: absolute;
-	top: 15px;
-	margin-left: 4px;
+#customize-header-actions .button-primary {
+	float: right;
+	margin-top: 11px;
 }
 
-.saving #customize-footer-actions img {
-	display: inline;
+#customize-header-actions img {
+	display: none;
+	float: right;
+	margin-top: 13px;
+	margin-right: 4px;
 }
 
-#customize-footer-actions .button-primary {
-	display: inline-block;
-	margin-top: 12px;
+.saving #customize-header-actions img {
+	display: block;
 }
 
 .customize-control {

Modified: trunk/wp-includes/js/customize-controls.dev.js (20863 => 20864)


--- trunk/wp-includes/js/customize-controls.dev.js	2012-05-24 02:07:16 UTC (rev 20863)
+++ trunk/wp-includes/js/customize-controls.dev.js	2012-05-24 03:29:51 UTC (rev 20864)
@@ -496,13 +496,8 @@
 
 		// If we receive a 'back' event, we're inside an iframe.
 		// Send any clicks to the 'Return' link to the parent page.
-		parent.bind( 'back', function( text ) {
-			var back = $('.back');
-
-			if ( text )
-				back.text( text );
-
-			back.on( 'click.back', function( event ) {
+		parent.bind( 'back', function() {
+			$('.back').on( 'click.back', function( event ) {
 				event.preventDefault();
 				parent.send( 'close' );
 			});

Modified: trunk/wp-includes/js/customize-loader.dev.js (20863 => 20864)


--- trunk/wp-includes/js/customize-loader.dev.js	2012-05-24 02:07:16 UTC (rev 20863)
+++ trunk/wp-includes/js/customize-loader.dev.js	2012-05-24 03:29:51 UTC (rev 20864)
@@ -69,7 +69,7 @@
 
 			// Wait for the connection from the iframe before sending any postMessage events.
 			this.messenger.bind( 'ready', function() {
-				Loader.messenger.send( 'back', wpCustomizeLoaderL10n.back || '' );
+				Loader.messenger.send( 'back' );
 			});
 
 			this.messenger.bind( 'close', function() {

Modified: trunk/wp-includes/theme.php (20863 => 20864)


--- trunk/wp-includes/theme.php	2012-05-24 02:07:16 UTC (rev 20863)
+++ trunk/wp-includes/theme.php	2012-05-24 03:29:51 UTC (rev 20864)
@@ -1589,12 +1589,9 @@
  * @since 3.4.0
  */
 function _wp_customize_loader_localize() {
-	$l10n = array( 'url'  => admin_url( 'admin.php' ) );
-
-	if ( is_admin() )
-		$l10n[ 'back' ] = sprintf( __( '&larr; Return to %s' ), get_admin_page_title() );
-
-	wp_localize_script( 'customize-loader', 'wpCustomizeLoaderL10n', $l10n );
+	wp_localize_script( 'customize-loader', 'wpCustomizeLoaderL10n', array(
+		'url' => admin_url( 'admin.php' ),
+	) );
 }
 add_action( 'admin_enqueue_scripts', '_wp_customize_loader_localize' );