- md5
- 31ebcef9dd8b62efd065e687a4e0d5b6
- sha1
- 053c3033f3cc4c6154110e41457322f7d3eb9d55
- sha256
- 62f0a491b5627f1bfcb5c8edfe51f73cd17724d7847a275cb2aadcfa7c5fe923
"use strict";var PasswordStrength;PasswordStrength=function(){function e(e){this.lowercase=e.lowercase||0,this.uppercase=e.uppercase||0,this.numbers=e.numbers||0,this.special=e.special||0,this.length=e.length||4}return e.prototype.getScore=function(e){for(var t=0,r=0,s=["lowercase","uppercase","numbers","special","length"],a=0,n=s.length;n>a;a++)this.hasOwnProperty(s[a])&&this[s[a]]>0&&(r+=1);return t+=this.calc(e,/[a-z]/g,this.lowercase,r),t+=this.calc(e,/[A-Z]/g,this.uppercase,r),t+=this.calc(e,/[0-9]/g,this.numbers,r),t+=this.calc(e,/[\$\!\#\?\=\;\:\*\-\_\€\%\&\(\)\`\´]/g,this.special,r),t+=1==r?e.length>this.length?100:100/this.length*e.length:e.length>this.length?100/r:100/r/this.length*e.length},e.prototype.calc=function(e,t,r,s){var a;return(a=e.match(t))&&a.length>r&&0!=r?100/s:a&&r>0?100/s/r*a.length:0},e}(),document.addEventListener("DOMContentLoaded",function(){for(var e=function(e){var t=e.getAttribute("data-min-length"),r=e.getAttribute("data-min-integers"),s=e.getAttribute("data-min-symbols"),a=e.getAttribute("data-min-uppercase"),n=e.getAttribute("data-min-lowercase"),i=document.querySelector(".progress-bar"),o=new PasswordStrength({lowercase:n||0,uppercase:a||0,numbers:r||0,special:s||0,length:t||4}).getScore(e.value),g=i.getAttribute("aria-describedby").replace(/^\D+/g,""),l=e.parentNode.parentNode.querySelector("#password-"+g);o>79&&(i.setAttribute("class","progress-bar progress-bar-striped progress-bar-animated bg-warning"),l.innerHTML=Joomla.JText._("JFIELD_PASSWORD_INDICATE_COMPLETE")),o>64&&o<80&&(i.setAttribute("class","progress-bar progress-bar-striped progress-bar-animated bg-warning"),l.innerHTML=Joomla.JText._("JFIELD_PASSWORD_INDICATE_INCOMPLETE")),o>50&&o<65&&(i.setAttribute("class","progress-bar progress-bar-striped progress-bar-animated bg-warning"),l.innerHTML=Joomla.JText._("JFIELD_PASSWORD_INDICATE_INCOMPLETE")),o>40&&o<51&&(i.setAttribute("class","progress-bar progress-bar-striped progress-bar-animated bg-warning"),l.innerHTML=Joomla.JText._("JFIELD_PASSWORD_INDICATE_INCOMPLETE")),o<41&&(i.setAttribute("class","progress-bar progress-bar-striped progress-bar-animated bg-danger"),l.innerHTML=Joomla.JText._("JFIELD_PASSWORD_INDICATE_INCOMPLETE")),100===o&&i.setAttribute("class","progress-bar progress-bar-striped progress-bar-animated bg-success"),i.style.width=o+"%",e.value.length||(i.setAttribute("class","progress-bar progress-bar-striped progress-bar-animated"),l.innerHTML="",e.setAttribute("required",""))},t=document.querySelectorAll(".js-password-strength"),r=0,s=t.length;r<s;r++){var a="",n="";t[r].value.length||(a=" bg-danger",n=0);var i=document.createElement("div");i.setAttribute("class","progress");var o=document.createElement("div");o.setAttribute("class","progress-bar progress-bar-striped progress-bar-animated"+a),o.style.width=0+n,o.max=100,o.setAttribute("aria-describedby","password-"+r),i.appendChild(o);var g=document.createElement("div");g.setAttribute("class","text-xs-center"),g.setAttribute("id","password-"+r),t[r].parentNode.insertAdjacentElement("afterEnd",g),t[r].parentNode.insertAdjacentElement("afterEnd",i),t[r].value.length>0&&t[r].setAttribute("required",!0),t[r].addEventListener("keyup",function(t){e(t.target)})}t[0]&&document.formvalidator.setHandler("password-strength",function(e){var t=!1,r=document.querySelectorAll(".js-password-strength"),s=r[0].getAttribute("data-min-length"),a=r[0].getAttribute("data-min-integers"),n=r[0].getAttribute("data-min-symbols"),i=r[0].getAttribute("data-min-uppercase"),o=r[0].getAttribute("data-min-lowercase");return 100===new PasswordStrength({lowercase:o||0,uppercase:i||0,numbers:a||0,special:n||0,length:s||4}).getScore(e)&&(t=!0),t})});
No other release has this exact content. See every version of this file.