Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nette-forms

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nette-forms - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

2

package.json
{
"name": "nette-forms",
"version": "3.0.2",
"version": "3.0.3",
"description": "Client side script for Nette Forms Component",

@@ -5,0 +5,0 @@ "keywords": [

@@ -39,3 +39,3 @@ Nette Forms: greatly facilitates web forms

It requires PHP version 5.6 and supports PHP up to 7.3. The dev-master version requires PHP 7.1.
It requires PHP version 7.1 and supports PHP up to 7.3.

@@ -42,0 +42,0 @@

@@ -32,2 +32,4 @@ /**

var Nette = {};
var preventFiltering = {};
var formToggles = {};

@@ -123,6 +125,8 @@ Nette.formErrors = [];

}
if (filter) {
if (filter && preventFiltering[elem.name] === undefined) {
preventFiltering[elem.name] = true;
var ref = {value: val};
Nette.validateControl(elem, null, true, ref);
val = ref.value;
delete preventFiltering[elem.name];
}

@@ -301,4 +305,2 @@ return val;

var preventFiltering = false;
/**

@@ -317,12 +319,9 @@ * Validates single rule.

var arr = Array.isArray(arg) ? arg.slice(0) : [arg];
if (!preventFiltering) {
preventFiltering = true;
for (var i = 0, len = arr.length; i < len; i++) {
if (arr[i] && arr[i].control) {
var control = elem.form.elements.namedItem(arr[i].control);
arr[i] = control === elem ? value.value : Nette.getEffectiveValue(control, true);
}
for (var i = 0, len = arr.length; i < len; i++) {
if (arr[i] && arr[i].control) {
var control = elem.form.elements.namedItem(arr[i].control);
arr[i] = control === elem ? value.value : Nette.getEffectiveValue(control, true);
}
preventFiltering = false;
}
return Nette.validators[op]

@@ -567,3 +566,3 @@ ? Nette.validators[op](elem, Array.isArray(arg) ? arr : arr[0], value.value, value)

var i;
Nette.toggles = {};
formToggles = {};
for (i = 0; i < form.elements.length; i++) {

@@ -575,4 +574,4 @@ if (form.elements[i].tagName.toLowerCase() in {input: 1, select: 1, textarea: 1, button: 1}) {

for (i in Nette.toggles) {
Nette.toggle(i, Nette.toggles[i], elem);
for (i in formToggles) {
Nette.toggle(i, formToggles[i], elem);
}

@@ -636,3 +635,3 @@ };

if (Object.prototype.hasOwnProperty.call(rule.toggle, id2)) {
Nette.toggles[id2] = Nette.toggles[id2] || (rule.toggle[id2] ? curSuccess : !curSuccess);
formToggles[id2] = formToggles[id2] || (rule.toggle[id2] ? curSuccess : !curSuccess);
}

@@ -639,0 +638,0 @@ }

/*! netteForms.js | (c) 2004 David Grudl (https://davidgrudl.com) */
(function(e,d){if(e.JSON)if("function"===typeof define&&define.amd)define(function(){return d(e)});else if("object"===typeof module&&"object"===typeof module.exports)module.exports=d(e);else{var q=!e.Nette||!e.Nette.noInit;e.Nette=d(e);q&&e.Nette.initOnLoad()}})("undefined"!==typeof window?window:this,function(e){var d={formErrors:[],version:"3.0",onDocumentReady:function(a){"loading"!==document.readyState?a.call(this):document.addEventListener("DOMContentLoaded",a)},getValue:function(a){var c;if(a){if(a.tagName){if("radio"===
a.type){var b=a.form.elements;for(c=0;c<b.length;c++)if(b[c].name===a.name&&b[c].checked)return b[c].value;return null}if("file"===a.type)return a.files||a.value;if("select"===a.tagName.toLowerCase()){c=a.selectedIndex;b=a.options;var f=[];if("select-one"===a.type)return 0>c?null:b[c].value;for(c=0;c<b.length;c++)b[c].selected&&f.push(b[c].value);return f}if(a.name&&a.name.match(/\[\]$/)){b=a.form.elements[a.name].tagName?[a]:a.form.elements[a.name];f=[];for(c=0;c<b.length;c++)("checkbox"!==b[c].type||
b[c].checked)&&f.push(b[c].value);return f}return"checkbox"===a.type?a.checked:"textarea"===a.tagName.toLowerCase()?a.value.replace("\r",""):a.value.replace("\r","").replace(/^\s+|\s+$/g,"")}return a[0]?d.getValue(a[0]):null}return null},getEffectiveValue:function(a,c){var b=d.getValue(a);a.getAttribute&&b===a.getAttribute("data-nette-empty-value")&&(b="");c&&(b={value:b},d.validateControl(a,null,!0,b),b=b.value);return b},validateControl:function(a,c,b,f,l){a=a.tagName?a:a[0];c=c||JSON.parse(a.getAttribute("data-nette-rules")||
"[]");f=void 0===f?{value:d.getEffectiveValue(a)}:f;l=l||!d.validateRule(a,":filled",null,f);for(var h=0,p=c.length;h<p;h++){var g=c[h],k=g.op.match(/(~)?([^?]+)/),e=g.control?a.form.elements.namedItem(g.control):a;g.neg=k[1];g.op=k[2];g.condition=!!g.rules;if(e&&(!l||g.condition||":filled"===g.op)&&(e=e.tagName?e:e[0],k=d.validateRule(e,g.op,g.arg,a===e?f:void 0),null!==k))if(g.neg&&(k=!k),g.condition&&k){if(!d.validateControl(a,g.rules,b,f,":blank"===g.op?!1:l))return!1}else if(!g.condition&&!k&&
!d.isDisabled(e)){if(!b){var q=Array.isArray(g.arg)?g.arg:[g.arg];c=g.msg.replace(/%(value|\d+)/g,function(b,c){return d.getValue("value"===c?e:a.form.elements.namedItem(q[c].control))});d.addError(e,c)}return!1}}return"number"!==a.type||a.validity.valid?!0:(b||d.addError(a,"Please enter a valid value."),!1)},validateForm:function(a,c){var b=a.form||a,f=!1;d.formErrors=[];if(b["nette-submittedBy"]&&null!==b["nette-submittedBy"].getAttribute("formnovalidate"))if(f=JSON.parse(b["nette-submittedBy"].getAttribute("data-nette-validation-scope")||
"[]"),f.length)f=new RegExp("^("+f.join("-|")+"-)");else return d.showFormErrors(b,[]),!0;var l={},h;for(h=0;h<b.elements.length;h++){var e=b.elements[h];if(!e.tagName||e.tagName.toLowerCase()in{input:1,select:1,textarea:1,button:1}){if("radio"===e.type){if(l[e.name])continue;l[e.name]=!0}if(!(f&&!e.name.replace(/]\[|\[|]|$/g,"-").match(f)||d.isDisabled(e)||d.validateControl(e,null,c)||d.formErrors.length))return!1}}f=!d.formErrors.length;d.showFormErrors(b,d.formErrors);return f},isDisabled:function(a){if("radio"===
a.type){for(var c=0,b=a.form.elements;c<b.length;c++)if(b[c].name===a.name&&!b[c].disabled)return!1;return!0}return a.disabled},addError:function(a,c){d.formErrors.push({element:a,message:c})},showFormErrors:function(a,c){for(var b=[],d,e=0;e<c.length;e++){var h=c[e].element,p=c[e].message;0>b.indexOf(p)&&(b.push(p),!d&&h.focus&&(d=h))}b.length&&(alert(b.join("\n")),d&&d.focus())}},q=!1;d.validateRule=function(a,c,b,f){f=void 0===f?{value:d.getEffectiveValue(a,!0)}:f;":"===c.charAt(0)&&(c=c.substr(1));
c=c.replace("::","_");c=c.replace(/\\/g,"");var e=Array.isArray(b)?b.slice(0):[b];if(!q){q=!0;for(var h=0,p=e.length;h<p;h++)if(e[h]&&e[h].control){var g=a.form.elements.namedItem(e[h].control);e[h]=g===a?f.value:d.getEffectiveValue(g,!0)}q=!1}return d.validators[c]?d.validators[c](a,Array.isArray(b)?e:e[0],f.value,f):null};d.validators={filled:function(a,c,b){return"number"===a.type&&a.validity.badInput?!0:""!==b&&!1!==b&&null!==b&&(!Array.isArray(b)||!!b.length)&&(!e.FileList||!(b instanceof e.FileList)||
b.length)},blank:function(a,c,b){return!d.validators.filled(a,c,b)},valid:function(a){return d.validateControl(a,null,!0)},equal:function(a,c,b){function d(a){return"number"===typeof a||"string"===typeof a?""+a:!0===a?"1":""}if(void 0===c)return null;b=Array.isArray(b)?b:[b];c=Array.isArray(c)?c:[c];a=0;var e=b.length;a:for(;a<e;a++){for(var h=0,p=c.length;h<p;h++)if(d(b[a])===d(c[h]))continue a;return!1}return!0},notEqual:function(a,c,b){return void 0===c?null:!d.validators.equal(a,c,b)},minLength:function(a,
c,b){if("number"===a.type){if(a.validity.tooShort)return!1;if(a.validity.badInput)return null}return b.length>=c},maxLength:function(a,c,b){if("number"===a.type){if(a.validity.tooLong)return!1;if(a.validity.badInput)return null}return b.length<=c},length:function(a,c,b){if("number"===a.type){if(a.validity.tooShort||a.validity.tooLong)return!1;if(a.validity.badInput)return null}c=Array.isArray(c)?c:[c,c];return(null===c[0]||b.length>=c[0])&&(null===c[1]||b.length<=c[1])},email:function(a,c,b){return/^("([ !#-[\]-~]|\\[ -~])+"|[-a-z0-9!#$%&'*+/=?^_`{|}~]+(\.[-a-z0-9!#$%&'*+/=?^_`{|}~]+)*)@([0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)+[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?$/i.test(b)},
(function(e,d){if(e.JSON)if("function"===typeof define&&define.amd)define(function(){return d(e)});else if("object"===typeof module&&"object"===typeof module.exports)module.exports=d(e);else{var q=!e.Nette||!e.Nette.noInit;e.Nette=d(e);q&&e.Nette.initOnLoad()}})("undefined"!==typeof window?window:this,function(e){var d={},q={},t={};d.formErrors=[];d.version="3.0";d.onDocumentReady=function(a){"loading"!==document.readyState?a.call(this):document.addEventListener("DOMContentLoaded",a)};d.getValue=
function(a){var c;if(a){if(a.tagName){if("radio"===a.type){var b=a.form.elements;for(c=0;c<b.length;c++)if(b[c].name===a.name&&b[c].checked)return b[c].value;return null}if("file"===a.type)return a.files||a.value;if("select"===a.tagName.toLowerCase()){c=a.selectedIndex;b=a.options;var f=[];if("select-one"===a.type)return 0>c?null:b[c].value;for(c=0;c<b.length;c++)b[c].selected&&f.push(b[c].value);return f}if(a.name&&a.name.match(/\[\]$/)){b=a.form.elements[a.name].tagName?[a]:a.form.elements[a.name];
f=[];for(c=0;c<b.length;c++)("checkbox"!==b[c].type||b[c].checked)&&f.push(b[c].value);return f}return"checkbox"===a.type?a.checked:"textarea"===a.tagName.toLowerCase()?a.value.replace("\r",""):a.value.replace("\r","").replace(/^\s+|\s+$/g,"")}return a[0]?d.getValue(a[0]):null}return null};d.getEffectiveValue=function(a,c){var b=d.getValue(a);a.getAttribute&&b===a.getAttribute("data-nette-empty-value")&&(b="");c&&void 0===q[a.name]&&(q[a.name]=!0,b={value:b},d.validateControl(a,null,!0,b),b=b.value,
delete q[a.name]);return b};d.validateControl=function(a,c,b,f,l){a=a.tagName?a:a[0];c=c||JSON.parse(a.getAttribute("data-nette-rules")||"[]");f=void 0===f?{value:d.getEffectiveValue(a)}:f;l=l||!d.validateRule(a,":filled",null,f);for(var h=0,p=c.length;h<p;h++){var g=c[h],k=g.op.match(/(~)?([^?]+)/),e=g.control?a.form.elements.namedItem(g.control):a;g.neg=k[1];g.op=k[2];g.condition=!!g.rules;if(e&&(!l||g.condition||":filled"===g.op)&&(e=e.tagName?e:e[0],k=d.validateRule(e,g.op,g.arg,a===e?f:void 0),
null!==k))if(g.neg&&(k=!k),g.condition&&k){if(!d.validateControl(a,g.rules,b,f,":blank"===g.op?!1:l))return!1}else if(!g.condition&&!k&&!d.isDisabled(e)){if(!b){var q=Array.isArray(g.arg)?g.arg:[g.arg];c=g.msg.replace(/%(value|\d+)/g,function(b,c){return d.getValue("value"===c?e:a.form.elements.namedItem(q[c].control))});d.addError(e,c)}return!1}}return"number"!==a.type||a.validity.valid?!0:(b||d.addError(a,"Please enter a valid value."),!1)};d.validateForm=function(a,c){var b=a.form||a,f=!1;d.formErrors=
[];if(b["nette-submittedBy"]&&null!==b["nette-submittedBy"].getAttribute("formnovalidate"))if(f=JSON.parse(b["nette-submittedBy"].getAttribute("data-nette-validation-scope")||"[]"),f.length)f=new RegExp("^("+f.join("-|")+"-)");else return d.showFormErrors(b,[]),!0;var l={},h;for(h=0;h<b.elements.length;h++){var e=b.elements[h];if(!e.tagName||e.tagName.toLowerCase()in{input:1,select:1,textarea:1,button:1}){if("radio"===e.type){if(l[e.name])continue;l[e.name]=!0}if(!(f&&!e.name.replace(/]\[|\[|]|$/g,
"-").match(f)||d.isDisabled(e)||d.validateControl(e,null,c)||d.formErrors.length))return!1}}f=!d.formErrors.length;d.showFormErrors(b,d.formErrors);return f};d.isDisabled=function(a){if("radio"===a.type){for(var c=0,b=a.form.elements;c<b.length;c++)if(b[c].name===a.name&&!b[c].disabled)return!1;return!0}return a.disabled};d.addError=function(a,c){d.formErrors.push({element:a,message:c})};d.showFormErrors=function(a,c){for(var b=[],d,e=0;e<c.length;e++){var h=c[e].element,p=c[e].message;0>b.indexOf(p)&&
(b.push(p),!d&&h.focus&&(d=h))}b.length&&(alert(b.join("\n")),d&&d.focus())};d.validateRule=function(a,c,b,f){f=void 0===f?{value:d.getEffectiveValue(a,!0)}:f;":"===c.charAt(0)&&(c=c.substr(1));c=c.replace("::","_");c=c.replace(/\\/g,"");for(var e=Array.isArray(b)?b.slice(0):[b],h=0,p=e.length;h<p;h++)if(e[h]&&e[h].control){var g=a.form.elements.namedItem(e[h].control);e[h]=g===a?f.value:d.getEffectiveValue(g,!0)}return d.validators[c]?d.validators[c](a,Array.isArray(b)?e:e[0],f.value,f):null};d.validators=
{filled:function(a,c,b){return"number"===a.type&&a.validity.badInput?!0:""!==b&&!1!==b&&null!==b&&(!Array.isArray(b)||!!b.length)&&(!e.FileList||!(b instanceof e.FileList)||b.length)},blank:function(a,c,b){return!d.validators.filled(a,c,b)},valid:function(a){return d.validateControl(a,null,!0)},equal:function(a,c,b){function d(a){return"number"===typeof a||"string"===typeof a?""+a:!0===a?"1":""}if(void 0===c)return null;b=Array.isArray(b)?b:[b];c=Array.isArray(c)?c:[c];a=0;var e=b.length;a:for(;a<
e;a++){for(var h=0,p=c.length;h<p;h++)if(d(b[a])===d(c[h]))continue a;return!1}return!0},notEqual:function(a,c,b){return void 0===c?null:!d.validators.equal(a,c,b)},minLength:function(a,c,b){if("number"===a.type){if(a.validity.tooShort)return!1;if(a.validity.badInput)return null}return b.length>=c},maxLength:function(a,c,b){if("number"===a.type){if(a.validity.tooLong)return!1;if(a.validity.badInput)return null}return b.length<=c},length:function(a,c,b){if("number"===a.type){if(a.validity.tooShort||
a.validity.tooLong)return!1;if(a.validity.badInput)return null}c=Array.isArray(c)?c:[c,c];return(null===c[0]||b.length>=c[0])&&(null===c[1]||b.length<=c[1])},email:function(a,c,b){return/^("([ !#-[\]-~]|\\[ -~])+"|[-a-z0-9!#$%&'*+/=?^_`{|}~]+(\.[-a-z0-9!#$%&'*+/=?^_`{|}~]+)*)@([0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)+[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?$/i.test(b)},
url:function(a,c,b,d){/^[a-z\d+.-]+:/.test(b)||(b="http://"+b);return/^https?:\/\/((([-_0-9a-z\u00C0-\u02FF\u0370-\u1EFF]+\.)*[0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)?[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[[0-9a-f:]{3,39}\])(:\d{1,5})?(\/\S*)?$/i.test(b)?(d.value=b,!0):!1},regexp:function(a,c,b){a="string"===typeof c?c.match(/^\/(.*)\/([imu]*)$/):

@@ -16,6 +17,6 @@ !1;try{return a&&(new RegExp(a[1],a[2].replace("u",""))).test(b)}catch(f){}},pattern:function(a,c,b,d,l){if("string"!==typeof c)return null;try{try{var f=new RegExp("^(?:"+c+")$",l?"ui":"u")}catch(p){f=new RegExp("^(?:"+c+")$",l?"i":"")}if(e.FileList&&b instanceof FileList){for(a=0;a<b.length;a++)if(!f.test(b[a].name))return!1;return!0}return f.test(b)}catch(p){}},patternCaseInsensitive:function(a,c,b){return d.validators.pattern(a,c,b,null,!0)},numeric:function(a,c,b){return"number"===a.type&&a.validity.badInput?

if(a.validity.badInput)return null}return null===c||parseFloat(b)<=c},range:function(a,c,b){if("number"===a.type){if(a.validity.rangeUnderflow||a.validity.rangeOverflow)return!1;if(a.validity.badInput)return null}return Array.isArray(c)?(null===c[0]||parseFloat(b)>=c[0])&&(null===c[1]||parseFloat(b)<=c[1]):null},submitted:function(a){return a.form["nette-submittedBy"]===a},fileSize:function(a,c,b){if(e.FileList)for(a=0;a<b.length;a++)if(b[a].size>c)return!1;return!0},image:function(a,c,b){if(e.FileList&&
b instanceof e.FileList)for(a=0;a<b.length;a++)if((c=b[a].type)&&"image/gif"!==c&&"image/png"!==c&&"image/jpeg"!==c)return!1;return!0},"static":function(a,c){return c}};d.toggleForm=function(a,c){var b;d.toggles={};for(b=0;b<a.elements.length;b++)a.elements[b].tagName.toLowerCase()in{input:1,select:1,textarea:1,button:1}&&d.toggleControl(a.elements[b],null,null,!c);for(b in d.toggles)d.toggle(b,d.toggles[b],c)};d.toggleControl=function(a,c,b,e,l){c=c||JSON.parse(a.getAttribute("data-nette-rules")||
"[]");l=void 0===l?{value:d.getEffectiveValue(a)}:l;for(var f=!1,p=[],g=function(){d.toggleForm(a.form,a)},k,q=0,v=c.length;q<v;q++){var m=c[q],t=m.op.match(/(~)?([^?]+)/),n=m.control?a.form.elements.namedItem(m.control):a;if(n){k=b;if(!1!==b){m.neg=t[1];m.op=t[2];k=d.validateRule(n,m.op,m.arg,a===n?l:void 0);if(null===k)continue;else m.neg&&(k=!k);m.rules||(b=k)}if(m.rules&&d.toggleControl(a,m.rules,k,e,l)||m.toggle){f=!0;if(e){t=n.tagName?n.name:n[0].name;n=n.tagName?n.form.elements:n;for(var r=
0;r<n.length;r++)n[r].name===t&&0>p.indexOf(n[r])&&(n[r].addEventListener("change",g),p.push(n[r]))}for(var u in m.toggle||[])Object.prototype.hasOwnProperty.call(m.toggle,u)&&(d.toggles[u]=d.toggles[u]||(m.toggle[u]?k:!k))}}}return f};d.toggle=function(a,c,b){/^\w[\w.:-]*$/.test(a)&&(a="#"+a);a=document.querySelectorAll(a);for(b=0;b<a.length;b++)a[b].hidden=!c};d.initForm=function(a){d.toggleForm(a);a.noValidate||(a.noValidate=!0,a.addEventListener("submit",function(c){d.validateForm(a)||(c.stopPropagation(),
c.preventDefault())}))};d.initOnLoad=function(){d.onDocumentReady(function(){for(var a=0;a<document.forms.length;a++)for(var c=document.forms[a],b=0;b<c.elements.length;b++)if(c.elements[b].getAttribute("data-nette-rules")){d.initForm(c);break}document.body.addEventListener("click",function(a){for(a=a.target;a;){if(a.form&&a.type in{submit:1,image:1}){a.form["nette-submittedBy"]=a;break}a=a.parentNode}})})};d.webalize=function(a){a=a.toLowerCase();var c="",b;for(b=0;b<a.length;b++){var e=d.webalizeTable[a.charAt(b)];
c+=e?e:a.charAt(b)}return c.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")};d.webalizeTable={"\u00e1":"a","\u00e4":"a","\u010d":"c","\u010f":"d","\u00e9":"e","\u011b":"e","\u00ed":"i","\u013e":"l","\u0148":"n","\u00f3":"o","\u00f4":"o","\u0159":"r","\u0161":"s","\u0165":"t","\u00fa":"u","\u016f":"u","\u00fd":"y","\u017e":"z"};return d});
b instanceof e.FileList)for(a=0;a<b.length;a++)if((c=b[a].type)&&"image/gif"!==c&&"image/png"!==c&&"image/jpeg"!==c)return!1;return!0},"static":function(a,c){return c}};d.toggleForm=function(a,c){var b;t={};for(b=0;b<a.elements.length;b++)a.elements[b].tagName.toLowerCase()in{input:1,select:1,textarea:1,button:1}&&d.toggleControl(a.elements[b],null,null,!c);for(b in t)d.toggle(b,t[b],c)};d.toggleControl=function(a,c,b,e,l){c=c||JSON.parse(a.getAttribute("data-nette-rules")||"[]");l=void 0===l?{value:d.getEffectiveValue(a)}:
l;for(var f=!1,p=[],g=function(){d.toggleForm(a.form,a)},k,q=0,w=c.length;q<w;q++){var m=c[q],u=m.op.match(/(~)?([^?]+)/),n=m.control?a.form.elements.namedItem(m.control):a;if(n){k=b;if(!1!==b){m.neg=u[1];m.op=u[2];k=d.validateRule(n,m.op,m.arg,a===n?l:void 0);if(null===k)continue;else m.neg&&(k=!k);m.rules||(b=k)}if(m.rules&&d.toggleControl(a,m.rules,k,e,l)||m.toggle){f=!0;if(e){u=n.tagName?n.name:n[0].name;n=n.tagName?n.form.elements:n;for(var r=0;r<n.length;r++)n[r].name===u&&0>p.indexOf(n[r])&&
(n[r].addEventListener("change",g),p.push(n[r]))}for(var v in m.toggle||[])Object.prototype.hasOwnProperty.call(m.toggle,v)&&(t[v]=t[v]||(m.toggle[v]?k:!k))}}}return f};d.toggle=function(a,c,b){/^\w[\w.:-]*$/.test(a)&&(a="#"+a);a=document.querySelectorAll(a);for(b=0;b<a.length;b++)a[b].hidden=!c};d.initForm=function(a){d.toggleForm(a);a.noValidate||(a.noValidate=!0,a.addEventListener("submit",function(c){d.validateForm(a)||(c.stopPropagation(),c.preventDefault())}))};d.initOnLoad=function(){d.onDocumentReady(function(){for(var a=
0;a<document.forms.length;a++)for(var c=document.forms[a],b=0;b<c.elements.length;b++)if(c.elements[b].getAttribute("data-nette-rules")){d.initForm(c);break}document.body.addEventListener("click",function(a){for(a=a.target;a;){if(a.form&&a.type in{submit:1,image:1}){a.form["nette-submittedBy"]=a;break}a=a.parentNode}})})};d.webalize=function(a){a=a.toLowerCase();var c="",b;for(b=0;b<a.length;b++){var e=d.webalizeTable[a.charAt(b)];c+=e?e:a.charAt(b)}return c.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,
"")};d.webalizeTable={"\u00e1":"a","\u00e4":"a","\u010d":"c","\u010f":"d","\u00e9":"e","\u011b":"e","\u00ed":"i","\u013e":"l","\u0148":"n","\u00f3":"o","\u00f4":"o","\u0159":"r","\u0161":"s","\u0165":"t","\u00fa":"u","\u016f":"u","\u00fd":"y","\u017e":"z"};return d});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc