nette-forms
Advanced tools
Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "nette-forms", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Client side script for Nette Forms Component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -643,3 +643,3 @@ /** | ||
Nette.toggle = function(selector, visible, srcElement) { // eslint-disable-line no-unused-vars | ||
if (/^\w+$/.test(selector)) { // id | ||
if (/^\w[\w.:-]*$/.test(selector)) { // id | ||
selector = '#' + selector; | ||
@@ -646,0 +646,0 @@ } |
@@ -18,4 +18,4 @@ /*! netteForms.js | (c) 2004 David Grudl (https://davidgrudl.com) */ | ||
"[]");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+$/.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(), | ||
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}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35701