Changeset 36263
- Timestamp:
- 01/11/2016 10:53:10 PM (9 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/forms.css
r35831 r36263 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; … … 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 … … 902 909 margin: 2px 0; 903 910 vertical-align: middle; 911 } 912 913 .options-general-php .date-time-text { 914 display: inline-block; 915 min-width: 10em; 904 916 } 905 917 … … 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 … … 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 … … 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 } -
trunk/src/wp-admin/includes/options.php
r35685 r36263 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(){ … … 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(){ -
trunk/src/wp-admin/options-general.php
r35811 r36263 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 … … 212 217 </span> 213 218 <?php endif; ?> 219 </p> 214 220 </td> 215 221 … … 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> … … 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"; 280 281 echo "\t<p>" . __('<a href="https://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.') . "</p>\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"; 292 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>
Note: See TracChangeset
for help on using the changeset viewer.