Ticket #35064: 35064.4.patch
File 35064.4.patch, 8.9 KB (added by , 9 years ago) |
---|
-
src/wp-admin/css/forms.css
655 655 margin-bottom: 0; 656 656 } 657 657 658 .form-table .date-time-doc { 659 margin-top: 1em; 660 } 661 662 .form-table p.timezone-info { 663 margin: 1em 0; 664 } 665 658 666 .form-table td fieldset label { 659 667 margin: 0.25em 0 0.5em !important; 660 668 display: inline-block; … … 893 901 20.0 - Settings 894 902 ------------------------------------------------------------------------------*/ 895 903 896 #utc-time, #local-time { 897 padding-left: 25px; 898 font-style: italic; 904 .timezone-info code { 905 white-space: nowrap; 899 906 } 900 907 901 908 .defaultavatarpicker .avatar { … … 903 910 vertical-align: middle; 904 911 } 905 912 913 .options-general-php .date-time-text { 914 display: inline-block; 915 min-width: 10em; 916 } 917 906 918 .options-general-php input.small-text { 907 919 width: 56px; 908 920 } … … 1268 1280 display: block; 1269 1281 } 1270 1282 1271 #utc-time {1272 margin-top: 10px;1273 }1274 1275 1283 #utc-time, 1276 1284 #local-time { 1277 1285 display: block; 1278 1286 float: none; 1279 padding: 0; 1280 line-height: 2; 1287 margin-top: 0.5em; 1281 1288 } 1282 1289 1283 1290 .form-field #domain { … … 1316 1323 .wp-pwd .button .text { 1317 1324 display: none; 1318 1325 } 1326 1327 .options-general-php input[type="text"].small-text { 1328 max-width: 60px; 1329 margin: 0; 1330 } 1319 1331 } 1320 1332 1321 1333 @media only screen and (max-width: 768px) { … … 1358 1370 width: 49%; 1359 1371 } 1360 1372 } 1373 1374 @media only screen and (max-width: 320px) { 1375 .options-general-php .date-time-text.date-time-custom-text { 1376 min-width: 0; 1377 margin-right: 0.5em; 1378 } 1379 } -
src/wp-admin/includes/options.php
51 51 52 52 $("input[name='date_format']").click(function(){ 53 53 if ( "date_format_custom_radio" != $(this).attr("id") ) 54 $( "input[name='date_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ). text() );54 $( "input[name='date_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() ); 55 55 }); 56 56 $("input[name='date_format_custom']").focus(function(){ 57 57 $( '#date_format_custom_radio' ).prop( 'checked', true ); … … 59 59 60 60 $("input[name='time_format']").click(function(){ 61 61 if ( "time_format_custom_radio" != $(this).attr("id") ) 62 $( "input[name='time_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ). text() );62 $( "input[name='time_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() ); 63 63 }); 64 64 $("input[name='time_format_custom']").focus(function(){ 65 65 $( '#time_format_custom_radio' ).prop( 'checked', true ); -
src/wp-admin/options-general.php
145 145 <?php echo wp_timezone_choice($tzstring); ?> 146 146 </select> 147 147 148 <p class="description" id="timezone-description"><?php _e( 'Choose a city in the same timezone as you.' ); ?></p> 149 <?php if ( $check_zone_info && $tzstring ) : ?> 150 151 <p class="timezone-info"> 148 152 <span id="utc-time"><?php 149 /* translators: %s: UTC time */ 150 printf( __( '<abbr title="Coordinated Universal Time">UTC</abbr> time is %s' ), 153 /* translators: 1: UTC abbreviation, 2: UTC time */ 154 printf( __( 'Universal time (%1$s) is %2$s.' ), 155 '<abbr>' . __( 'UTC' ) . '</abbr>', 151 156 '<code>' . date_i18n( $timezone_format, false, 'gmt' ) . '</code>' 152 157 ); 153 158 ?></span> 154 <?php if ( get_option( 'timezone_string') || !empty($current_offset) ) : ?>159 <?php if ( get_option( 'timezone_string' ) || ! empty( $current_offset ) ) : ?> 155 160 <span id="local-time"><?php 156 161 /* translators: %s: local time */ 157 printf( __( 'Local time is %s ' ),162 printf( __( 'Local time is %s.' ), 158 163 '<code>' . date_i18n( $timezone_format ) . '</code>' 159 164 ); 160 165 ?></span> 161 166 <?php endif; ?> 162 < p class="description" id="timezone-description"><?php _e( 'Choose a city in the same timezone as you.' ); ?></p>163 <?php if ($check_zone_info && $tzstring) : ?> 164 < br />167 </p> 168 169 <p class="timezone-info"> 165 170 <span> 166 171 <?php 167 172 // Set TZ so localtime works. … … 211 216 ?> 212 217 </span> 213 218 <?php endif; ?> 219 </p> 214 220 </td> 215 221 216 222 </tr> … … 232 238 $custom = true; 233 239 234 240 foreach ( $date_formats as $format ) { 235 echo "\t<label title='" . esc_attr($format) . "'><input type='radio' name='date_format' value='" . esc_attr($format) . "'";241 echo "\t<label><input type='radio' name='date_format' value='" . esc_attr( $format ) . "'"; 236 242 if ( get_option('date_format') === $format ) { // checked() uses "==" rather than "===" 237 243 echo " checked='checked'"; 238 244 $custom = false; 239 245 } 240 echo ' /> ' . date_i18n( $format ) . "</label><br />\n";246 echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . $format . "</code></label><br />\n"; 241 247 } 242 248 243 echo ' 249 echo '<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"'; 244 250 checked( $custom ); 245 echo '/> ' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom date format in the following field' ) . "</span></label>\n"; 246 echo '<label for="date_format_custom" class="screen-reader-text">' . __( 'Custom date format:' ) . '</label><input type="text" name="date_format_custom" id="date_format_custom" value="' . esc_attr( get_option('date_format') ) . '" class="small-text" /> <span class="screen-reader-text">' . __( 'example:' ) . ' </span><span class="example"> ' . date_i18n( get_option('date_format') ) . "</span> <span class='spinner'></span>\n"; 251 echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom date format in the following field' ) . '</span></label>' . 252 '<label for="date_format_custom" class="screen-reader-text">' . __( 'Custom date format:' ) . '</label>' . 253 '<input type="text" name="date_format_custom" id="date_format_custom" value="' . esc_attr( get_option( 'date_format' ) ) . '" class="small-text" /></span>' . 254 '<span class="screen-reader-text">' . __( 'example:' ) . ' </span> <span class="example">' . date_i18n( get_option( 'date_format' ) ) . '</span>' . 255 "<span class='spinner'></span>\n"; 247 256 ?> 248 257 </fieldset> 249 258 </td> … … 265 274 $custom = true; 266 275 267 276 foreach ( $time_formats as $format ) { 268 echo "\t<label title='" . esc_attr($format) . "'><input type='radio' name='time_format' value='" . esc_attr($format) . "'";277 echo "\t<label><input type='radio' name='time_format' value='" . esc_attr( $format ) . "'"; 269 278 if ( get_option('time_format') === $format ) { // checked() uses "==" rather than "===" 270 279 echo " checked='checked'"; 271 280 $custom = false; 272 281 } 273 echo ' /> ' . date_i18n( $format ) . "</label><br />\n";282 echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . $format . "</code></label><br />\n"; 274 283 } 275 284 276 echo ' 285 echo '<label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"'; 277 286 checked( $custom ); 278 echo '/> ' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom time format in the following field' ) . "</span></label>\n"; 279 echo '<label for="time_format_custom" class="screen-reader-text">' . __( 'Custom time format:' ) . '</label><input type="text" name="time_format_custom" id="time_format_custom" value="' . esc_attr( get_option('time_format') ) . '" class="small-text" /> <span class="screen-reader-text">' . __( 'example:' ) . ' </span><span class="example"> ' . date_i18n( get_option('time_format') ) . "</span> <span class='spinner'></span>\n"; 287 echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom time format in the following field' ) . '</span></label>' . 288 '<label for="time_format_custom" class="screen-reader-text">' . __( 'Custom time format:' ) . '</label>' . 289 '<input type="text" name="time_format_custom" id="time_format_custom" value="' . esc_attr( get_option( 'time_format' ) ) . '" class="small-text" /></span>' . 290 '<span class="screen-reader-text">' . __( 'example:' ) . ' </span> <span class="example">' . date_i18n( get_option( 'time_format' ) ) . '</span>' . 291 "<span class='spinner'></span>\n"; 280 292 281 echo "\t<p >" . __('<a href="https://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.') . "</p>\n";293 echo "\t<p class='date-time-doc'>" . __('<a href="https://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.') . "</p>\n"; 282 294 ?> 283 295 </fieldset> 284 296 </td>