Commit b3750748 authored by Daniele Venzano's avatar Daniele Venzano
Browse files

Remove unused JS files from web interface

parent 44faa9df
/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015
* http://jqueryvalidation.org/
* Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */
!function(a){"function"==typeof define&&define.amd?define(["jquery.wizard.js","./jquery.validate.min"],a):a(jQuery)}(function(a){!function(){function b(a){return a.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(a, c, d){return this.optional(c)||b(a).match(/\b\w+\b/g).length<=d},a.validator.format("Please enter {0} words or less.")),a.validator.addMethod("minWords",function(a, c, d){return this.optional(c)||b(a).match(/\b\w+\b/g).length>=d},a.validator.format("Please enter at least {0} words.")),a.validator.addMethod("rangeWords",function(a,c,d){var e=b(a),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},a.validator.format("Please enter between {0} and {1} words."))}(),a.validator.addMethod("accept",function(b,c,d){var e,f,g="string"==typeof d?d.replace(/\s/g,"").replace(/,/g,"|"):"image/*",h=this.optional(c);if(h)return h;if("file"===a(c).attr("type")&&(g=g.replace(/\*/g,".*"),c.files&&c.files.length))for(e=0;e<c.files.length;e++)if(f=c.files[e],!f.type.match(new RegExp("\\.?("+g+")$","i")))return!1;return!0},a.validator.format("Please enter a value with a valid mimetype.")),a.validator.addMethod("alphanumeric",function(a,b){return this.optional(b)||/^\w+$/i.test(a)},"Letters, numbers, and underscores only please"),a.validator.addMethod("bankaccountNL",function(a,b){if(this.optional(b))return!0;if(!/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(a))return!1;var c,d,e,f=a.replace(/ /g,""),g=0,h=f.length;for(c=0;h>c;c++)d=h-c,e=f.substring(c,c+1),g+=d*e;return g%11===0},"Please specify a valid bank account number"),a.validator.addMethod("bankorgiroaccountNL",function(b,c){return this.optional(c)||a.validator.methods.bankaccountNL.call(this,b,c)||a.validator.methods.giroaccountNL.call(this,b,c)},"Please specify a valid bank or giro account number"),a.validator.addMethod("bic",function(a,b){return this.optional(b)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(a)},"Please specify a valid BIC code"),a.validator.addMethod("cifES",function(a){"use strict";var b,c,d,e,f,g,h=[];if(a=a.toUpperCase(),!a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)"))return!1;for(d=0;9>d;d++)h[d]=parseInt(a.charAt(d),10);for(c=h[2]+h[4]+h[6],e=1;8>e;e+=2)f=(2*h[e]).toString(),g=f.charAt(1),c+=parseInt(f.charAt(0),10)+(""===g?0:parseInt(g,10));return/^[ABCDEFGHJNPQRSUVW]{1}/.test(a)?(c+="",b=10-parseInt(c.charAt(c.length-1),10),a+=b,h[8].toString()===String.fromCharCode(64+b)||h[8].toString()===a.charAt(a.length-1)):!1},"Please specify a valid CIF number."),a.validator.addMethod("cpfBR",function(a){if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var b,c,d,e,f=0;if(b=parseInt(a.substring(9,10),10),c=parseInt(a.substring(10,11),10),d=function(a,b){var c=10*a%11;return(10===c||11===c)&&(c=0),c===b},""===a||"00000000000"===a||"11111111111"===a||"22222222222"===a||"33333333333"===a||"44444444444"===a||"55555555555"===a||"66666666666"===a||"77777777777"===a||"88888888888"===a||"99999999999"===a)return!1;for(e=1;9>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(11-e);if(d(f,b)){for(f=0,e=1;10>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(12-e);return d(f,c)}return!1},"Please specify a valid CPF number"),a.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&/^(5[12345])/.test(a)?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:128&d?!0:!1},"Please enter a valid credit card number."),a.validator.addMethod("currency",function(a,b,c){var d,e="string"==typeof c,f=e?c:c[0],g=e?!0:c[1];return f=f.replace(/,/g,""),f=g?f+"]":f+"]?",d="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",d=new RegExp(d),this.optional(b)||d.test(a)},"Please specify a valid currency"),a.validator.addMethod("dateFA",function(a,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(a)},a.validator.messages.date),a.validator.addMethod("dateITA",function(a,b){var c,d,e,f,g,h=!1,i=/^\d{1,2}\/\d{1,2}\/\d{4}$/;return i.test(a)?(c=a.split("/"),d=parseInt(c[0],10),e=parseInt(c[1],10),f=parseInt(c[2],10),g=new Date(Date.UTC(f,e-1,d,12,0,0,0)),h=g.getUTCFullYear()===f&&g.getUTCMonth()===e-1&&g.getUTCDate()===d?!0:!1):h=!1,this.optional(b)||h},a.validator.messages.date),a.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a)},a.validator.messages.date),a.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp("\\.("+c+")$","i"))},a.validator.format("Please enter a value with a valid extension.")),a.validator.addMethod("giroaccountNL",function(a,b){return this.optional(b)||/^[0-9]{1,7}$/.test(a)},"Please specify a valid giro account number"),a.validator.addMethod("iban",function(a,b){if(this.optional(b))return!0;var c,d,e,f,g,h,i,j,k,l=a.replace(/ /g,"").toUpperCase(),m="",n=!0,o="",p="";if(c=l.substring(0,2),h={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"},g=h[c],"undefined"!=typeof g&&(i=new RegExp("^[A-Z]{2}\\d{2}"+g+"$",""),!i.test(l)))return!1;for(d=l.substring(4,l.length)+l.substring(0,4),j=0;j<d.length;j++)e=d.charAt(j),"0"!==e&&(n=!1),n||(m+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(e));for(k=0;k<m.length;k++)f=m.charAt(k),p=""+o+f,o=p%97;return 1===o},"Please specify a valid IBAN"),a.validator.addMethod("integer",function(a,b){return this.optional(b)||/^-?\d+$/.test(a)},"A positive or negative non-decimal number please"),a.validator.addMethod("ipv4",function(a,b){return this.optional(b)||/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(a)},"Please enter a valid IP v4 address."),a.validator.addMethod("ipv6",function(a,b){return this.optional(b)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(a)},"Please enter a valid IP v6 address."),a.validator.addMethod("lettersonly",function(a,b){return this.optional(b)||/^[a-z]+$/i.test(a)},"Letters only please"),a.validator.addMethod("letterswithbasicpunc",function(a,b){return this.optional(b)||/^[a-z\-.,()'"\s]+$/i.test(a)},"Letters or punctuation only please"),a.validator.addMethod("mobileNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid mobile number"),a.validator.addMethod("mobileUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),a.validator.addMethod("nieES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[T]{1}/.test(a)?a[8]===/^[T]{1}[A-Z0-9]{8}$/.test(a):/^[XYZ]{1}/.test(a)?a[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.replace("X","0").replace("Y","1").replace("Z","2").substring(0,8)%23):!1:!1},"Please specify a valid NIE number."),a.validator.addMethod("nifES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[0-9]{8}[A-Z]{1}$/.test(a)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,0)%23)===a.charAt(8):/^[KLM]{1}/.test(a)?a[8]===String.fromCharCode(64):!1:!1},"Please specify a valid NIF number."),jQuery.validator.addMethod("notEqualTo",function(b,c,d){return this.optional(c)||!a.validator.methods.equalTo.call(this,b,c,d)},"Please enter a different value, values must not be the same."),a.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please"),a.validator.addMethod("pattern",function(a,b,c){return this.optional(b)?!0:("string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a))},"Invalid format."),a.validator.addMethod("phoneNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid phone number."),a.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),a.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/)},"Please specify a valid phone number"),a.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),a.validator.addMethod("postalCodeCA",function(a,b){return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeBR",function(a,b){return this.optional(b)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(a)},"Informe um CEP válido."),a.validator.addMethod("postalcodeIT",function(a,b){return this.optional(b)||/^\d{5}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeNL",function(a,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postcodeUK",function(a,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a)},"Please specify a valid UK postcode"),a.validator.addMethod("require_from_group",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_req_grp")?f.data("valid_req_grp"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length>=d[0];return f.data("valid_req_grp",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),h},a.validator.format("Please fill at least {0} of these fields.")),a.validator.addMethod("skip_or_fill_minimum",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_skip")?f.data("valid_skip"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length,i=0===h||h>=d[0];return f.data("valid_skip",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),i},a.validator.format("Please either skip these fields or fill at least {0} of them.")),a.validator.addMethod("stateUS",function(a,b,c){var d,e="undefined"==typeof c,f=e||"undefined"==typeof c.caseSensitive?!1:c.caseSensitive,g=e||"undefined"==typeof c.includeTerritories?!1:c.includeTerritories,h=e||"undefined"==typeof c.includeMilitary?!1:c.includeMilitary;return d=g||h?g&&h?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":g?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",d=f?new RegExp(d):new RegExp(d,"i"),this.optional(b)||d.test(a)},"Please specify a valid state"),a.validator.addMethod("strippedminlength",function(b,c,d){return a(b).text().length>=d},a.validator.format("Please enter at least {0} characters")),a.validator.addMethod("time",function(a,b){return this.optional(b)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(a)},"Please enter a valid time, between 00:00 and 23:59"),a.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a)},"Please enter a valid time in 12-hour am/pm format"),a.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},a.validator.messages.url),a.validator.addMethod("vinUS",function(a){if(17!==a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;17>b;b++){if(e=j[b],d=a.slice(b,b+1),8===b&&(g=d),isNaN(d)){for(c=0;c<h.length;c++)if(d.toUpperCase()===h[c]){d=i[c],d*=e,isNaN(g)&&8===c&&(g=h[c]);break}}else d*=e;k+=d}return f=k%11,10===f&&(f="X"),f===g?!0:!1},"The specified vehicle identification number (VIN) is invalid."),a.validator.addMethod("zipcodeUS",function(a,b){return this.optional(b)||/^\d{5}(-\d{4})?$/.test(a)},"The specified US ZIP Code is invalid"),a.validator.addMethod("ziprange",function(a,b){return this.optional(b)||/^90[2-5]\d\{2\}-\d{4}$/.test(a)},"Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx")});
\ No newline at end of file
This diff is collapsed.
/*
jQuery.wizard v1.1.2
https://github.com/kflorence/jquery-wizard/
An asynchronous form wizard that supports branching.
Requires:
- jQuery 1.6.0+
- jQuery UI widget 1.9.0+
Copyright (c) 2014 Kyle Florence
Dual licensed under the MIT and GPLv2 licenses.
*/
(function( $, undefined ) {
var excludesFilter,
count = 0,
selector = {},
className = {},
// Reference to commonly used methods
aps = Array.prototype.slice,
// Used to normalize function arguments that can be either
// an array of values or a single value
arr = function( obj ) {
return $.isArray( obj ) ? obj : [ obj ];
},
// Commonly used strings
id = "id",
form = "form",
click = "click",
submit = "submit",
disabled = "disabled",
wizard = "wizard",
def = "default",
num = "number",
obj = "object",
str = "string",
bool = "boolean",
// Events
afterBackward = "afterBackward",
afterDestroy = "afterDestroy",
afterForward = "afterForward",
afterSelect = "afterSelect",
beforeBackward = "beforeBackward",
beforeDestroy = "beforeDestroy",
beforeForward = "beforeForward",
beforeSelect = "beforeSelect",
beforeSubmit = "beforeSubmit";
// Generate selectors and class names for common wizard elements
$.each( "branch form header step wrapper".split( " " ), function() {
selector[ this ] = "." + ( className[ this ] = wizard + "-" + this );
});
$.widget( "kf." + wizard, {
version: "1.1.0",
options: {
animations: {
show: {
options: {
duration: 0
},
properties: {
opacity: "show"
}
},
hide: {
options: {
duration: 0
},
properties: {
opacity: "hide"
}
}
},
backward: ".backward",
branches: ".branch",
disabled: false,
enableSubmit: false,
forward: ".forward",
header: ":header:first",
initialStep: 0,
stateAttribute: "data-state",
stepClasses: {
current: "current",
exclude: "exclude",
stop: "stop",
submit: "submit",
unidirectional: "unidirectional"
},
steps: ".step",
submit: ":submit",
transitions: {},
unidirectional: false,
/* callbacks */
afterBackward: null,
afterDestroy: null,
afterForward: null,
afterSelect: null,
beforeBackward: null,
beforeDestroy: null,
beforeForward: null,
beforeSelect: null,
create: null
},
_create: function() {
var $form, $header,
self = this,
o = self.options,
$element = self.element,
$steps = $element.find( o.steps ),
$stepsWrapper = $steps.eq( 0 ).parent();
if ( $element[ 0 ].elements ) {
$form = $element;
// If element isn't form, look inside and outside element
} else if ( !( $form = $element.find( form ) ).length ) {
$form = $element.closest( form );
}
// If header isn't found in element, look in form scope
if ( !( $header = $element.find( o.header ) ).length ) {
$header = $form.find( o.header );
}
self.elements = {
form: $form.addClass( className.form ),
submit: $form.find( o.submit ),
forward: $form.find( o.forward ),
backward: $form.find( o.backward ),
header: $header.addClass( className.header ),
steps: $element.find( o.steps ).hide().addClass( className.step ),
branches: $element.find( o.branches ).add( $stepsWrapper ).addClass( className.branch ),
stepsWrapper: $stepsWrapper.addClass( className.wrapper ),
wizard: $element.addClass( wizard )
};
if ( !$stepsWrapper.attr( id ) ) {
// stepsWrapper must have an ID as it also functions as the default branch
$stepsWrapper.attr( id, wizard + "-" + ( ++count ) );
}
self.elements.forward.click(function( event ) {
event.preventDefault();
self.forward( event );
});
self.elements.backward.click(function( event ) {
event.preventDefault();
self.backward( event );
});
self._currentState = {
branchesActivated: [],
stepsActivated: []
};
self._stepCount = self.elements.steps.length;
self._lastStepIndex = self._stepCount - 1;
// Cache branch labels for quick access later
self._branchLabels = [];
self.elements.steps.each(function( i ) {
self._branchLabels[ i ] = $( this ).parent().attr( id );
});
// Called in the context of jQuery's .filter() method in _state()
self._excludesFilter = function() {
return !$( this ).hasClass( o.stepClasses.exclude );
};
// Add default transition function if one wasn't defined
if ( !o.transitions[ def ] ) {
o.transitions[ def ] = function( state ) {
return self.stepIndex( state.step.nextAll( selector.step ) );
};
}
// Select initial step
self.select.apply( self, arr( o.initialStep ) );
},
_fastForward: function( toIndex, relative, callback ) {
var i = 0,
self = this,
stepIndex = self._currentState.stepIndex,
stepsTaken = [ stepIndex ];
if ( $.isFunction( relative ) ) {
callback = relative;
relative = undefined;
}
(function next() {
self._transition( self._state( stepIndex, stepsTaken ), function( step, branch ) {
if ( ( stepIndex = self.stepIndex( step, branch ) ) === -1 ) {
throw new Error( '[_fastForward]: Invalid step "' + step + '"' );
} else if ( $.inArray( stepIndex, stepsTaken ) >= 0 ) {
throw new Error( '[_fastForward]: Recursion detected on step "' + step + '"' );
} else {
stepsTaken.push( stepIndex );
if ( stepIndex === self._lastStepIndex ||
( relative ? ++i : stepIndex ) === toIndex ) {
callback.call( self, stepIndex, stepsTaken );
} else {
next();
}
}
});
})();
},
_find: function( needles, haystack, wrap ) {
var element, i, l, needle, type,
found = [],
$haystack = haystack instanceof jQuery ? haystack : $( haystack );
function matchElement( i, current ) {
if ( current === needle ) {
element = current;
// Break from .each loop
return false;
}
}
if ( needles !== null && $haystack.length ) {
needles = arr( needles );
for ( i = 0, l = needles.length; i < l; i++ ) {
element = null;
needle = needles[ i ];
type = typeof needle;
if ( type === num ) {
element = $haystack.get( needle );
} else if ( type === str ) {
element = document.getElementById( needle.replace( '#', '' ) );
} else if ( type === obj ) {
if ( needle instanceof jQuery && needle.length ) {
needle = needle[ 0 ];
}
if ( needle.nodeType ) {
$haystack.each( matchElement );
}
}
if ( element ) {
found.push( element );
}
}
}
// Returns a jQuery object by default. If the wrap argument is
// false, it will return an array of elements instead.
return wrap === false ? found : $( found );
},
_move: function( step, branch, relative, history, callback ) {
var self = this,
current = self._currentState;
if ( typeof branch === bool ) {
callback = history;
history = relative;
relative = branch;
branch = undefined;
}
function move( stepIndex, stepsTaken ) {
callback.call( self, stepIndex, $.isArray( history ) ?
history : history !== false ? stepsTaken : undefined );
}
if ( relative === true ) {
if ( step > 0 ) {
self._fastForward( step, relative, move );
} else {
callback.call( self, current.stepsActivated[
// Normalize to zero if negative
Math.max( 0, step + ( current.stepsActivated.length - 1 ) ) ] );
}
// Don't attempt to move to invalid steps
} else if ( ( step = self.stepIndex( step, branch ) ) !== -1 ) {
if ( step > current.stepIndex ) {
self._fastForward( step, move );
} else {
move.call( self, step );
}
}
},
_state: function( stepIndex, stepsTaken ) {
if ( !this.isValidStepIndex( stepIndex ) ) {
return null;
}
var o = this.options,
state = $.extend( true, {}, this._currentState );
// stepsTaken must be an array of at least one step
stepsTaken = arr( stepsTaken || stepIndex );
state.step = this.elements.steps.eq( stepIndex );
state.branch = state.step.parent();
state.branchStepCount = state.branch.children( selector.step ).length;
state.isMovingForward = stepIndex > state.stepIndex;
state.stepIndexInBranch = state.branch.children( selector.step ).index( state.step );
var branchLabel, indexOfBranch, indexOfStep,
i = 0,
l = stepsTaken.length;
for ( ; i < l; i++ ) {
stepIndex = stepsTaken[ i ];
branchLabel = this._branchLabels[ stepIndex ];
// Going forward
if ( !state.stepIndex || state.stepIndex < stepIndex ) {
// No duplicate steps
if ( $.inArray( stepIndex, state.stepsActivated ) < 0 ) {
state.stepsActivated.push( stepIndex );
// No duplicate branch labels
if ( $.inArray( branchLabel, state.branchesActivated ) < 0 ) {
state.branchesActivated.push( branchLabel );
}
}
// Going backward
} else if ( state.stepIndex > stepIndex ) {
indexOfBranch = $.inArray( branchLabel, state.branchesActivated ) + 1;
indexOfStep = $.inArray( stepIndex, state.stepsActivated ) + 1;
// Don't remove initial branch
if ( indexOfBranch > 0 ) {
state.branchesActivated.splice( indexOfBranch,
// IE requires this argument
state.branchesActivated.length - 1 );
}
// Don't remove the initial step
if ( indexOfStep > 0 ) {
state.stepsActivated.splice( indexOfStep,
// IE requires this argument
state.stepsActivated.length - 1 );
}
}
state.stepIndex = stepIndex;
state.branchLabel = branchLabel;
}
// Steps completed: the number of steps we have visited
state.stepsComplete = Math.max( 0, this._find(
state.stepsActivated, this.elements.steps
).filter( this._excludesFilter ).length - 1 );
// Steps possible: the number of steps in all of the branches we have visited
state.stepsPossible = Math.max( 0, this._find(
state.branchesActivated, this.elements.branches
).children( selector.step ).filter( this._excludesFilter ).length - 1 );
$.extend( state, {
branchLabel: this._branchLabels[ stepIndex ],
isFirstStep: stepIndex === 0,
isFirstStepInBranch: state.stepIndexInBranch === 0,
isLastStep: stepIndex === this._lastStepIndex,
isLastStepInBranch: state.stepIndexInBranch === state.branchStepCount - 1,
percentComplete: ( 100 * state.stepsComplete / state.stepsPossible ),
stepsRemaining: ( state.stepsPossible - state.stepsComplete )
});
return state;
},
_transition: function( state, action ) {
var response,
self = this,
o = self.options,
stateName = state.step.attr( o.stateAttribute ),
transitionFunc = stateName ? o.transitions[ stateName ] : o.transitions[ def ];
if ( $.isFunction( transitionFunc ) ) {
response = transitionFunc.call( self, state, function() {
return action.apply( self, aps.call( arguments ) );
});
} else {
response = stateName;
}
// A response of 'undefined' or 'false' will halt immediate action
// waiting instead for the transition function to handle the call
if ( response !== undefined && response !== false ) {
// Response could be array like [ step, branch ]
action.apply( self, arr( response ) );
}
},
_update: function( event, state, force ) {
var self = this,
current = self._currentState,
data = [ state, function( response ) {
self._update( event, state, response !== false );
} ],
o = self.options;
if ( current.step ) {
if (
!state ||
o.disabled ||
state.stepIndex === current.stepIndex ||
force !== true && (
!this._trigger( beforeSelect, event, data ) ||
( state.isMovingForward && !this._trigger( beforeForward, event, data ) ) ||
( !state.isMovingForward && !this._trigger( beforeBackward, event, data ) )
)
) {
return;
}
current.step.removeClass( o.stepClasses.current )
.animate( o.animations.hide.properties,
// Fixes #3583 - http://bugs.jquery.com/ticket/3583
$.extend( {}, o.animations.hide.options ) );
}
// Note that this does not affect the value of 'current'
this._currentState = state;
state.step.addClass( o.stepClasses.current )
.animate( o.animations.show.properties,
// Fixes #3583 - http://bugs.jquery.com/ticket/3583
$.extend( {}, o.animations.show.options ) );
if ( state.isFirstStep || o.unidirectional ||
state.step.hasClass( o.stepClasses.unidirectional ) ) {
this.elements.backward.attr( disabled, true );
} else {
this.elements.backward.removeAttr( disabled );
}
if ( ( state.isLastStepInBranch && !state.step.attr( o.stateAttribute ) ) ||
state.step.hasClass( o.stepClasses.stop ) ) {
this.elements.forward.attr( disabled, true );
} else {
this.elements.forward.removeAttr( disabled );
}
if ( o.enableSubmit || state.step.hasClass( o.stepClasses.submit ) ) {
this.elements.submit.removeAttr( disabled );
} else {
this.elements.submit.attr( disabled, true );
}
if ( current.step ) {
this._trigger( afterSelect, event, state );
this._trigger( state.isMovingForward ? afterForward : afterBackward, event, state );
}
},
backward: function( event, howMany ) {
if ( typeof event === num ) {
howMany = event;
event = undefined;
}
if ( howMany === undefined ) {
howMany = 1;
}