Ticket #32886: no-timeout.6.diff
File no-timeout.6.diff, 2.2 KB (added by , 9 years ago) |
---|
-
src/wp-admin/js/user-profile.js
17 17 18 18 function generatePassword() { 19 19 if ( typeof zxcvbn !== 'function' ) { 20 20 setTimeout( generatePassword, 50 ); 21 21 } else { 22 23 $pass1.trigger( 'propertychange' );24 22 $pass1.val( $pass1.data( 'pw' ) ); 23 $pass1.trigger( 'pwupdate' ); 24 $pass1Wrap.addClass( 'show-password' ); 25 25 } 26 26 } 27 27 … … 40 40 .addClass( $pass1[0].className ) 41 41 .data( 'pw', $pass1.data( 'pw' ) ) 42 42 .val( $pass1.val() ) 43 .on( 'input', function () { 44 $pass1.val( $pass1Text.val() ).trigger( 'propertychange' ); 43 .on( 'input propertychange', function () { 44 if ( $pass1Text.val() === currentPass ) { 45 return; 46 } 47 48 $pass1.val( $pass1Text.val() ).trigger( 'pwupdate' ); 49 currentPass = $pass1Text.val(); 45 50 } ); 46 51 47 52 $pass1.after( $pass1Text ); … … 50 55 generatePassword(); 51 56 } 52 57 53 $pass1.on( 'input propertychange ', function () {58 $pass1.on( 'input propertychange pwupdate', function () { 54 59 if ( $pass1.val() === currentPass ) { 55 60 return; 56 61 } 57 58 62 currentPass = $pass1.val(); 59 63 $pass1Text.val( currentPass ); 60 64 $pass1.add( $pass1Text ).removeClass( 'short bad good strong' ); … … 154 158 $pass2 = $('#pass2').on( 'input propertychange', function () { 155 159 if ( $pass2.val().length > 0 ) { 156 160 $pass1.val( $pass2.val() ); 157 $pass1.trigger( 'p ropertychange' );161 $pass1.trigger( 'pwupdate' ); 158 162 } 159 163 } ); 160 164 … … 228 232 var $colorpicker, $stylesheet, user_id, current_user_id, 229 233 select = $( '#display_name' ); 230 234 231 $('#pass1').val('').on( 'input propertychange', check_pass_strength ); 232 $('#pass2').val('').on( 'input propertychange', check_pass_strength ); 235 $('#pass1').val('').on( 'input propertychange pwupdate', check_pass_strength ); 233 236 $('#pass-strength-result').show(); 234 237 $('.color-palette').click( function() { 235 238 $(this).siblings('input[name="admin_color"]').prop('checked', true);