mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-18 08:36:04 +01:00
d8564963b8
see #25858, #22862. Built from https://develop.svn.wordpress.org/trunk@26143 git-svn-id: http://core.svn.wordpress.org/trunk@26054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
1.1 KiB
JavaScript
1 line
1.1 KiB
JavaScript
!function(a){function b(){var b;switch("undefined"==typeof j[g.val()]?(b=wp.passwordStrength.meter(g.val(),[],g.val()),j[g.val()]=b):b=j[g.val()],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(k),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(),setTimeout(d,i[Math.floor(Math.random()*i.length)])):(c(),setTimeout(d,700)))}function e(){"undefined"!=typeof zxcvbn?d():setTimeout(e,800)}var f="Gosh, WordPress is grand.",g=a("#pass"),h=!0,i=[280,300,305,310,315,325,330,345,360,370,380,400,450,500,600],j={},k=a("#pass-strength-result").text();g.on("focus",function(){h=!1,c()}),g.on("keyup",function(){b()}),e()}(jQuery); |