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

git-svn-id: http://core.svn.wordpress.org/trunk@20864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
koopersmith 2012-05-24 03:29:51 +00:00
parent f6882e94ef
commit 4973f92107
5 changed files with 24 additions and 33 deletions

View File

@ -50,8 +50,13 @@ do_action( 'customize_controls_print_scripts' );
<form id="customize-controls" class="wrap wp-full-overlay-sidebar"> <form id="customize-controls" class="wrap wp-full-overlay-sidebar">
<?php wp_nonce_field( 'customize_controls' ); ?> <?php wp_nonce_field( 'customize_controls' ); ?>
<div id="customize-header-actions" class="wp-full-overlay-header"> <div id="customize-header-actions" class="wp-full-overlay-header">
<a class="back" href="<?php echo esc_url( admin_url( 'themes.php' ) ); ?>"> <?php
<?php printf( __( '&larr; Return to %s' ), __('Manage Themes') ); ?> $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> </a>
</div> </div>
@ -81,12 +86,6 @@ do_action( 'customize_controls_print_scripts' );
</div> </div>
<div id="customize-footer-actions" class="wp-full-overlay-footer"> <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'); ?>"> <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-label"><?php _e('Collapse'); ?></span>
<span class="collapse-sidebar-arrow"></span> <span class="collapse-sidebar-arrow"></span>

View File

@ -131,20 +131,20 @@ body {
margin: 0; margin: 0;
} }
#customize-footer-actions img { #customize-header-actions .button-primary {
float: right;
margin-top: 11px;
}
#customize-header-actions img {
display: none; display: none;
position: absolute; float: right;
top: 15px; margin-top: 13px;
margin-left: 4px; margin-right: 4px;
} }
.saving #customize-footer-actions img { .saving #customize-header-actions img {
display: inline; display: block;
}
#customize-footer-actions .button-primary {
display: inline-block;
margin-top: 12px;
} }
.customize-control { .customize-control {

View File

@ -496,13 +496,8 @@
// If we receive a 'back' event, we're inside an iframe. // If we receive a 'back' event, we're inside an iframe.
// Send any clicks to the 'Return' link to the parent page. // Send any clicks to the 'Return' link to the parent page.
parent.bind( 'back', function( text ) { parent.bind( 'back', function() {
var back = $('.back'); $('.back').on( 'click.back', function( event ) {
if ( text )
back.text( text );
back.on( 'click.back', function( event ) {
event.preventDefault(); event.preventDefault();
parent.send( 'close' ); parent.send( 'close' );
}); });

View File

@ -69,7 +69,7 @@ if ( typeof wp === 'undefined' )
// Wait for the connection from the iframe before sending any postMessage events. // Wait for the connection from the iframe before sending any postMessage events.
this.messenger.bind( 'ready', function() { this.messenger.bind( 'ready', function() {
Loader.messenger.send( 'back', wpCustomizeLoaderL10n.back || '' ); Loader.messenger.send( 'back' );
}); });
this.messenger.bind( 'close', function() { this.messenger.bind( 'close', function() {

View File

@ -1589,12 +1589,9 @@ add_action( 'plugins_loaded', '_wp_customize_include' );
* @since 3.4.0 * @since 3.4.0
*/ */
function _wp_customize_loader_localize() { function _wp_customize_loader_localize() {
$l10n = array( 'url' => admin_url( 'admin.php' ) ); wp_localize_script( 'customize-loader', 'wpCustomizeLoaderL10n', 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 );
} }
add_action( 'admin_enqueue_scripts', '_wp_customize_loader_localize' ); add_action( 'admin_enqueue_scripts', '_wp_customize_loader_localize' );