Ticket #33778: 33778.5.patch
File 33778.5.patch, 3.2 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
430 430 </th> 431 431 <td> 432 432 <input class="hidden" value=" " /><!-- #24364 workaround --> 433 <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button>433 <button type="button" id="wp-generate-pw" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button> 434 434 <div class="wp-pwd hide-if-js"> 435 435 <?php $initial_password = wp_generate_password( 24 ); ?> 436 436 <span class="password-input-wrapper"> -
user-edit.php
466 466 <th><label for="pass1"><?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" />