Make WordPress Core

Ticket #10660: 10660-refresh.diff

File 10660-refresh.diff, 3.5 KB (added by rmccue, 12 years ago)

Refresh patch

  • wp-admin/css/wp-admin.css

    diff --git wp-admin/css/wp-admin.css wp-admin/css/wp-admin.css
    index ebb78cc..e67617f 100644
    abbr.required { 
    39543954        bottom: 1px;
    39553955}
    39563956
     3957#timezone_suggest_working {
     3958        padding-bottom: 4px;
     3959        vertical-align: bottom;
     3960        display: none;
     3961}
     3962
     3963#timezone_suggest_result {
     3964        display: none;
     3965        color: #f00;
     3966}
     3967
     3968#timezone_suggest_use {
     3969        display: none;
     3970        margin-left: 5px;
     3971}
     3972
    39573973ul#dismissed-updates {
    39583974        display: none;
    39593975}
  • wp-admin/options-general.php

    diff --git wp-admin/options-general.php wp-admin/options-general.php
    index fdae33a..959945c 100644
    function options_general_add_js() { 
    5050                                        date : format.val()
    5151                                }, function(d) { format.siblings('.spinner').hide(); format.siblings('.example').text(d); } );
    5252                });
     53                $("#timezone_suggest").click(function(){
     54                        $("#timezone_suggest_working").animate({opacity:'show'},500);
     55                        $.ajax({
     56                                type: 'GET',
     57                                dataType: 'jsonp',
     58                                url: 'http://api.wordpress.org/core/ip-to-zoneinfo/1.0/',
     59                                success: function(data){
     60                                        if (data.errorcode) {
     61                                                $("#timezone_suggest_result span").text('<?php echo esc_js(__('Unable to suggest timezone')); ?>');
     62                                        } else {
     63                                                var text = '<?php echo esc_js(__('Based on your IP address, we suggest the %s timezone.')); ?>';
     64                                                text = text.replace('%s', data.timezoneId);
     65                                                $("#timezone_suggest_result span").text(text);
     66                                                $("#timezone_suggest_use").show().click(function () {
     67                                                        $("#timezone_string").val(data.timezoneId);
     68                                                        $("#timezone_suggest_result").animate({opacity:'hide'}, 2000, function() {
     69                                                                $("#timezone_suggest_use").hide();
     70                                                        });
     71                                                });
     72                                        }
     73                                        $("#timezone_suggest_working").animate(
     74                                                {opacity:'hide'},
     75                                                500,
     76                                                'linear',
     77                                                function(){
     78                                                        $("#timezone_suggest_result").animate({opacity:'show'},1000);
     79                                                }
     80                                        );
     81                                }
     82                        });
     83                });
    5384        });
    5485//]]>
    5586</script>
    if ( ! is_multisite() ) { 
    6697}
    6798
    6899$options_help .= '<p>' . __('UTC means Coordinated Universal Time.') . '</p>' .
     100        '<p>' . __('The timezone suggest utility is powered by the GeoNames database. <code>api.wordpress.org</code> is used to suggest this timezone, based on your IP. No information is stored as a result of this utility.') . '</p>' .
    69101        '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>';
    70102
    71103get_current_screen()->add_help_tab( array(
    if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists 
    176208<?php if ( get_option('timezone_string') || !empty($current_offset) ) : ?>
    177209        <span id="local-time"><?php printf(__('Local time is <code>%1$s</code>'), date_i18n($timezone_format)); ?></span>
    178210<?php endif; ?>
    179 <p class="description"><?php _e('Choose a city in the same timezone as you.'); ?></p>
     211<input id="timezone_suggest" type="button" class="button" value="<?php esc_attr_e('Suggest a time zone'); ?>" />
     212<img id="timezone_suggest_working" src="images/wpspin_light.gif" width="16" height="16" /><br />
     213<p id="timezone_suggest_result">
     214        <span></span><input id="timezone_suggest_use" type="button" class="button" value="<?php esc_attr_e('Use this timezone') ?>" />
     215</p>
     216<span class="description"><?php _e('WordPress can suggest a time zone for you based on your computers IP address, or you may manually select a city in the same time zone as you.'); ?></span>
    180217<?php if ($check_zone_info && $tzstring) : ?>
    181218<br />
    182219<span>