Ticket #33778: 33778.4.patch
File 33778.4.patch, 3.7 KB (added by , 9 years ago) |
---|
-
js/user-profile.js
57 57 } ); 58 58 59 59 $pass1.after( $pass1Text ); 60 60 61 61 if ( 1 === parseInt( $pass1.data( 'reveal' ), 10 ) ) { 62 62 generatePassword(); 63 63 } … … 104 104 .find( '.dashicons' ) 105 105 .removeClass('dashicons-visibility') 106 106 .addClass('dashicons-hidden'); 107 107 108 108 $pass1Text.focus(); 109 110 $pass1Row.find('th').children('label').attr({'for':'pass1-text'}); 109 111 110 112 if ( ! _.isUndefined( $pass1Text[0].setSelectionRange ) ) { 111 113 $pass1Text[0].setSelectionRange( 0, 100 ); … … 125 127 .addClass('dashicons-visibility'); 126 128 127 129 $pass1.focus(); 130 131 $pass1Row.find('th').children('label').attr({'for':'pass1'}); 128 132 129 133 if ( ! _.isUndefined( $pass1[0].setSelectionRange ) ) { 130 134 $pass1[0].setSelectionRange( 0, 100 ); … … 177 181 $passwordWrapper = $pass1Row.find('.wp-pwd').hide(); 178 182 179 183 bindToggleButton(); 184 185 if( $pass1Row.find( 'button.wp-generate-pw' ).length ) 186 $pass1Row.find('th').children('label').attr({'for':'wp-generate-pw'}); 187 else 188 $pass1Row.find('th').children('label').attr({'for':'pass1-text'}); 180 189 181 190 $generateButton = $pass1Row.find( 'button.wp-generate-pw' ).show(); 182 191 $generateButton.on( 'click', function () { … … 207 216 // Clear password field to prevent update 208 217 $pass1.val( '' ).trigger( 'pwupdate' ); 209 218 $submitButtons.prop( 'disabled', false ); 219 $pass1Row.find('th').children('label').attr({'for':'wp-generate-pw'}); 210 220 } ); 211 221 212 222 $pass1Row.closest('form').on( 'submit', function () { -
user-new.php
404 404 if ( apply_filters( 'show_password_fields', true ) ) : ?> 405 405 <tr class="form-field form-required user-pass1-wrap"> 406 406 <th scope="row"> 407 <label for=" pass1">407 <label for="wp-generate-pw"> 408 408 <?php _e( 'Password' ); ?> 409 409 <span class="description hide-if-js"><?php _e( '(required)' ); ?></span> 410 410 </label> … … 411 411 </th> 412 412 <td> 413 413 <input class="hidden" value=" " /><!-- #24364 workaround --> 414 <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button>414 <button type="button" id="wp-generate-pw" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button> 415 415 <div class="wp-pwd hide-if-js"> 416 416 <?php $initial_password = wp_generate_password( 24 ); ?> 417 417 <span class="password-input-wrapper"> -
user-edit.php
463 463 <h3><?php _e('Account Management'); ?></h3> 464 464 <table class="form-table"> 465 465 <tr id="password" class="user-pass1-wrap"> 466 <th><label for=" pass1"><?php _e( 'New Password' ); ?></label></th>466 <th><label for="wp-generate-pw"><?php _e( 'New Password' ); ?></label></th> 467 467 <td> 468 468 <input class="hidden" value=" " /><!-- #24364 workaround --> 469 <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Generate Password' ); ?></button>469 <button type="button" id="wp-generate-pw" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Generate Password' ); ?></button> 470 470 <div class="wp-pwd hide-if-js"> 471 471 <span class="password-input-wrapper"> 472 472 <input type="password" name="pass1" id="pass1" class="regular-text" value="" autocomplete="off" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" aria-describedby="pass-strength-result" />