Make WordPress Core

Changeset 20864


Ignore:
Timestamp:
05/24/2012 03:29:51 AM (12 years ago)
Author:
koopersmith
Message:

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

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/customize.php

    r20858 r20864  
    5151        <?php wp_nonce_field( 'customize_controls' ); ?>
    5252        <div id="customize-header-actions" class="wp-full-overlay-header">
    53             <a class="back" href="<?php echo esc_url( admin_url( 'themes.php' ) ); ?>">
    54                 <?php printf( __( '&larr; Return to %s' ), __('Manage Themes') ); ?>
     53            <?php
     54                $save_text = $wp_customize->is_theme_active() ? __( 'Save' ) : __( 'Save and Activate' );
     55                submit_button( $save_text, 'primary', 'save', false );
     56            ?>
     57            <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" />
     58            <a class="back button" href="<?php echo esc_url( admin_url( 'themes.php' ) ); ?>">
     59                <?php _e( 'Cancel' ); ?>
    5560            </a>
    5661        </div>
     
    8287
    8388        <div id="customize-footer-actions" class="wp-full-overlay-footer">
    84             <?php
    85             $save_text = $wp_customize->is_theme_active() ? __('Save') : __('Save and Activate');
    86             submit_button( $save_text, 'primary', 'save', false );
    87             ?>
    88             <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" />
    89 
    9089            <a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>">
    9190                <span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>
  • trunk/wp-includes/css/customize-controls.dev.css

    r20824 r20864  
    132132}
    133133
    134 #customize-footer-actions img {
    135     display: none;
    136     position: absolute;
    137     top: 15px;
    138     margin-left: 4px;
    139 }
    140 
    141 .saving #customize-footer-actions img {
    142     display: inline;
    143 }
    144 
    145 #customize-footer-actions .button-primary {
    146     display: inline-block;
    147     margin-top: 12px;
     134#customize-header-actions .button-primary {
     135    float: right;
     136    margin-top: 11px;
     137}
     138
     139#customize-header-actions img {
     140    display: none;
     141    float: right;
     142    margin-top: 13px;
     143    margin-right: 4px;
     144}
     145
     146.saving #customize-header-actions img {
     147    display: block;
    148148}
    149149
  • trunk/wp-includes/js/customize-controls.dev.js

    r20861 r20864  
    497497        // If we receive a 'back' event, we're inside an iframe.
    498498        // Send any clicks to the 'Return' link to the parent page.
    499         parent.bind( 'back', function( text ) {
    500             var back = $('.back');
    501 
    502             if ( text )
    503                 back.text( text );
    504 
    505             back.on( 'click.back', function( event ) {
     499        parent.bind( 'back', function() {
     500            $('.back').on( 'click.back', function( event ) {
    506501                event.preventDefault();
    507502                parent.send( 'close' );
  • trunk/wp-includes/js/customize-loader.dev.js

    r20802 r20864  
    7070            // Wait for the connection from the iframe before sending any postMessage events.
    7171            this.messenger.bind( 'ready', function() {
    72                 Loader.messenger.send( 'back', wpCustomizeLoaderL10n.back || '' );
     72                Loader.messenger.send( 'back' );
    7373            });
    7474
  • trunk/wp-includes/theme.php

    r20852 r20864  
    15901590 */
    15911591function _wp_customize_loader_localize() {
    1592     $l10n = array( 'url'  => admin_url( 'admin.php' ) );
    1593 
    1594     if ( is_admin() )
    1595         $l10n[ 'back' ] = sprintf( __( '&larr; Return to %s' ), get_admin_page_title() );
    1596 
    1597     wp_localize_script( 'customize-loader', 'wpCustomizeLoaderL10n', $l10n );
     1592    wp_localize_script( 'customize-loader', 'wpCustomizeLoaderL10n', array(
     1593        'url' => admin_url( 'admin.php' ),
     1594    ) );
    15981595}
    15991596add_action( 'admin_enqueue_scripts', '_wp_customize_loader_localize' );
Note: See TracChangeset for help on using the changeset viewer.