芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/media.1/system/js/fields/passwordstrength-es5.min.js
!function(){"use strict";var t=function(){function t(t){this.lowercase=parseInt(t.lowercase,10)||0,this.uppercase=parseInt(t.uppercase,10)||0,this.numbers=parseInt(t.numbers,10)||0,this.special=parseInt(t.special,10)||0,this.length=parseInt(t.length,10)||12}return t.prototype.getScore=function(t){var e=this,r=0,n=0;return["lowercase","uppercase","numbers","special","length"].forEach((function(t){e[t]>0&&(n+=1)})),r+=this.constructor.calc(t,/[a-z]/g,this.lowercase,n),r+=this.constructor.calc(t,/[A-Z]/g,this.uppercase,n),r+=this.constructor.calc(t,/[0-9]/g,this.numbers,n),r+=this.constructor.calc(t,/[\$\!\#\?\=\;\:\*\-\_\€\%\&\(\)\`\´]/g,this.special,n),r+=1===n?t.length>this.length?100:100/this.length*t.length:t.length>this.length?100/n:100/n/this.length*t.length},t.calc=function(t,e,r,n){var a=t.match(e);return a&&a.length>r&&0!==r?100/n:a&&r>0?100/n/r*a.length:0},t}();!function(e,r){r.addEventListener("DOMContentLoaded",(function(){var n=[].slice.call(r.querySelectorAll(".js-password-strength"));n.forEach((function(n,a){var s="";n.value.length||(s=0);var i=r.createElement("meter");i.setAttribute("id","progress-"+a),i.setAttribute("min",0),i.setAttribute("max",100),i.setAttribute("low",40),i.setAttribute("high",99),i.setAttribute("optimum",100),i.value=s;var c=r.createElement("div");c.setAttribute("class","text-center"),c.setAttribute("id","password-"+a),c.setAttribute("aria-live","polite"),n.parentNode.insertAdjacentElement("afterEnd",c),n.parentNode.insertAdjacentElement("afterEnd",i),n.value.length>0&&n.setAttribute("required",!0),n.addEventListener("keyup",(function(n){!function(n){var a=r.querySelector("meter"),s=n.getAttribute("data-min-length"),i=n.getAttribute("data-min-integers"),c=n.getAttribute("data-min-symbols"),u=n.getAttribute("data-min-uppercase"),l=n.getAttribute("data-min-lowercase"),o=new t({lowercase:l||0,uppercase:u||0,numbers:i||0,special:c||0,length:s||12}).getScore(n.value),g=a.getAttribute("id").replace(/^\D+/g,""),h=n.parentNode.parentNode.querySelector("#password-"+g);h.innerText=100===o?e.Text._("JFIELD_PASSWORD_INDICATE_COMPLETE"):e.Text._("JFIELD_PASSWORD_INDICATE_INCOMPLETE"),a.value=o,n.value.length||(h.innerText="",n.setAttribute("required",""))}(n.target)}))})),n[0]&&r.formvalidator.setHandler("password-strength",(function(e){var n=r.querySelectorAll(".js-password-strength"),a=n[0].getAttribute("data-min-length"),s=n[0].getAttribute("data-min-integers"),i=n[0].getAttribute("data-min-symbols"),c=n[0].getAttribute("data-min-uppercase"),u=n[0].getAttribute("data-min-lowercase");return 100===new t({lowercase:u||0,uppercase:c||0,numbers:s||0,special:i||0,length:a||12}).getScore(e)}))}))}(Joomla,document)}();