관리-도구
편집 파일: password-strength-meter.min.js
!function(d){"use strict";var n={init:function(){d(document.body).on("keyup change","form.register #reg_password, form.checkout #account_password, form.edit-account #password_1, form.lost_reset_password #password_1",this.strengthMeter),d("form.checkout #createaccount").change()},strengthMeter:function(){var s,r=d("form.register, form.checkout, form.edit-account, form.lost_reset_password"),e=d('button[type="submit"]',r),t=d("#reg_password, #account_password, #password_1",r),o=t.val(),a=!r.is("form.checkout");n.includeMeter(r,t),s=n.checkPasswordStrength(r,t),kkart_password_strength_meter_params.stop_checkout&&(a=!0),0<o.length&&s<kkart_password_strength_meter_params.min_password_strength&&-1!==s&&a?e.attr("disabled","disabled").addClass("disabled"):e.removeAttr("disabled","disabled").removeClass("disabled")},includeMeter:function(s,r){s=s.find(".kkart-password-strength");""===r.val()?(s.hide(),d(document.body).trigger("kkart-password-strength-hide")):0===s.length?(r.after('<div class="kkart-password-strength" aria-live="polite"></div>'),d(document.body).trigger("kkart-password-strength-added")):(s.show(),d(document.body).trigger("kkart-password-strength-show"))},checkPasswordStrength:function(s,r){var e=s.find(".kkart-password-strength"),t=s.find(".kkart-password-hint"),o='<small class="kkart-password-hint">'+kkart_password_strength_meter_params.i18n_password_hint+"</small>",s=wp.passwordStrength.meter(r.val(),wp.passwordStrength.userInputBlacklist()),r="";if(e.removeClass("short bad good strong"),t.remove(),e.is(":hidden"))return s;switch(s<kkart_password_strength_meter_params.min_password_strength&&(r=" - "+kkart_password_strength_meter_params.i18n_password_error),s){case 0:e.addClass("short").html(pwsL10n["short"]+r),e.after(o);break;case 1:case 2:e.addClass("bad").html(pwsL10n.bad+r),e.after(o);break;case 3:e.addClass("good").html(pwsL10n.good+r);break;case 4:e.addClass("strong").html(pwsL10n.strong+r);break;case 5:e.addClass("short").html(pwsL10n.mismatch)}return s}};n.init()}(jQuery);