mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-07 13:18:14 +02:00
The page includes a giant password meter that serves as both an animated example and a working demo. How cool is that? props jorbin, melchoyce. see #25603. Built from https://develop.svn.wordpress.org/trunk@25839 git-svn-id: http://core.svn.wordpress.org/trunk@25751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
1005 B
JavaScript
1 line
1005 B
JavaScript
!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<e.length?(f.val(e.substr(0,f.val().length+1)),b()):(f.val(""),a("#pass-strength-result").removeClass("short bad good strong")),setTimeout(c,220+Math.floor(580*Math.random())))}function d(){"undefined"!=typeof zxcvbn?c():setTimeout(d,800)}var e="Gosh, WordPress is grand.",f=a("#pass"),g=!0,h=a("#pass-strength-result").text();f.on("focus",function(){g=!1,a("#pass-strength-result").removeClass("short bad good strong"),a("#pass-strength-result").text(h),f.val("")}),f.on("keyup",function(){b()}),d()}(jQuery); |