Changeset 55974
- Timestamp:
- 06/22/2023 12:30:41 AM (18 months ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/user-profile.js
r53122 r55974 53 53 54 54 // Focus the password field. 55 $( $pass1 ).trigger( 'focus' ); 55 if ( 'mailserver_pass' !== $pass1.prop('id' ) ) { 56 $( $pass1 ).trigger( 'focus' ); 57 } 56 58 } 57 59 … … 172 174 $cancelButton; 173 175 174 $pass1Row = $( '.user-pass1-wrap, .user-pass-wrap, . reset-pass-submit' );176 $pass1Row = $( '.user-pass1-wrap, .user-pass-wrap, .mailserver-pass-wrap, .reset-pass-submit' ); 175 177 176 178 // Hide the confirm password field when JavaScript support is enabled. … … 189 191 } ); 190 192 191 $pass1 = $('#pass1 ');193 $pass1 = $('#pass1, #mailserver_pass'); 192 194 if ( $pass1.length ) { 193 195 bindPass1(); … … 315 317 316 318 function showOrHideWeakPasswordCheckbox() { 317 var passStrength = $('#pass-strength-result')[0]; 318 319 if ( passStrength.className ) { 320 $pass1.addClass( passStrength.className ); 321 if ( $( passStrength ).is( '.short, .bad' ) ) { 322 if ( ! $weakCheckbox.prop( 'checked' ) ) { 323 $submitButtons.prop( 'disabled', true ); 319 var passStrengthResult = $('#pass-strength-result'); 320 321 if ( passStrengthResult.length ) { 322 var passStrength = passStrengthResult[0]; 323 324 if ( passStrength.className ) { 325 $pass1.addClass( passStrength.className ); 326 if ( $( passStrength ).is( '.short, .bad' ) ) { 327 if ( ! $weakCheckbox.prop( 'checked' ) ) { 328 $submitButtons.prop( 'disabled', true ); 329 } 330 $weakRow.show(); 331 } else { 332 if ( $( passStrength ).is( '.empty' ) ) { 333 $submitButtons.prop( 'disabled', true ); 334 $weakCheckbox.prop( 'checked', false ); 335 } else { 336 $submitButtons.prop( 'disabled', false ); 337 } 338 $weakRow.hide(); 324 339 } 325 $weakRow.show();326 } else {327 if ( $( passStrength ).is( '.empty' ) ) {328 $submitButtons.prop( 'disabled', true );329 $weakCheckbox.prop( 'checked', false );330 } else {331 $submitButtons.prop( 'disabled', false );332 }333 $weakRow.hide();334 340 } 335 341 } -
trunk/src/wp-admin/css/forms.css
r55689 r55974 552 552 .wp-pwd { 553 553 margin-top: 1em; 554 position: relative; 555 } 556 557 .mailserver-pass-wrap .wp-pwd { 558 display: inline-block; 559 margin-top: 0; 560 } 561 562 /* rtl:ignore */ 563 #mailserver_pass { 564 direction: ltr; 565 padding-right: 2.5rem; 566 } 567 568 /* rtl:ignore */ 569 .mailserver-pass-wrap .button.wp-hide-pw { 570 background: transparent; 571 border: 1px solid transparent; 572 box-shadow: none; 573 font-size: 14px; 574 line-height: 2; 575 width: 2.5rem; 576 min-width: 40px; 577 margin: 0; 578 padding: 0 9px; 579 position: absolute; 580 right: 0; 581 top: 0; 582 } 583 584 .mailserver-pass-wrap .button.wp-hide-pw:hover { 585 background: transparent; 586 border-color: transparent; 587 } 588 589 .mailserver-pass-wrap .button.wp-hide-pw:focus { 590 background: transparent; 591 border-color: #3582c4; 592 border-radius: 4px; 593 box-shadow: 0 0 0 1px #3582c4; 594 /* Only visible in Windows High Contrast mode */ 595 outline: 2px solid transparent; 596 } 597 598 .mailserver-pass-wrap .button.wp-hide-pw:active { 599 background: transparent; 600 box-shadow: none; 601 transform: none; 554 602 } 555 603 -
trunk/src/wp-admin/options-writing.php
r55904 r55974 54 54 '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' 55 55 ); 56 57 wp_enqueue_script( 'user-profile' ); 56 58 57 59 require_once ABSPATH . 'wp-admin/admin-header.php'; … … 169 171 <td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option( 'mailserver_login' ); ?>" class="regular-text ltr" /></td> 170 172 </tr> 171 <tr> 172 <th scope="row"><label for="mailserver_pass"><?php _e( 'Password' ); ?></label></th> 173 <td> 174 <input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option( 'mailserver_pass' ); ?>" class="regular-text ltr" /> 175 </td> 173 <tr class="mailserver-pass-wrap"> 174 <th scope="row"> 175 <label for="mailserver_pass"> 176 <?php _e( 'Password' ); ?> 177 </label> 178 </th> 179 <td> 180 <input type="hidden" value=" " /><!-- #24364 workaround --> 181 <span class="wp-pwd"> 182 <input type="text" name="mailserver_pass" id="mailserver_pass" class="regular-text ltr" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( get_option( 'mailserver_pass' ) ); ?>" /> 183 <button type="button" class="button wp-hide-pw hide-if-no-js" data-toggle="0" data-start-masked="1" aria-label="<?php esc_attr_e( 'Hide password' ); ?>"> 184 <span class="dashicons dashicons-visibility" aria-hidden="true"></span> 185 </button> 186 </span> 187 </td> 176 188 </tr> 177 189 <tr>
Note: See TracChangeset
for help on using the changeset viewer.