Gifari Industries - BD Cyber Security Team
Home
/
home
/
decohaslibrary
/
bist
/
wp-content
/
plugins
/
user-registration
/
assets
/
js
/
frontend
/
✏️
Editing: password-strength-meter.min.js
jQuery(function(s){var t=ur_password_strength_meter_params.pwsL10n,r=ur_frontend_params_with_form_id.custom_password_params,e={init:function(){var t=this;s(document.body).on("keyup change",'input[name="user_pass"], .user-registration-EditAccountForm input[name="password_1"], input[name="password_1"].user-registration-Input--password,.user-registration-ResetPassword input[name="password_1"]',function(){""!==s(this).closest("form").attr("data-enable-strength-password")&&t.strengthMeter(s(this))})},strengthMeter:function(t){var r=t.closest("form"),a=s(t,r);e.includeMeter(r,a),e.checkPasswordStrength(r,a)},includeMeter:function(t,r){var e=t.attr("data-minimum-password-strength"),a=t.find(".user-registration-password-strength"),n=t.find(".password-input-group");if(""===r.val())a.remove(),s(document.body).trigger("ur-password-strength-removed");else if(0===a.length){var o='<div class="user-registration-password-strength" aria-live="polite" data-min-strength="'+e+'"></div>';t.hasClass("register")?n.closest(".field-user_pass").after(o):s("#password_1").closest(".password-input-group").after(o),s(document.body).trigger("ur-password-strength-added")}},checkPasswordStrength:function(s,a){var n=s.find(".user-registration-password-strength"),o=s.find(".user-registration-password-hint"),i=s.attr("data-minimum-password-strength"),d="i18n_password_hint_"+i,u="undefined"!=typeof ur_password_strength_meter_params[d]?'<small class="user-registration-password-hint">'+ur_password_strength_meter_params[d]+"</small>":"",p=s.find('input[type="submit"].user-registration-Button'),h=[],l=e.extraPasswordChecks(a.val(),h);switch("4"===i&&(l=customPasswordChecks(a.val()),u='<small class="user-registration-password-hint">'+r.hint+"</small>"),(h="function"==typeof wp.passwordStrength.userInputDisallowedList?wp.passwordStrength.userInputDisallowedList():wp.passwordStrength.userInputBlacklist()).push(s.find('input[data-id="user_email"]').val()),h.push(s.find('input[data-id="user_login"]').val()),n.removeClass("short bad good strong"),o.remove(),n.after(u),s.find(".user-registration-password-strength").attr("data-current-strength",l),l){case 0:n.addClass("short").html(t.shortpw);break;case 1:n.addClass("bad").html(t.bad);break;case 2:n.addClass("good").html(t.good);break;case 3:case 4:n.addClass("strong").html(t.strong);break;case 5:n.addClass("short").html(t.mismatch)}return l>=i?p.prop("disabled",!1):p.prop("disabled",!0),l},extraPasswordChecks:function(s,t){var r=wp.passwordStrength.meter(s,t),e=/[A-ZА-Я]/;switch(r){case 1:e.test(s)||(r=0);break;case 2:e.test(s)?(e=/\d/).test(s)||(r=1):r=0;break;case 3:case 4:r=e.test(s)?(e=/\d/).test(s)?(e=/[!@#$%^&*(),.?":{}|<>]/).test(s)&&s.length>=9?4:2:1:0;break;default:r=r}return r}};e.init()});
💾 Save
❌ Cancel