mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-08 03:40:20 +01:00
c88a0bb423
props jorbin. see #25603. Built from https://develop.svn.wordpress.org/trunk@25848 git-svn-id: http://core.svn.wordpress.org/trunk@25848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
950 B
JavaScript
1 line
950 B
JavaScript
!function(a){function b(){var b=wp.passwordStrength.meter(g.val(),[],g.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.val(""),a("#pass-strength-result").text(i),a("#pass-strength-result").removeClass("short bad good strong")}function d(){h!==!1&&(g.val().length<f.length?(g.val(f.substr(0,g.val().length+1)),b()):c(),setTimeout(d,220+Math.floor(580*Math.random())))}function e(){"undefined"!=typeof zxcvbn?d():setTimeout(e,800)}var f="Gosh, WordPress is grand.",g=a("#pass"),h=!0,i=a("#pass-strength-result").text();g.on("focus",function(){h=!1,c()}),g.on("keyup",function(){b()}),e()}(jQuery); |