Ticket #32886: 32886.diff
File 32886.diff, 4.9 KB (added by , 10 years ago) |
---|
-
wp-admin/css/install.css
278 278 direction: ltr; 279 279 } 280 280 281 #pass1-text, 282 .show-password #pass1 { 283 display: none; 284 } 281 285 286 .show-password #pass1-text 287 { 288 display: inline-block; 289 } 290 291 .form-table span.description.important { 292 font-size: 12px; 293 } 294 295 282 296 /* localization */ 283 297 body.rtl, 284 298 .rtl textarea, -
wp-admin/install.php
137 137 </label> 138 138 </th> 139 139 <td> 140 <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button> 141 <div class="wp-pwd hide-if-js"> 140 <div class=""> 142 141 <?php $initial_password = wp_generate_password( 24 ); ?> 143 <input type="password" name="admin_password" id="pass1" class="regular-text" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>"/>142 <input type="password" name="admin_password" id="pass1" class="regular-text" data-showpassword='1' autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" /> 144 143 <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0"> 145 144 <span class="dashicons dashicons-visibility"></span> 146 145 <span class="text"><?php _e( 'Hide' ); ?></span> … … 147 146 </button> 148 147 <div id="pass-strength-result"></div> 149 148 </div> 150 <p><span class="description hide-if-no-js"><?php _e( 'A password reset link will be sent to you via email.' ); ?></span></p> 149 <p><span class="description important hide-if-no-js"> 150 <strong><?php _e( 'Important:' )?></strong> <?php _e( 'You will need this password to log in, please store it in a secure location.' ); ?></span></p> 151 151 </td> 152 152 </tr> 153 153 <tr class="form-field form-required user-pass2-wrap hide-if-js"> -
wp-admin/js/user-profile.js
1 /* global ajaxurl, pwsL10n , userProfileL10n*/1 /* global ajaxurl, pwsL10n */ 2 2 (function($){ 3 3 $(function(){ 4 4 var pw_new = $('.user-pass1-wrap'), … … 13 13 pw_submitbtn_edit = $('#submit'), 14 14 pw_submitbtn_new = $( '#createusersub' ), 15 15 pw_checkbox = $('.pw-checkbox'), 16 pw_weak = $('.pw-weak') 17 ; 16 pw_weak = $('.pw-weak'), 17 // Set up a text version of the password input 18 newField = document.createElement( 'input'); 19 newField.type = 'text'; 18 20 21 var pwFieldText = $( newField ); 22 23 if ( pw_field.length > 0 ) { 24 pwFieldText 25 .attr( { 26 'id': 'pass1-text', 27 'name': 'pass1-text', 28 'autocomplete': 'off' 29 } ) 30 .addClass( pw_field[0].className ) 31 .data( 'pw', pw_field.data( 'pw' ) ) 32 .val( pw_field.val() ); 33 34 pw_field 35 .wrap( '<span class="password-input-wrapper"></span>' ) 36 .after( pwFieldText ); 37 } 38 39 var pwWrapper = pw_field.parent(); 19 40 var generatePassword = window.generatePassword = function() { 20 41 if ( typeof zxcvbn !== 'function' ) { 21 42 setTimeout( generatePassword, 50 ); … … 22 43 } else { 23 44 pw_field.val( pw_field.data( 'pw' ) ); 24 45 pw_field.trigger( 'propertychange' ); 25 pw_field.attr( 'type', 'text' ).focus(); 26 pw_field[0].setSelectionRange(100, 100); 46 pwWrapper.addClass( 'show-password' ); 47 pwFieldText.focus(); 48 pwFieldText[0].setSelectionRange(100, 100); 27 49 } 28 50 }; 29 51 … … 38 60 39 61 parentform.on('submit', function(){ 40 62 pw_field2.val( pw_field.val() ); 41 pw _field.attr('type', 'password');63 pwWrapper.removeClass( 'show-password' ); 42 64 }); 43 65 66 pwFieldText.on( 'input', function(){ 67 pw_field.val( pwFieldText.val() ); 68 pw_field.trigger( 'propertychange' ); 69 } ); 44 70 71 45 72 pw_field.on('input propertychange', function(){ 46 73 setTimeout( function(){ 47 74 var cssClass = pw_strength.attr('class'); 75 pwFieldText.val( pw_field.val() ); 48 76 pw_field.removeClass( 'short bad good strong' ); 49 77 if ( 'undefined' !== typeof cssClass ) { 50 78 pw_field.addClass( cssClass ); … … 93 121 pw_togglebtn.on( 'click', function() { 94 122 var show = pw_togglebtn.attr( 'data-toggle' ); 95 123 if ( show == 1 ) { 96 pw _field.attr( 'type', 'text' );124 pwWrapper.addClass( 'show-password' ); 97 125 pw_togglebtn.attr( 'data-toggle', 0 ) 98 126 .find( '.text' ) 99 .text( userProfileL10n.hide)127 .text( 'hide' ) 100 128 ; 101 129 } else { 102 pw _field.attr( 'type', 'password' );130 pwWrapper.removeClass( 'show-password' ); 103 131 pw_togglebtn.attr( 'data-toggle', 1 ) 104 132 .find( '.text' ) 105 .text( userProfileL10n.show)133 .text( 'show' ) 106 134 ; 107 135 } 108 136 pw_field.focus();