diff --git src/wp-admin/css/customize-controls.css src/wp-admin/css/customize-controls.css
index 45c49b5fa5..0d68979ba5 100644
|
|
body.outer-section-open .wp-full-overlay.expanded .wp-full-overlay-main { |
148 | 148 | } |
149 | 149 | |
150 | 150 | #customize-controls .date-input:invalid { |
151 | | border-color: red; |
152 | | } |
153 | | |
154 | | .date-time-fields .month-field { |
155 | | width: 79px; |
156 | | } |
157 | | |
158 | | .date-time-fields .day-field, |
159 | | .date-time-fields .hour-field, |
160 | | .date-time-fields .minute-field { |
161 | | width: 46px; |
162 | | } |
163 | | |
164 | | .date-time-fields .year-field { |
165 | | width: 60px; |
166 | | } |
167 | | |
168 | | .date-time-fields .am-pm-field { |
169 | | width: 53px; |
| 151 | border-color: #dc3232; |
170 | 152 | } |
171 | 153 | |
172 | 154 | #customize-control-changeset_status label { |
… |
… |
body.outer-section-open .wp-full-overlay.expanded .wp-full-overlay-main { |
200 | 182 | |
201 | 183 | .customize-copy-preview-link:before, |
202 | 184 | .customize-copy-preview-link:after { |
203 | | content: ''; |
| 185 | content: ""; |
204 | 186 | height: 28px; |
205 | 187 | position: absolute; |
206 | 188 | background: #ffffff; |
… |
… |
body.outer-section-open .wp-full-overlay.expanded .wp-full-overlay-main { |
225 | 207 | border-left: none; |
226 | 208 | border-right: none; |
227 | 209 | text-indent: -999px; |
228 | | color: white; |
| 210 | color: #fff; |
229 | 211 | } |
230 | 212 | |
231 | 213 | #customize-control-changeset_preview_link label { |
… |
… |
body.outer-section-open .wp-full-overlay.expanded .wp-full-overlay-main { |
268 | 250 | padding-bottom:10px; |
269 | 251 | } |
270 | 252 | |
271 | | .date-time-fields label, |
| 253 | .date-time-fields .date-input, |
272 | 254 | .date-time-fields .date-time-separator { |
273 | 255 | float: left; |
274 | | margin-right:5px; |
| 256 | margin-right: 5px !important; |
| 257 | } |
| 258 | |
| 259 | .date-time-fields .date-input.month { |
| 260 | width: 79px; |
| 261 | margin: 0; |
| 262 | } |
| 263 | |
| 264 | .date-time-fields .date-input.day, |
| 265 | .date-time-fields .date-input.hour, |
| 266 | .date-time-fields .date-input.minute { |
| 267 | width: 46px; |
| 268 | } |
| 269 | |
| 270 | .date-time-fields .date-input.year { |
| 271 | width: 60px; |
| 272 | } |
| 273 | |
| 274 | .date-time-fields .date-input.meridian { |
| 275 | width: 53px; |
| 276 | margin: 0; |
275 | 277 | } |
276 | 278 | |
277 | 279 | .date-time-fields .date-time-separator { |
… |
… |
body.outer-section-open .wp-full-overlay.expanded .wp-full-overlay-main { |
279 | 281 | } |
280 | 282 | |
281 | 283 | .date-time-fields .time-row { |
282 | | padding-top: 12px; |
| 284 | margin-top: 12px; |
283 | 285 | } |
284 | 286 | |
285 | 287 | .date-time-fields .date-timezone { |
… |
… |
p.customize-section-description { |
1022 | 1024 | } |
1023 | 1025 | |
1024 | 1026 | .customize-control-dropdown-pages .new-content-item .create-item-input.invalid { |
1025 | | border: 1px solid #f00; |
| 1027 | border: 1px solid #dc3232; |
1026 | 1028 | } |
1027 | 1029 | |
1028 | 1030 | .customize-control-dropdown-pages .add-new-toggle { |
… |
… |
p.customize-section-description { |
1148 | 1150 | margin-bottom: 0; |
1149 | 1151 | } |
1150 | 1152 | #customize-control-show_on_front.has-error .customize-control-notifications-container { |
1151 | | margin-top:12px; |
| 1153 | margin-top: 12px; |
1152 | 1154 | } |
1153 | 1155 | |
1154 | 1156 | /** |
… |
… |
p.customize-section-description { |
1333 | 1335 | content: ''; |
1334 | 1336 | position: absolute; |
1335 | 1337 | height: auto; |
1336 | | top: 0; left: 0; bottom: 0; right: 0; |
| 1338 | top: 0; |
| 1339 | left: 0; |
| 1340 | bottom: 0; |
| 1341 | right: 0; |
1337 | 1342 | border: 4px solid #00a0d2; |
1338 | 1343 | border-radius: 2px; |
1339 | 1344 | } |
… |
… |
body.adding-widget .add-new-widget:before, |
2164 | 2169 | height: 39px; |
2165 | 2170 | } |
2166 | 2171 | |
2167 | | .date-time-fields .month-field { |
| 2172 | .date-time-fields .date-input.month { |
2168 | 2173 | width: 79px; |
2169 | 2174 | } |
2170 | 2175 | |
2171 | | .date-time-fields .day-field, |
2172 | | .date-time-fields .hour-field, |
2173 | | .date-time-fields .minute-field { |
| 2176 | .date-time-fields .date-input.day, |
| 2177 | .date-time-fields .date-input.hour, |
| 2178 | .date-time-fields .date-input.minute { |
2174 | 2179 | width: 55px; |
2175 | 2180 | } |
2176 | 2181 | |
2177 | | .date-time-fields .year-field { |
| 2182 | .date-time-fields .date-input.year { |
2178 | 2183 | width: 80px; |
2179 | 2184 | } |
2180 | 2185 | |
| 2186 | .date-time-fields .date-time-separator, |
2181 | 2187 | .date-time-fields .date-timezone { |
2182 | 2188 | line-height: 3.2; |
2183 | 2189 | } |
| 2190 | |
2184 | 2191 | .wp-core-ui.wp-customizer .button { |
2185 | 2192 | margin-top: 12px; |
2186 | 2193 | } |
diff --git src/wp-admin/css/customize-nav-menus.css src/wp-admin/css/customize-nav-menus.css
index f9d8f81703..36138ca2a3 100644
|
|
|
132 | 132 | |
133 | 133 | .customize-control input.menu-name-field { |
134 | 134 | width: 100%; /* Override the 98% default for customizer inputs, to align with the size of menu items. */ |
135 | | margin: 12px 0; |
136 | 135 | } |
137 | 136 | |
138 | 137 | .wp-customizer .menu-item .item-edit { |
diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index 9a22f1f150..5e9362e29f 100644
|
|
|
4143 | 4143 | */ |
4144 | 4144 | api.DateTimeControl = api.Control.extend({ |
4145 | 4145 | |
4146 | | dateInputs: {}, |
4147 | | inputElements: {}, |
4148 | | invalidDate: false, |
4149 | | |
4150 | 4146 | /** |
4151 | 4147 | * Initialize behaviors. |
4152 | 4148 | * |
… |
… |
|
4156 | 4152 | ready: function ready() { |
4157 | 4153 | var control = this; |
4158 | 4154 | |
4159 | | _.bindAll( control, 'populateSetting', 'updateDaysForMonth', 'updateMinutesForHour' ); |
| 4155 | control.inputElements = {}; |
| 4156 | control.invalidDate = false; |
4160 | 4157 | |
4161 | | control.dateInputs = control.container.find( '.date-input' ); |
| 4158 | _.bindAll( control, 'populateSetting', 'updateDaysForMonth', 'updateMinutesForHour', 'populateDateInputs' ); |
4162 | 4159 | |
4163 | 4160 | // @todo This needs https://core.trac.wordpress.org/ticket/37964 |
4164 | 4161 | if ( ! control.setting ) { |
4165 | 4162 | control.setting = new api.Value(); |
4166 | 4163 | } |
4167 | 4164 | |
| 4165 | // @todo Should this be? Default should be on client. The default value should be in the setting itself. |
4168 | 4166 | if ( ! control.setting.get() && control.params.defaultValue ) { |
4169 | 4167 | control.setting.set( control.params.defaultValue ); |
4170 | 4168 | } |
4171 | 4169 | |
4172 | | control.dateInputs.each( function() { |
| 4170 | control.container.find( '.date-input' ).each( function() { |
4173 | 4171 | var input = $( this ), component, element; |
4174 | 4172 | component = input.data( 'component' ); |
4175 | 4173 | element = new api.Element( input ); |
4176 | | element.validate = function( value ) { |
4177 | | return _.contains( [ 'am', 'pm' ], value ) ? value : parseInt( value, 10 ); |
4178 | | }; |
| 4174 | if ( 'meridian' === component ) { |
| 4175 | element.validate = function( value ) { |
| 4176 | if ( 'am' !== value && 'pm' !== value ) { |
| 4177 | return null; |
| 4178 | } |
| 4179 | return value; |
| 4180 | }; |
| 4181 | } else { |
| 4182 | element.validate = function( value ) { |
| 4183 | var val = parseInt( value, 10 ); |
| 4184 | if ( isNaN( val ) ) { |
| 4185 | return null; |
| 4186 | } |
| 4187 | return val; |
| 4188 | }; |
| 4189 | } |
| 4190 | element.bind( control.populateSetting ); |
4179 | 4191 | control.inputElements[ component ] = element; |
4180 | 4192 | control.elements.push( element ); |
4181 | 4193 | } ); |
4182 | 4194 | |
4183 | | control.dateInputs.on( 'input', control.populateSetting ); |
4184 | 4195 | control.inputElements.month.bind( control.updateDaysForMonth ); |
4185 | 4196 | control.inputElements.year.bind( control.updateDaysForMonth ); |
4186 | 4197 | control.inputElements.hour.bind( control.updateMinutesForHour ); |
4187 | 4198 | control.populateDateInputs(); |
| 4199 | control.setting.bind( control.populateDateInputs ); |
4188 | 4200 | }, |
4189 | 4201 | |
4190 | 4202 | /** |
… |
… |
|
4219 | 4231 | |
4220 | 4232 | if ( twelveHourFormat ) { |
4221 | 4233 | date.hour = parseInt( date.hour, 10 ); |
4222 | | date.ampm = date.hour >= midDayHour ? 'pm' : 'am'; |
| 4234 | date.meridian = date.hour >= midDayHour ? 'pm' : 'am'; |
4223 | 4235 | date.hour = date.hour % midDayHour ? String( date.hour % midDayHour ) : String( midDayHour ); |
4224 | 4236 | delete date.second; |
4225 | 4237 | } |
… |
… |
|
4239 | 4251 | control.invalidDate = false; |
4240 | 4252 | |
4241 | 4253 | _.each( [ 'day', 'hour', 'year', 'minute' ], function( component ) { |
4242 | | var element, el, max, min, maxLength, value; |
| 4254 | var element, el, max, min, value; |
4243 | 4255 | |
4244 | 4256 | if ( ! control.invalidDate ) { |
4245 | 4257 | element = control.inputElements[ component ]; |
4246 | 4258 | el = element.element.get( 0 ); |
4247 | 4259 | max = parseInt( element.element.attr( 'max' ), 10 ); |
4248 | 4260 | min = parseInt( element.element.attr( 'min' ), 10 ); |
4249 | | maxLength = parseInt( element.element.attr( 'maxlength' ), 10 ); |
4250 | 4261 | value = element(); |
4251 | | control.invalidDate = value > max || value < min || String( value ).length > maxLength; |
| 4262 | control.invalidDate = value > max || value < min; |
4252 | 4263 | errorMessage = control.invalidDate ? api.l10n.invalid + ' ' + component : ''; |
4253 | 4264 | |
4254 | 4265 | el.setCustomValidity( errorMessage ); |
4255 | | _.result( el, 'reportValidity' ); |
| 4266 | if ( ! control.section() || api.section.has( control.section() ) && api.section( control.section() ).expanded() ) { |
| 4267 | _.result( el, 'reportValidity' ); |
| 4268 | } |
4256 | 4269 | } |
4257 | 4270 | } ); |
4258 | 4271 | |
… |
… |
|
4291 | 4304 | updateMinutesForHour: function updateMinutesForHour() { |
4292 | 4305 | var control = this, maxHours = 24, minuteEl; |
4293 | 4306 | |
4294 | | if ( control.inputElements.ampm ) { |
| 4307 | if ( control.inputElements.meridian ) { |
4295 | 4308 | return; |
4296 | 4309 | } |
4297 | 4310 | |
… |
… |
|
4300 | 4313 | if ( maxHours === control.inputElements.hour() ) { |
4301 | 4314 | control.inputElements.minute( 0 ); |
4302 | 4315 | minuteEl.data( 'default-max', minuteEl.attr( 'max' ) ); |
4303 | | minuteEl.data( 'default-maxlength', minuteEl.attr( 'maxlength' ) ); |
4304 | 4316 | minuteEl.attr( 'max', '0' ); |
4305 | 4317 | } else if ( minuteEl.data( 'default-max' ) ) { |
4306 | 4318 | minuteEl.attr( 'max', minuteEl.data( 'default-max' ) ); |
4307 | | minuteEl.attr( 'maxlength', minuteEl.data( 'maxlength' ) ); |
4308 | 4319 | } |
4309 | 4320 | }, |
4310 | 4321 | |
… |
… |
|
4356 | 4367 | return value; |
4357 | 4368 | }; |
4358 | 4369 | |
4359 | | hourInTwentyFourHourFormat = control.inputElements.ampm ? control.convertHourToTwentyFourHourFormat( control.inputElements.hour(), control.inputElements.ampm() ) : control.inputElements.hour(); |
| 4370 | hourInTwentyFourHourFormat = control.inputElements.meridian ? control.convertHourToTwentyFourHourFormat( control.inputElements.hour(), control.inputElements.meridian() ) : control.inputElements.hour(); |
4360 | 4371 | dateFormat = [ 'year', '-', 'month', '-', 'day', ' ', pad( hourInTwentyFourHourFormat, 2 ), ':', 'minute', ':', '00' ]; |
4361 | 4372 | |
4362 | 4373 | _.each( dateFormat, function( component ) { |
… |
… |
|
4381 | 4392 | * Convert hour in twelve hour format to twenty four hour format. |
4382 | 4393 | * |
4383 | 4394 | * @since 4.9.0 |
4384 | | * @param {string} hourInTwelveHourFormat Hour in twelve hour format. |
4385 | | * @param {string} ampm am/pm |
4386 | | * @return {string} Hour in twenty four hour format. |
| 4395 | * @param {string} hourInTwelveHourFormat - Hour in twelve hour format. |
| 4396 | * @param {string} meridian - Either 'am' or 'pm'. |
| 4397 | * @returns {string} Hour in twenty four hour format. |
4387 | 4398 | */ |
4388 | | convertHourToTwentyFourHourFormat: function convertHour( hourInTwelveHourFormat, ampm ) { |
| 4399 | convertHourToTwentyFourHourFormat: function convertHour( hourInTwelveHourFormat, meridian ) { |
4389 | 4400 | var hourInTwentyFourHourFormat, hour, midDayHour = 12; |
4390 | 4401 | |
4391 | 4402 | hour = parseInt( hourInTwelveHourFormat, 10 ); |
| 4403 | if ( isNaN( hour ) ) { |
| 4404 | return ''; |
| 4405 | } |
4392 | 4406 | |
4393 | | if ( 'pm' === ampm && hour < midDayHour ) { |
| 4407 | if ( 'pm' === meridian && hour < midDayHour ) { |
4394 | 4408 | hourInTwentyFourHourFormat = hour + midDayHour; |
4395 | | } else if ( 'am' === ampm && midDayHour === hour ) { |
| 4409 | } else if ( 'am' === meridian && midDayHour === hour ) { |
4396 | 4410 | hourInTwentyFourHourFormat = hour - midDayHour; |
4397 | 4411 | } else { |
4398 | 4412 | hourInTwentyFourHourFormat = hour; |
… |
… |
|
5701 | 5715 | } ); |
5702 | 5716 | } ); |
5703 | 5717 | |
5704 | | /** |
5705 | | * Find all invalid setting less controls with notification type error. |
5706 | | */ |
| 5718 | // Find all invalid setting less controls with notification type error. |
5707 | 5719 | api.control.each( function( control ) { |
5708 | 5720 | if ( ! control.setting || ! control.setting.id && control.active.get() ) { |
5709 | 5721 | control.notifications.each( function( notification ) { |
… |
… |
|
6223 | 6235 | history.replaceState( {}, document.title, urlParser.href ); |
6224 | 6236 | }; |
6225 | 6237 | |
6226 | | /** |
6227 | | * Deactivate themes section if changeset status is not auto-draft |
6228 | | */ |
| 6238 | // Deactivate themes section if changeset status is not auto-draft. |
6229 | 6239 | api.section( 'themes', function( section ) { |
6230 | 6240 | var canActivate; |
6231 | 6241 | |
… |
… |
|
7036 | 7046 | }); |
7037 | 7047 | })(); |
7038 | 7048 | |
7039 | | /** |
7040 | | * Publish settings section and controls. |
7041 | | */ |
| 7049 | // Publish settings section and controls. |
7042 | 7050 | api.control( 'changeset_status', 'changeset_scheduled_date', function( statusControl, dateControl ) { |
7043 | 7051 | $.when( statusControl.deferred.embedded, dateControl.deferred.embedded ).done( function() { |
7044 | 7052 | var radioNodes, statusElement, toggleDateControl, publishWhenTime, pollInterval, updateTimeArrivedPoller, timeArrivedPollingInterval = 1000; |
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
index 85e225138e..94ae941a23 100644
|
|
final class WP_Customize_Manager { |
3554 | 3554 | </ul> |
3555 | 3555 | </script> |
3556 | 3556 | <script type="text/html" id="tmpl-customize-preview-link-control" > |
3557 | | <span class="customize-control-title"> |
3558 | | <label><?php esc_html_e( 'Share Preview Link' ); ?></label> |
3559 | | </span> |
3560 | | <span class="description customize-control-description"><?php esc_html_e( 'See how changes would look live on your website, and share the preview with people who can\'t access the Customizer.' ); ?></span> |
| 3557 | <p class="customize-control-title"> |
| 3558 | <?php esc_html_e( 'Share Preview Link' ); ?> |
| 3559 | </p> |
| 3560 | <p class="description customize-control-description"><?php esc_html_e( 'See how changes would look live on your website, and share the preview with people who can\'t access the Customizer.' ); ?></p> |
3561 | 3561 | <div class="customize-control-notifications-container"></div> |
3562 | 3562 | <div class="preview-link-wrapper"> |
3563 | | <label> |
3564 | | <span class="screen-reader-text"><?php esc_html_e( 'Preview Link' ); ?></span> |
3565 | | <a class="preview-control-element" data-component="link" href="" target=""></a> |
3566 | | <input readonly class="preview-control-element" data-component="input" value="test" > |
3567 | | <button class="customize-copy-preview-link preview-control-element button button-secondary" data-component="button" data-copy-text="<?php esc_attr_e( 'Copy' ); ?>" data-copied-text="<?php esc_attr_e( 'Copied' ); ?>" ><?php esc_html_e( 'Copy' ); ?></button> |
3568 | | </label> |
| 3563 | <label for="customize-preview-link-input" class="screen-reader-text"><?php esc_html_e( 'Preview Link' ); ?></label> |
| 3564 | <a class="preview-control-element" data-component="link" href="" target=""></a> |
| 3565 | <input id="customize-preview-link-input" readonly class="preview-control-element" data-component="input" value="test"> |
| 3566 | <button class="customize-copy-preview-link preview-control-element button button-secondary" data-component="button" data-copy-text="<?php esc_attr_e( 'Copy' ); ?>" data-copied-text="<?php esc_attr_e( 'Copied' ); ?>" ><?php esc_html_e( 'Copy' ); ?></button> |
3569 | 3567 | </div> |
3570 | 3568 | </script> |
3571 | 3569 | <?php |
… |
… |
final class WP_Customize_Manager { |
4147 | 4145 | } else { |
4148 | 4146 | $initial_date = current_time( 'mysql', false ); |
4149 | 4147 | } |
| 4148 | |
4150 | 4149 | $this->add_control( new WP_Customize_Date_Time_Control( $this, 'changeset_scheduled_date', array( |
4151 | 4150 | 'section' => 'publish_settings', |
4152 | 4151 | 'settings' => array(), |
diff --git src/wp-includes/class-wp-customize-nav-menus.php src/wp-includes/class-wp-customize-nav-menus.php
index b2f91ceb5c..06228b2b74 100644
|
|
final class WP_Customize_Nav_Menus { |
674 | 674 | ) ) ); |
675 | 675 | |
676 | 676 | $this->manager->add_control( 'new_menu_name', array( |
677 | | 'label' => '', |
| 677 | 'label' => __( 'New menu name' ), |
678 | 678 | 'section' => 'add_menu', |
679 | 679 | 'type' => 'text', |
680 | 680 | 'settings' => array(), |
681 | 681 | 'input_attrs' => array( |
682 | 682 | 'class' => 'menu-name-field', |
683 | | 'placeholder' => __( 'New menu name' ), |
684 | 683 | ), |
685 | 684 | ) ); |
686 | 685 | |
… |
… |
final class WP_Customize_Nav_Menus { |
1017 | 1016 | <?php $post_type_obj = get_post_type_object( $available_item_type['object'] ); ?> |
1018 | 1017 | <?php if ( current_user_can( $post_type_obj->cap->create_posts ) && current_user_can( $post_type_obj->cap->publish_posts ) ) : ?> |
1019 | 1018 | <div class="new-content-item"> |
1020 | | <input type="text" class="create-item-input" placeholder="<?php echo esc_attr( $post_type_obj->labels->add_new_item ); ?>"> |
| 1019 | <label for="<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>" class="screen-reader-text"><?php echo esc_html( $post_type_obj->labels->add_new_item ); ?></label> |
| 1020 | <input type="text" id="<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>" class="create-item-input" placeholder="<?php echo esc_attr( $post_type_obj->labels->add_new_item ); ?>"> |
1021 | 1021 | <button type="button" class="button add-content"><?php _e( 'Add' ); ?></button> |
1022 | 1022 | </div> |
1023 | 1023 | <?php endif; ?> |
diff --git src/wp-includes/customize/class-wp-customize-date-time-control.php src/wp-includes/customize/class-wp-customize-date-time-control.php
index abcdc58833..bfe0d4a4d1 100644
|
|
class WP_Customize_Date_Time_Control extends WP_Customize_Control { |
101 | 101 | ?> |
102 | 102 | |
103 | 103 | <# _.defaults( data, <?php echo wp_json_encode( $data ); ?> ); #> |
| 104 | <# var idPrefix = 'el' + String( Math.random() ); #> |
104 | 105 | |
105 | 106 | <span class="customize-control-title"> |
106 | | <label>{{ data.label }}</label> |
| 107 | {{ data.label }} |
107 | 108 | </span> |
108 | 109 | <div class="customize-control-notifications-container"></div> |
109 | 110 | <span class="description customize-control-description">{{ data.description }}</span> |
110 | 111 | <div class="date-time-fields"> |
111 | | <div class="day-row"> |
112 | | <span class="title-day"><?php esc_html_e( 'Day' ); ?></span> |
| 112 | <fieldset class="day-row"> |
| 113 | <legend class="title-day"><?php esc_html_e( 'Date' ); ?></legend> |
113 | 114 | <div class="day-fields clear"> |
114 | | <label class="month-field"> |
115 | | <span class="screen-reader-text"><?php esc_html_e( 'Month' ); ?></span> |
116 | | <select class="date-input month" data-component="month"> |
117 | | <# _.each( data.month_choices, function( choice ) { |
118 | | if ( _.isObject( choice ) && ! _.isUndefined( choice.text ) && ! _.isUndefined( choice.value ) ) { |
119 | | text = choice.text; |
120 | | value = choice.value; |
121 | | } |
122 | | #> |
123 | | <option value="{{ value }}" > |
124 | | {{ text }} |
125 | | </option> |
126 | | <# } ); #> |
127 | | </select> |
128 | | </label> |
129 | | <label class="day-field"> |
130 | | <span class="screen-reader-text"><?php esc_html_e( 'Day' ); ?></span> |
131 | | <input type="number" size="2" maxlength="2" autocomplete="off" class="date-input day" data-component="day" min="1" max="31"" /> |
132 | | </label> |
| 115 | <label for="{{ idPrefix }}date-time-month" class="screen-reader-text"><?php esc_html_e( 'Month' ); ?></label> |
| 116 | <select id="{{ idPrefix }}date-time-month" class="date-input month" data-component="month"> |
| 117 | <# _.each( data.month_choices, function( choice ) { |
| 118 | if ( _.isObject( choice ) && ! _.isUndefined( choice.text ) && ! _.isUndefined( choice.value ) ) { |
| 119 | text = choice.text; |
| 120 | value = choice.value; |
| 121 | } |
| 122 | #> |
| 123 | <option value="{{ value }}" > |
| 124 | {{ text }} |
| 125 | </option> |
| 126 | <# } ); #> |
| 127 | </select> |
| 128 | <label for="{{ idPrefix }}date-time-day" class="screen-reader-text"><?php esc_html_e( 'Day' ); ?></label> |
| 129 | <input id="{{ idPrefix }}date-time-day" type="number" size="2" autocomplete="off" class="date-input day" data-component="day" min="1" max="31" /> |
133 | 130 | <span class="time-special-char date-time-separator">,</span> |
134 | | <label class="year-field"> |
135 | | <span class="screen-reader-text"><?php esc_html_e( 'Year' ); ?></span> |
136 | | <# var maxYearLength = String( data.maxYear ).length; #> |
137 | | <input type="number" size="4" maxlength="{{ maxYearLength }}" autocomplete="off" class="date-input year" data-component="year" min="{{ data.minYear }}" max="{{ data.maxYear }}" /> |
138 | | </label> |
| 131 | <label for="{{ idPrefix }}date-time-year" class="screen-reader-text"><?php esc_html_e( 'Year' ); ?></label> |
| 132 | <input id="{{ idPrefix }}date-time-year" type="number" size="4" autocomplete="off" class="date-input year" data-component="year" min="{{ data.minYear }}" max="{{ data.maxYear }}"> |
139 | 133 | </div> |
140 | | </div> |
141 | | <div class="time-row clear"> |
142 | | <span class="title-time"><?php esc_html_e( 'Time' ); ?></span> |
| 134 | </fieldset> |
| 135 | <fieldset class="time-row clear"> |
| 136 | <legend class="title-time"><?php esc_html_e( 'Time' ); ?></legend> |
143 | 137 | <div class="time-fields clear"> |
144 | | <label class="hour-field"> |
145 | | <span class="screen-reader-text"><?php esc_html_e( 'Hour' ); ?></span> |
146 | | <# var maxHour = data.twelveHourFormat ? 12 : 24; #> |
147 | | <input type="number" size="2" maxlength="2" autocomplete="off" class="date-input hour" data-component="hour" min="1" max="{{ maxHour }}"" /> |
148 | | </label> |
| 138 | <label for="{{ idPrefix }}date-time-hour" class="screen-reader-text"><?php esc_html_e( 'Hour' ); ?></label> |
| 139 | <# var maxHour = data.twelveHourFormat ? 12 : 24; #> |
| 140 | <input id="{{ idPrefix }}date-time-hour" type="number" size="2" autocomplete="off" class="date-input hour" data-component="hour" min="1" max="{{ maxHour }}"> |
149 | 141 | <span class="time-special-char date-time-separator">:</span> |
150 | | <label class="minute-field"> |
151 | | <span class="screen-reader-text"><?php esc_html_e( 'Minute' ); ?></span> |
152 | | <input type="number" size="2" maxlength="2" autocomplete="off" class="date-input minute" data-component="minute" min="0" max="59" /> |
153 | | </label> |
| 142 | <label for="{{ idPrefix }}date-time-minute" class="screen-reader-text"><?php esc_html_e( 'Minute' ); ?></label> |
| 143 | <input id="{{ idPrefix }}date-time-minute" type="number" size="2" autocomplete="off" class="date-input minute" data-component="minute" min="0" max="59"> |
154 | 144 | <# if ( data.twelveHourFormat ) { #> |
155 | | <label class="am-pm-field"> |
156 | | <span class="screen-reader-text"><?php esc_html_e( 'AM / PM' ); ?></span> |
157 | | <select class="date-input" data-component="ampm"> |
| 145 | <label for="{{ idPrefix }}date-time-meridian" class="screen-reader-text"><?php esc_html_e( 'Meridian' ); ?></label> |
| 146 | <select id="{{ idPrefix }}date-time-meridian" class="date-input meridian" data-component="meridian"> |
158 | 147 | <option value="am"><?php esc_html_e( 'AM' ); ?></option> |
159 | 148 | <option value="pm"><?php esc_html_e( 'PM' ); ?></option> |
160 | 149 | </select> |
161 | | </label> |
162 | 150 | <# } #> |
163 | 151 | <abbr class="date-timezone" aria-label="<?php esc_attr_e( 'Timezone' ); ?>" title="<?php echo esc_attr( $timezone_info['description'] ); ?>"><?php echo esc_html( $timezone_info['abbr'] ); ?></abbr> |
164 | 152 | </div> |
165 | | </div> |
| 153 | </fieldset> |
166 | 154 | </div> |
167 | 155 | <?php |
168 | 156 | } |
diff --git tests/qunit/index.html tests/qunit/index.html
index 5ed4c7a02d..e395df20a7 100644
|
|
|
882 | 882 | <div class="customize-control-notifications-container"></div> |
883 | 883 | <span class="description customize-control-description">{{ data.description }}</span> |
884 | 884 | <div class="date-time-fields"> |
885 | | <div class="day-row"> |
886 | | <span class="title-day">Day</span> |
| 885 | <fieldset class="day-row"> |
| 886 | <legend class="title-day">Date</legend> |
887 | 887 | <div class="day-fields clear"> |
888 | | <label class="month-field"> |
889 | | <span class="screen-reader-text">Month</span> |
890 | | <select class="date-input month" data-component="month"> |
891 | | <# _.each( data.month_choices, function( choice ) { |
892 | | if ( _.isObject( choice ) && ! _.isUndefined( choice.text ) && ! _.isUndefined( choice.value ) ) { |
893 | | text = choice.text; |
894 | | value = choice.value; |
895 | | } |
896 | | #> |
897 | | <option value="{{ value }}" > |
898 | | {{ text }} |
899 | | </option> |
900 | | <# } ); #> |
901 | | </select> |
902 | | </label> |
903 | | <label class="day-field"> |
904 | | <span class="screen-reader-text">Day</span> |
905 | | <input type="number" size="2" maxlength="2" autocomplete="off" class="date-input day" data-component="day" min="1" max="31"" /> |
| 888 | <label for="date-time-month" class="screen-reader-text">Month</label> |
| 889 | <select id="date-time-month" class="date-input month" data-component="month"> |
| 890 | <# _.each( data.month_choices, function( choice ) { |
| 891 | if ( _.isObject( choice ) && ! _.isUndefined( choice.text ) && ! _.isUndefined( choice.value ) ) { |
| 892 | text = choice.text; |
| 893 | value = choice.value; |
| 894 | } |
| 895 | #> |
| 896 | <option value="{{ value }}" > |
| 897 | {{ text }} |
| 898 | </option> |
| 899 | <# } ); #> |
| 900 | </select> |
906 | 901 | </label> |
| 902 | <label for="date-time-day" class="screen-reader-text">Day</label> |
| 903 | <input id="date-time-day" type="number" size="2" maxlength="2" autocomplete="off" class="date-input day" data-component="day" min="1" max="31"> |
907 | 904 | <span class="time-special-char date-time-separator">,</span> |
908 | | <label class="year-field"> |
909 | | <span class="screen-reader-text">Year</span> |
910 | | <# var maxYearLength = String( data.maxYear ).length; #> |
911 | | <input type="number" size="4" maxlength="{{ maxYearLength }}" autocomplete="off" class="date-input year" data-component="year" min="{{ data.minYear }}" max="{{ data.maxYear }}" /> |
912 | | </label> |
| 905 | <label for="date-time-year" class="screen-reader-text">Year</label> |
| 906 | <# var maxYearLength = String( data.maxYear ).length; #> |
| 907 | <input type="number" size="4" maxlength="{{ maxYearLength }}" autocomplete="off" class="date-input year" data-component="year" min="{{ data.minYear }}" max="{{ data.maxYear }}" /> |
913 | 908 | </div> |
914 | | </div> |
915 | | <div class="time-row clear"> |
916 | | <span class="title-time">Time</span> |
| 909 | </fieldset> |
| 910 | <fieldset class="time-row clear"> |
| 911 | <legend class="title-time">Time</legend> |
917 | 912 | <div class="time-fields clear"> |
918 | | <label class="hour-field"> |
919 | | <span class="screen-reader-text">Hour</span> |
920 | | <# var maxHour = data.twelveHourFormat ? 12 : 24; #> |
921 | | <input type="number" size="2" maxlength="2" autocomplete="off" class="date-input hour" data-component="hour" min="1" max="{{ maxHour }}"" /> |
922 | | </label> |
| 913 | <label for="date-time-hour" class="screen-reader-text">Hour</label> |
| 914 | <# var maxHour = data.twelveHourFormat ? 12 : 24; #> |
| 915 | <input id="date-time-hour" type="number" size="2" maxlength="2" autocomplete="off" class="date-input hour" data-component="hour" min="1" max="12"> |
923 | 916 | <span class="time-special-char date-time-separator">:</span> |
924 | | <label class="minute-field"> |
925 | | <span class="screen-reader-text">Minute</span> |
926 | | <input type="number" size="2" maxlength="2" autocomplete="off" class="date-input minute" data-component="minute" min="0" max="59" /> |
927 | | </label> |
| 917 | <label for="date-time-minute" class="screen-reader-text">Minute</label> |
| 918 | <input id="date-time-minute" type="number" size="2" maxlength="2" autocomplete="off" class="date-input minute" data-component="minute" min="0" max="59"> |
928 | 919 | <# if ( data.twelveHourFormat ) { #> |
929 | | <label class="am-pm-field"> |
930 | | <span class="screen-reader-text">AM / PM</span> |
931 | | <select class="date-input" data-component="ampm"> |
932 | | <option value="am">AM</option> |
933 | | <option value="pm">PM</option> |
934 | | </select> |
935 | | </label> |
936 | | <# } #> |
| 920 | <label for="date-time-ampm" class="screen-reader-text">AM / PM</label> |
| 921 | <select id="date-time-ampm" class="date-input am-pm" data-component="ampm"> |
| 922 | <option value="am">AM</option> |
| 923 | <option value="pm">PM</option> |
| 924 | </select> |
| 925 | <# } #> |
937 | 926 | <abbr class="date-timezone" aria-label="Timezone" title="Timezone is Asia/Kolkata (IST), currently UTC+5:30.">IST</abbr> |
938 | 927 | </div> |
939 | 928 | </div> |