You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
65 KiB
18 lines
65 KiB
7 years ago
|
/**
|
||
|
* @preserve
|
||
|
* Regula: An annotation-based form-validation framework in Javascript
|
||
|
* Version 1.3.4
|
||
|
*
|
||
|
* Written By Vivin Paliath (http://vivin.net)
|
||
|
* License: BSD License
|
||
|
* Copyright (C) 2010-2014
|
||
|
*
|
||
|
* Other licenses:
|
||
|
*
|
||
|
* DOMUtils#getElementsByAttribute
|
||
|
* Author: Robert Nyman
|
||
|
* Copyright Robert Nyman, http://www.robertnyman.com
|
||
|
* Free to use if this text is included
|
||
|
*/
|
||
|
|
||
|
(function(e,t){typeof define=="function"&&define.amd?define("utils/MapUtils",t):(typeof e.regulaModules=="undefined"&&(e.regulaModules={}),e.regulaModules.MapUtils=t())})(this,function(){return{iterateOverMap:function(e,t){var n=0;for(var r in e)e.hasOwnProperty(r)&&r!=="__size__"&&(t.call(e,r,e[r],n),n++)},exists:function(e,t){var n=!1,r=0;while(!n&&r<e.length)n=t==e[r],r++;return n},put:function(e,t,n){e.__size__||(e.__size__=0),e[t]||e.__size__++,e[t]=n},isEmpty:function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}}}),function(e,t){typeof define=="function"&&define.amd?define("utils/DOMUtils",t):(typeof e.regulaModules=="undefined"&&(e.regulaModules={}),e.regulaModules.DOMUtils=t())}(this,function(){function t(e,t,n,r){var i=t=="*"&&e.all?e.all:e.getElementsByTagName(t),s=[],o=typeof r!="undefined"?new RegExp("(^|\\s)"+r+"(\\s|$)"):null,u,a;for(var f=0;f<i.length;f++)u=i[f],a=u.getAttribute&&u.getAttribute(n),typeof a=="string"&&a.length>0&&(typeof r=="undefined"||o&&o.test(a))&&s.push(u);return s}function n(e,t){var n=e.getAttribute&&e.getAttribute(t)||null;if(!n){var r=e.attributes;for(var i=0;i<r.length;i++)r[i].nodeName===t&&(n=r[i].nodeValue)}return n}function r(){return"regula-generated-"+Math.floor(Math.random()*1e6)}function i(){return typeof document.createElement("input").checkValidity=="function"}var e={form:"The form",select:"The select box",textarea:"The text area",checkbox:"The checkbox",radio:"The radio button",text:"The text field",password:"The password",email:"The email",url:"The URL",number:"The number",datetime:"The datetime","datetime-local":"The local datetime",date:"The date",month:"The month",time:"The time",week:"The week",range:"The range",tel:"The telephone number",color:"The color"};return{friendlyInputNames:e,getElementsByAttribute:t,getAttributeValueForElement:n,generateRandomId:r,supportsHTML5Validation:i}}),function(e,t){typeof define=="function"&&define.amd?define("service/GroupService",t):(typeof e.regulaModules=="undefined"&&(e.regulaModules={}),e.regulaModules.GroupService=t())}(this,function(){var e={Default:0},t={0:"Default"},n=[],r=1;return{Group:e,ReverseGroup:t,deletedGroupIndices:n,firstCustomGroupIndex:r}}),function(e,t){typeof define=="function"&&define.amd?define("utils/ArrayUtils",t):(typeof e.regulaModules=="undefined"&&(e.regulaModules={}),e.regulaModules.ArrayUtils=t())}(this,function(){function e(e,t){var n="";for(var r=0;r<e.length;r++)n+=e[r]+t;return n.replace(new RegExp(t+"$"),"")}return{explode:e}}),function(e,t){typeof define=="function"&&define.amd?define("service/ExceptionService",["utils/ArrayUtils"],t):(typeof e.regulaModules=="undefined"&&(e.regulaModules={}),e.regulaModules.ExceptionService=t(e.regulaModules.ArrayUtils))}(this,function(e){function i(e,t,n){var r="";return e!=null?(r=e.id,t==""||t==null||t==undefined?r+=": ":r+="."+t+": "):t!=""&&t!=null&&t!=undefined&&(r="@"+t+": "),r+n}function s(t){var n="Function received: {";for(var r in t)t.hasOwnProperty(r)&&(typeof t[r]=="string"?n+=r+": "+t[r]+", ":t[r]instanceof Array&&(n+=r+": ["+e.explode(t[r],", ")+"], "));return n=n.replace(/, $/,"")+"}",n}var t={IllegalArgumentException:function(e){this.name="IllegalArgumentException",this.message=e},ConstraintDefinitionException:function(e){this.name="ConstraintDefinitionException",this.message=e},BindException:function(e){this.name="BindException",this.message=e},MissingFeatureException:function(e){this.name="MissingFeatureException",this.message=e}};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];r.prototype=new Error,r.prototype.constructor=r}return{Exception:t,generateExceptionMessage:i,explodeParameters:s}}),function(e,t){typeof define=="function"&&define.amd?define("service/ValidationService",["utils/DOMUtils","utils/MapUtils","service/GroupService","service/ExceptionService","utils/ArrayUtils"],t):(typeof e.regulaModules=="undefined"&&(e.regulaModules={}),e.regulaModules.ValidationService=t(e.regulaModules.DOMUtils,e.regulaModules.MapUtils,e.regulaModules.GroupService,e.regulaModules.ExceptionService,e.regulaModules.ArrayUtils))}(this
|