Файловый менеджер - Редактировать - /home/harasnat/www/sommer/media/system/js/fields/validate.min.js
Назад
(function(){"use strict";const L="-",_=/^xn--/,N=/[^\0-\x7F]/,R=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=36-1,u=Math.floor,x=String.fromCharCode;function h(i){throw new RangeError(y[i])}function V(i,t){const e=[];let s=i.length;for(;s--;)e[s]=t(i[s]);return e}function A(i,t){const e=i.split("@");let s="";e.length>1&&(s=e[0]+"@",i=e[1]),i=i.replace(R,".");const a=i.split("."),o=V(a,t).join(".");return s+o}function m(i){const t=[];let e=0;const s=i.length;for(;e<s;){const a=i.charCodeAt(e++);if(a>=55296&&a<=56319&&e<s){const o=i.charCodeAt(e++);(o&64512)==56320?t.push(((a&1023)<<10)+(o&1023)+65536):(t.push(a),e--)}else t.push(a)}return t}const q=i=>String.fromCodePoint(...i),J=function(i){return i>=48&&i<58?26+(i-48):i>=65&&i<91?i-65:i>=97&&i<123?i-97:36},I=function(i,t){return i+22+75*(i<26)-((t!=0)<<5)},C=function(i,t,e){let s=0;for(i=e?u(i/700):i>>1,i+=u(i/t);i>p*26>>1;s+=36)i=u(i/p);return u(s+(p+1)*i/(i+38))},M=function(i){const t=[],e=i.length;let s=0,a=128,o=72,r=i.lastIndexOf(L);r<0&&(r=0);for(let n=0;n<r;++n)i.charCodeAt(n)>=128&&h("not-basic"),t.push(i.charCodeAt(n));for(let n=r>0?r+1:0;n<e;){const c=s;for(let l=1,d=36;;d+=36){n>=e&&h("invalid-input");const f=J(i.charCodeAt(n++));f>=36&&h("invalid-input"),f>u((2147483647-s)/l)&&h("overflow"),s+=f*l;const v=d<=o?1:d>=o+26?26:d-o;if(f<v)break;const g=36-v;l>u(2147483647/g)&&h("overflow"),l*=g}const b=t.length+1;o=C(s-c,b,c==0),u(s/b)>2147483647-a&&h("overflow"),a+=u(s/b),s%=b,t.splice(s++,0,a)}return String.fromCodePoint(...t)},k=function(i){const t=[];i=m(i);const e=i.length;let s=128,a=0,o=72;for(const c of i)c<128&&t.push(x(c));const r=t.length;let n=r;for(r&&t.push(L);n<e;){let c=2147483647;for(const l of i)l>=s&&l<c&&(c=l);const b=n+1;c-s>u((2147483647-a)/b)&&h("overflow"),a+=(c-s)*b,s=c;for(const l of i)if(l<s&&++a>2147483647&&h("overflow"),l===s){let d=a;for(let f=36;;f+=36){const v=f<=o?1:f>=o+26?26:f-o;if(d<v)break;const g=d-v,S=36-v;t.push(x(I(v+g%S,0))),d=u(g/S)}t.push(x(I(d,0))),o=C(a,b,n===r),a=0,++n}++a,++s}return t.join("")},E={version:"2.3.1",ucs2:{decode:m,encode:q},decode:M,encode:k,toASCII:function(i){return A(i,function(t){return N.test(t)?"xn--"+k(t):t})},toUnicode:function(i){return A(i,function(t){return _.test(t)?M(t.slice(4).toLowerCase()):t})}};/** * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */class w{constructor(){this.customValidators={},this.handlers=[],this.handlers={},this.removeMarking=this.removeMarking.bind(this),this.inputEmail=()=>{const e=document.createElement("input");return e.setAttribute("type","email"),e.type!=="text"},this.setHandler("username",e=>!/[<|>|"|'|%|;|(|)|&]/i.test(e)),this.setHandler("password",e=>/^\S[\S ]{2,98}\S$/.test(e)),this.setHandler("numeric",e=>/^(\d|-)?(\d|,)*\.?\d*$/.test(e)),this.setHandler("email",e=>{const s=E.toASCII(e);return/^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(s)}),[].slice.call(document.querySelectorAll("form")).forEach(e=>{e.classList.contains("form-validate")&&this.attachToForm(e)})}get custom(){return this.customValidators}set custom(t){this.customValidators=t}setHandler(t,e,s){const a=s===""?!0:s;this.handlers[t]={enabled:a,exec:e}}markValid(t){const e=t.form.querySelector(`label[for="${t.id}"]`);let s;(t.classList.contains("required")||t.getAttribute("required"))&&e&&(s=e.querySelector("span.form-control-feedback")),t.classList.remove("form-control-danger"),t.classList.remove("invalid"),t.classList.add("form-control-success"),t.parentNode.classList.remove("has-danger"),t.parentNode.classList.add("has-success"),t.setAttribute("aria-invalid","false"),s&&s.parentNode.removeChild(s),e&&e.classList.remove("invalid")}markInvalid(t,e){const s=t.form.querySelector(`label[for="${t.id}"]`);t.classList.remove("form-control-success"),t.classList.remove("valid"),t.classList.add("form-control-danger"),t.classList.add("invalid"),t.parentNode.classList.remove("has-success"),t.parentNode.classList.add("has-danger"),t.setAttribute("aria-invalid","true");let a;const o=t.getAttribute("data-validation-text");if(s&&(a=s.querySelector("span.form-control-feedback")),!a){const r=document.createElement("span");r.classList.add("form-control-feedback"),e&&e==="checkbox"?r.innerHTML=o!==null?Joomla.sanitizeHtml(o):Joomla.sanitizeHtml(Joomla.Text._("JLIB_FORM_FIELD_REQUIRED_CHECK")):e&&e==="value"?r.innerHTML=o!==null?Joomla.sanitizeHtml(o):Joomla.sanitizeHtml(Joomla.Text._("JLIB_FORM_FIELD_REQUIRED_VALUE")):r.innerHTML=o!==null?Joomla.sanitizeHtml(o):Joomla.sanitizeHtml(Joomla.Text._("JLIB_FORM_FIELD_INVALID_VALUE")),s&&s.appendChild(r)}s&&s.classList.add("invalid")}removeMarking(t){let e;const s=t.form.querySelector(`label[for="${t.id}"]`);s&&(e=s.querySelector("span.form-control-feedback")),t.classList.remove("form-control-danger"),t.classList.remove("form-control-success"),t.classList.remove("invalid"),t.classList.add("valid"),t.parentNode.classList.remove("has-danger"),t.parentNode.classList.remove("has-success"),e&&s&&s.removeChild(e),s&&s.classList.remove("invalid")}handleResponse(t,e,s){const a=e.tagName.toLowerCase();(a!=="button"&&e.value!==void 0||a==="fieldset")&&(t===!1?this.markInvalid(e,s):this.markValid(e))}validate(t){let e;if(t.getAttribute("disabled")==="disabled"||t.getAttribute("display")==="none")return this.handleResponse(!0,t),!0;if(t.getAttribute("required")||t.classList.contains("required"))if(e=t.tagName.toLowerCase(),e==="fieldset"&&(t.classList.contains("radio")||t.classList.contains("checkboxes"))){if(t.querySelector("input:checked")===null)return this.handleResponse(!1,t,"checkbox"),!1}else{if(t.getAttribute("type")==="checkbox"&&t.checked!==!0||e==="select"&&!t.value.length)return this.handleResponse(!1,t,"checkbox"),!1;if(!t.value||t.classList.contains("placeholder"))return this.handleResponse(!1,t,"value"),!1}const s=t.getAttribute("class")&&t.getAttribute("class").match(/validate-([a-zA-Z0-9_-]+)/)?t.getAttribute("class").match(/validate-([a-zA-Z0-9_-]+)/)[1]:"";if(t.getAttribute("pattern")&&t.getAttribute("pattern")!==""){if(t.value.length){const a=new RegExp(`^${t.getAttribute("pattern")}$`).test(t.value);return this.handleResponse(a,t,"empty"),a}return t.hasAttribute("required")||t.classList.contains("required")?(this.handleResponse(!1,t,"empty"),!1):(this.handleResponse(!0,t),!0)}return s===""?(this.handleResponse(!0,t),!0):s&&s!=="none"&&this.handlers[s]&&t.value&&this.handlers[s].exec(t.value,t)!==!0?(this.handleResponse(!1,t,"invalid_value"),!1):(this.handleResponse(!0,t),!0)}isValid(t){let e=!0,s,a,o;const r=[];return t.nodeName==="FORM"?o=[].slice.call(t.elements):o=[].slice.call(t.querySelectorAll("input, textarea, select, button, fieldset")),o.forEach(n=>{this.validate(n)===!1&&(e=!1,r.push(n))}),Object.keys(this.customValidators).length&&Object.keys(this.customValidators).foreach(n=>{this.customValidators[n].exec()!==!0&&(e=!1)}),!e&&r.length>0&&(t.getAttribute("data-validation-text")?s=t.getAttribute("data-validation-text"):s=Joomla.Text._("JLIB_FORM_CONTAINS_INVALID_FIELDS"),a={error:[s]},Joomla.renderMessages(a)),e}attachToForm(t){let e;t.nodeName==="FORM"?e=[].slice.call(t.elements):e=[].slice.call(t.querySelectorAll("input, textarea, select, button, fieldset")),e.forEach(s=>{const a=s.tagName.toLowerCase();["input","textarea","select","fieldset"].indexOf(a)>-1&&s.classList.contains("required")&&s.setAttribute("required",""),(a==="input"||a==="button")&&(s.getAttribute("type")==="submit"||s.getAttribute("type")==="image")?s.classList.contains("validate")&&s.addEventListener("click",()=>this.isValid(t)):a!=="button"&&!(a==="input"&&s.getAttribute("type")==="button")&&a!=="fieldset"&&(s.addEventListener("blur",({target:o})=>this.validate(o)),s.addEventListener("focus",({target:o})=>this.removeMarking(o)),s.classList.contains("validate-email")&&this.inputEmail&&s.setAttribute("type","email"))})}}const F=()=>{document.formvalidator=new w,document.removeEventListener("DOMContentLoaded",F)};document.addEventListener("DOMContentLoaded",F),window.JFormValidator=w,window.punycode=E})();
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка