Ticket #25603: 25603.11.diff
File 25603.11.diff, 1.5 KB (added by , 12 years ago) |
---|
-
src/wp-admin/js/about.js
22 22 $('#pass-strength-result').addClass('short').html( pwsL10n['short'] ); 23 23 } 24 24 } 25 function resetMeter(){ 26 $input.val(''); 27 $('#pass-strength-result').text(indicatorString); 28 $('#pass-strength-result').removeClass('short bad good strong'); 29 } 25 30 26 31 function animate(){ 27 32 if (shouldAnimate === false) … … 30 35 $input.val( password.substr(0, $input.val().length + 1) ); 31 36 updateResult(); 32 37 } else { 33 $input.val(''); 34 $('#pass-strength-result').removeClass('short bad good strong'); 38 resetMeter(); 35 39 } 36 40 // Look like real typing by changing the speed new letters are added each time 37 41 setTimeout(animate, 220 + Math.floor(Math.random() * ( 800 - 220)) ); … … 48 52 // Turn off the animation on focus 49 53 $input.on('focus', function(){ 50 54 shouldAnimate = false; 51 $('#pass-strength-result').removeClass('short bad good strong'); 52 $('#pass-strength-result').text(indicatorString); 53 $input.val('') 55 resetMeter(); 54 56 }); 55 57 56 58 // Act like a normal password strength meter … … 61 63 // Start the animation 62 64 begin(); 63 65 64 })(jQuery); 65 No newline at end of file 66 })(jQuery);