Make WordPress Core


Ignore:
Timestamp:
09/26/2012 07:57:44 PM (12 years ago)
Author:
nacin
Message:

New HiDPI spinner. Uses clean <span class="spinner"></span> markup.

Be on the lookout for weirdness.
props lessbloat. see #21456.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-general.php

    r21994 r22019  
    4545        $("input[name='date_format_custom'], input[name='time_format_custom']").change( function() {
    4646            var format = $(this);
    47             format.siblings('img').css('visibility','visible');
     47            format.siblings('.spinner').css('display', 'inline-block'); // show(); can't be used here
    4848            $.post(ajaxurl, {
    4949                    action: 'date_format_custom' == format.attr('name') ? 'date_format' : 'time_format',
    5050                    date : format.val()
    51                 }, function(d) { format.siblings('img').css('visibility','hidden'); format.siblings('.example').text(d); } );
     51                }, function(d) { format.siblings('.spinner').hide(); format.siblings('.example').text(d); } );
    5252        });
    5353    });
     
    251251    echo '  <label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
    252252    checked( $custom );
    253     echo '/> ' . __('Custom:') . ' </label><input type="text" name="date_format_custom" value="' . esc_attr( get_option('date_format') ) . '" class="small-text" /> <span class="example"> ' . date_i18n( get_option('date_format') ) . "</span> <img class='ajax-loading' src='" . esc_url( admin_url( 'images/wpspin_light.gif' ) ) . "' />\n";
     253    echo '/> ' . __('Custom:') . ' </label><input type="text" name="date_format_custom" value="' . esc_attr( get_option('date_format') ) . '" class="small-text" /> <span class="example"> ' . date_i18n( get_option('date_format') ) . "</span> <span class='spinner'></span>\n";
    254254
    255255    echo "\t<p>" . __('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.') . "</p>\n";
     
    283283    echo '  <label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"';
    284284    checked( $custom );
    285     echo '/> ' . __('Custom:') . ' </label><input type="text" name="time_format_custom" value="' . esc_attr( get_option('time_format') ) . '" class="small-text" /> <span class="example"> ' . date_i18n( get_option('time_format') ) . "</span> <img class='ajax-loading' src='" . esc_url( admin_url( 'images/wpspin_light.gif' ) ) . "' />\n";
     285    echo '/> ' . __('Custom:') . ' </label><input type="text" name="time_format_custom" value="' . esc_attr( get_option('time_format') ) . '" class="small-text" /> <span class="example"> ' . date_i18n( get_option('time_format') ) . "</span> <span class='spinner'></span>\n";
    286286    ;
    287287?>
Note: See TracChangeset for help on using the changeset viewer.