Ticket #12636: 12636.diff
File 12636.diff, 4.1 KB (added by , 13 years ago) |
---|
-
wp-admin/admin-ajax.php
1422 1422 update_post_meta( $link_id, '_menu_item_url', $link_url ); 1423 1423 1424 1424 die( json_encode($link_id) ); 1425 case 'date_i18n' : 1426 $return = date_i18n( $_POST['date'] ); 1427 die( $return ); 1428 break; 1425 1429 default : 1426 1430 do_action( 'wp_ajax_' . $_POST['action'] ); 1427 1431 die('0'); -
wp-admin/options-general.php
30 30 jQuery(document).ready(function($){ 31 31 $("input[name='date_format']").click(function(){ 32 32 if ( "date_format_custom_radio" != $(this).attr("id") ) 33 $("input[name='date_format_custom']").val( $(this).val() ) ;33 $("input[name='date_format_custom']").val( $(this).val() ).siblings('.example').text( $(this).siblings('span').text() ); 34 34 }); 35 35 $("input[name='date_format_custom']").focus(function(){ 36 36 $("#date_format_custom_radio").attr("checked", "checked"); … … 38 38 39 39 $("input[name='time_format']").click(function(){ 40 40 if ( "time_format_custom_radio" != $(this).attr("id") ) 41 $("input[name='time_format_custom']").val( $(this).val() ) ;41 $("input[name='time_format_custom']").val( $(this).val() ).siblings('.example').text( $(this).siblings('span').text() ); 42 42 }); 43 43 $("input[name='time_format_custom']").focus(function(){ 44 44 $("#time_format_custom_radio").attr("checked", "checked"); 45 45 }); 46 $("input[name='date_format_custom'], input[name='time_format_custom']").change( function() { 47 var format = $(this); 48 format.siblings('img').css('visibility','visible'); 49 $.post(ajaxurl, { 50 action: 'date_i18n', 51 date : format.val(), 52 }, function(d) { format.siblings('.example').text(d); format.siblings('img').css('visibility','hidden'); } ); 53 }); 46 54 }); 47 55 //]]> 48 56 </script> … … 255 263 echo " checked='checked'"; 256 264 $custom = false; 257 265 } 258 echo ' /> ' . date_i18n( $format ) . "</label><br />\n";266 echo ' /> <span>' . date_i18n( $format ) . "</span></label><br />\n"; 259 267 } 260 268 261 269 echo ' <label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"'; 262 270 checked( $custom ); 263 echo '/> ' . __('Custom:') . ' </label><input type="text" name="date_format_custom" value="' . esc_attr( get_option('date_format') ) . '" class="small-text" /> ' . date_i18n( get_option('date_format') ) . "\n";271 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 style='visibility:hidden' src='" . esc_url( admin_url( 'images/wpspin_light.gif' ) ) . "' />\n"; 264 272 265 echo "\t<p>" . __('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date formatting</a>. Click “Save Changes” to update sample output.') . "</p>\n";273 echo "\t<p>" . __('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.') . "</p>\n"; 266 274 ?> 267 275 </fieldset> 268 276 </td> … … 287 295 echo " checked='checked'"; 288 296 $custom = false; 289 297 } 290 echo ' /> ' . date_i18n( $format ) . "</label><br />\n";298 echo ' /> <span>' . date_i18n( $format ) . "</span></label><br />\n"; 291 299 } 292 300 293 301 echo ' <label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"'; 294 302 checked( $custom ); 295 echo '/> ' . __('Custom:') . ' </label><input type="text" name="time_format_custom" value="' . esc_attr( get_option('time_format') ) . '" class="small-text" /> ' . date_i18n( get_option('time_format') ) . "\n"; 303 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 style='visibility:hidden' src='" . esc_url( admin_url( 'images/wpspin_light.gif' ) ) . "' />\n"; 304 ; 296 305 ?> 297 306 </fieldset> 298 307 </td>