Changeset 33364
- Timestamp:
- 07/22/2015 06:35:51 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/user-profile.js
r33362 r33364 8 8 pw_togglebtn = pw_new.find('.wp-hide-pw'), 9 9 pw_generatebtn = pw_new.find('button.wp-generate-pw'), 10 pw_cancelbtn = pw_new.find('button.wp-cancel-pw'), 10 11 pw_2 = $('.user-pass2-wrap'), 11 12 parentform = pw_new.closest('form'), … … 15 16 pw_checkbox = $('.pw-checkbox'), 16 17 pw_weak = $('.pw-weak'), 18 pw_update_lock = false, 17 19 // Set up a text version of the password input 18 20 newField = document.createElement( 'input'); 21 19 22 newField.type = 'text'; 20 23 … … 57 60 58 61 parentform.on('submit', function(){ 62 pw_update_lock = false; 59 63 pw_field2.val( pw_field.val() ); 60 64 pwWrapper.removeClass( 'show-password' ); … … 111 115 112 116 pw_new.on( 'click', 'button.wp-generate-pw', function(){ 117 pw_update_lock = true; 113 118 pw_generatebtn.hide(); 114 119 pw_line.show(); … … 120 125 } 121 126 }, 0 ); 122 123 }); 124 127 }); 128 129 pw_submitbtn_edit.on( 'click', function() { 130 pw_update_lock = false; 131 }); 132 133 pw_cancelbtn.on( 'click', function() { 134 pw_update_lock = false; 135 pw_generatebtn.show(); 136 pw_line.hide(); 137 }); 125 138 126 139 pw_togglebtn.on( 'click', function() { … … 146 159 147 160 }); 161 162 /* Warn the user if password was generated but not saved */ 163 $( window ).on( 'beforeunload', function() { 164 if ( true === pw_update_lock ) { 165 return userProfileL10n.warn; 166 } 167 } ); 148 168 }); 149 169 -
trunk/src/wp-admin/user-edit.php
r33363 r33364 469 469 <span class="dashicons dashicons-visibility"></span> 470 470 <span class="text"><?php _e( 'Hide' ); ?></span> 471 </button> 472 <button type="button" class="button button-secondary wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>"> 473 <span class="text"><?php _e( 'Cancel' ); ?></span> 471 474 </button> 472 475 <div style="display:none" id="pass-strength-result" aria-live="polite"></div> -
trunk/src/wp-admin/user-new.php
r33363 r33364 408 408 <span class="text"><?php _e( 'Hide' ); ?></span> 409 409 </button> 410 <button type="button" class="button button-secondary wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>"> 411 <span class="text"><?php _e( 'Cancel' ); ?></span> 412 </button> 410 413 <div style="display:none" id="pass-strength-result" aria-live="polite"></div> 411 414 </div> -
trunk/src/wp-includes/script-loader.php
r33353 r33364 375 375 $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter', 'wp-util' ), false, 1 ); 376 376 did_action( 'init' ) && $scripts->localize( 'user-profile', 'userProfileL10n', array( 377 'show' => __( 'Show' ), 378 'hide' => __( 'Hide' ), 377 'warn' => __( 'Your new password has not been saved.' ), 378 'show' => __( 'Show' ), 379 'hide' => __( 'Hide' ), 380 'cancel' => __( 'Cancel' ), 379 381 'ariaShow' => esc_attr__( 'Show password' ), 380 382 'ariaHide' => esc_attr__( 'Hide password' ),
Note: See TracChangeset
for help on using the changeset viewer.