diff --git a/wp-admin/js/about.js b/wp-admin/js/about.js index 5785e6c5c4..844b732d4f 100644 --- a/wp-admin/js/about.js +++ b/wp-admin/js/about.js @@ -22,6 +22,11 @@ $('#pass-strength-result').addClass('short').html( pwsL10n['short'] ); } } + function resetMeter(){ + $input.val(''); + $('#pass-strength-result').text(indicatorString); + $('#pass-strength-result').removeClass('short bad good strong'); + } function animate(){ if (shouldAnimate === false) @@ -30,8 +35,7 @@ $input.val( password.substr(0, $input.val().length + 1) ); updateResult(); } else { - $input.val(''); - $('#pass-strength-result').removeClass('short bad good strong'); + resetMeter(); } // Look like real typing by changing the speed new letters are added each time setTimeout(animate, 220 + Math.floor(Math.random() * ( 800 - 220)) ); @@ -48,9 +52,7 @@ // Turn off the animation on focus $input.on('focus', function(){ shouldAnimate = false; - $('#pass-strength-result').removeClass('short bad good strong'); - $('#pass-strength-result').text(indicatorString); - $input.val('') + resetMeter(); }); // Act like a normal password strength meter @@ -61,4 +63,4 @@ // Start the animation begin(); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/wp-admin/js/about.min.js b/wp-admin/js/about.min.js index 3564092492..f7a895af7e 100644 --- a/wp-admin/js/about.min.js +++ b/wp-admin/js/about.min.js @@ -1 +1 @@ -!function(a){function b(){var b=wp.passwordStrength.meter(f.val(),[],f.val());switch(a("#pass-strength-result").removeClass("short bad good strong"),b){case 2:a("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:a("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:a("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;default:a("#pass-strength-result").addClass("short").html(pwsL10n["short"])}}function c(){g!==!1&&(f.val().length