Ticket #33778: 33778.6.patch
File 33778.6.patch, 3.1 KB (added by , 9 years ago) |
---|
-
src/wp-admin/js/user-profile.js
6 6 $pass1Wrap, 7 7 $pass1, 8 8 $pass1Text, 9 $pass1Label, 9 10 10 11 $pass2, 11 12 … … 107 108 108 109 $pass1Text.focus(); 109 110 111 $pass1Label.attr( 'for', 'pass1-text' ); 112 110 113 if ( ! _.isUndefined( $pass1Text[0].setSelectionRange ) ) { 111 114 $pass1Text[0].setSelectionRange( 0, 100 ); 112 115 } … … 126 129 127 130 $pass1.focus(); 128 131 132 $pass1Label.attr( 'for', 'pass1' ); 133 129 134 if ( ! _.isUndefined( $pass1[0].setSelectionRange ) ) { 130 135 $pass1[0].setSelectionRange( 0, 100 ); 131 136 } … … 139 144 $cancelButton; 140 145 141 146 $pass1Row = $('.user-pass1-wrap'); 147 $pass1Label = $pass1Row.find('th label'); 148 142 149 // hide this 143 150 $('.user-pass2-wrap').hide(); 144 151 … … 197 204 }, 0 ); 198 205 } ); 199 206 207 if( $generateButton.length ) { 208 $pass1Label.attr( 'for', 'wp-generate-pw' ); 209 } else { 210 $pass1Label.attr( 'for', 'pass1-text' ); 211 } 212 200 213 $cancelButton = $pass1Row.find( 'button.wp-cancel-pw' ); 201 214 $cancelButton.on( 'click', function () { 202 215 updateLock = false; … … 207 220 // Clear password field to prevent update 208 221 $pass1.val( '' ).trigger( 'pwupdate' ); 209 222 $submitButtons.prop( 'disabled', false ); 223 $pass1Label.attr( 'for', 'wp-generate-pw' ); 210 224 } ); 211 225 212 226 $pass1Row.closest('form').on( 'submit', function () { -
src/wp-admin/user-edit.php
450 450 <th><label for="pass1"><?php _e( 'New Password' ); ?></label></th> 451 451 <td> 452 452 <input class="hidden" value=" " /><!-- #24364 workaround --> 453 <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Generate Password' ); ?></button>453 <button type="button" id="wp-generate-pw" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Generate Password' ); ?></button> 454 454 <div class="wp-pwd hide-if-js"> 455 455 <span class="password-input-wrapper"> 456 456 <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" /> -
src/wp-admin/user-new.php
412 412 </th> 413 413 <td> 414 414 <input class="hidden" value=" " /><!-- #24364 workaround --> 415 <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button>415 <button type="button" id="wp-generate-pw" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button> 416 416 <div class="wp-pwd hide-if-js"> 417 417 <?php $initial_password = wp_generate_password( 24 ); ?> 418 418 <span class="password-input-wrapper">