Changeset 15757
- Timestamp:
- 10/08/2010 03:29:57 AM (14 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r15632 r15757 1464 1464 die( '0' ); 1465 1465 break; 1466 case 'date_format' : 1467 die( date_i18n( sanitize_option( 'date_format', $_POST['date'] ) ) ); 1468 break; 1469 case 'time_format' : 1470 die( date_i18n( sanitize_option( 'time_format', $_POST['date'] ) ) ); 1471 break; 1466 1472 default : 1467 1473 do_action( 'wp_ajax_' . $_POST['action'] ); -
trunk/wp-admin/options-general.php
r15132 r15757 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(){ … … 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 }); 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_format_custom' == format.attr('name') ? 'date_format' : 'time_format', 51 date : format.val(), 52 }, function(d) { format.siblings('img').css('visibility','hidden'); format.siblings('.example').text(d); } ); 45 53 }); 46 54 }); … … 266 274 $custom = false; 267 275 } 268 echo ' /> ' . date_i18n( $format ) . "</label><br />\n";276 echo ' /> <span>' . date_i18n( $format ) . "</span></label><br />\n"; 269 277 } 270 278 271 279 echo ' <label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"'; 272 280 checked( $custom ); 273 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";274 275 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";281 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"; 282 283 echo "\t<p>" . __('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.') . "</p>\n"; 276 284 ?> 277 285 </fieldset> … … 298 306 $custom = false; 299 307 } 300 echo ' /> ' . date_i18n( $format ) . "</label><br />\n";308 echo ' /> <span>' . date_i18n( $format ) . "</span></label><br />\n"; 301 309 } 302 310 303 311 echo ' <label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"'; 304 312 checked( $custom ); 305 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"; 313 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"; 314 ; 306 315 ?> 307 316 </fieldset>
Note: See TracChangeset
for help on using the changeset viewer.