From 81908143a5441729153605dc4eed95b39e8f7254 Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Thu, 21 Sep 2017 12:31:17 +0100 Subject: [PATCH 01/15] Add custom sanitizer functionality Replicated the addValidator functionality in utils.js and then rewrote the existing sanitizers in santize.js to work in the new format. Also added an example custom sanitizer in form.html --- src/main/utils.js | 13 +++ src/modules/sanitize.js | 176 ++++++++++++++++++++++++++-------------- test/form.html | 31 +++++++ 3 files changed, 157 insertions(+), 63 deletions(-) diff --git a/src/main/utils.js b/src/main/utils.js index 95b102b..0caf1ca 100644 --- a/src/main/utils.js +++ b/src/main/utils.js @@ -46,6 +46,11 @@ */ validators: {}, + /** + * Available sanitizers + */ + sanitizers: {}, + /** * Events triggered by form validator */ @@ -72,6 +77,14 @@ this.validators[name] = validator; }, + /** + * Function for adding a sanitizer + * @param {Object} sanitizer + */ + addSanitizer: function (sanitizer) { + this.sanitizers[sanitizer.name] = sanitizer; + }, + /** * Warn user via the console if available */ diff --git a/src/modules/sanitize.js b/src/modules/sanitize.js index 6a5e569..4934da0 100644 --- a/src/modules/sanitize.js +++ b/src/modules/sanitize.js @@ -28,70 +28,112 @@ 'use strict'; - $.formUtils.registerLoadedModule('sanitize'); - - var inputsThatCantBeSanitized = '[type="button"], [type="submit"], [type="radio"], [type="checkbox"], [type="reset"], [type="search"]', - sanitizeCommands = { - upper : function(val) { - return val.toLocaleUpperCase(); - }, - lower : function(val) { - return val.toLocaleLowerCase(); - }, - trim : function(val) { - return $.trim(val); - }, - trimLeft : function(val) { - return val.replace(/^\s+/,''); - }, - trimRight : function(val) { - return val.replace(/\s+$/,''); - }, - capitalize : function(val) { - var words = val.split(' '); + $.formUtils.addSanitizer({ + name : 'upper', + sanitizerFunction : function(val) { + return val.toLocaleUpperCase(); + } + }); + + $.formUtils.addSanitizer({ + name : 'lower', + sanitizerFunction : function(val) { + return val.toLocaleLowerCase(); + } + }); + + $.formUtils.addSanitizer({ + name : 'trim', + sanitizerFunction : function(val) { + return $.trim(val); + } + }); + + $.formUtils.addSanitizer({ + name : 'trimLeft', + sanitizerFunction : function(val) { + return val.replace(/^\s+/,''); + } + }); + + $.formUtils.addSanitizer({ + name : 'trimRight', + sanitizerFunction : function(val) { + return val.replace(/\s+$/,''); + } + }); + + $.formUtils.addSanitizer({ + name : 'capitalize', + sanitizerFunction : function(val) { + var words = val.split(' '); $.each(words, function(i, word) { words[i] = word.substr(0,1).toUpperCase() + word.substr(1, word.length); }); return words.join(' '); - }, - insert : function(val, $input, pos) { + } + }); + + $.formUtils.addSanitizer({ + name : 'insert', + sanitizerFunction : function(val, $input, pos) { var extra = ($input.attr('data-sanitize-insert-'+pos) || '').replace(/\[SPACE\]/g, ' '); if ( (pos === 'left' && val.indexOf(extra) === 0) || (pos === 'right' && val.substring(val.length - extra.length) === extra)) { return val; } return (pos === 'left' ? extra:'') + val + (pos === 'right' ? extra : ''); - }, - insertRight : function(val, $input) { - return this.insert(val, $input, 'right'); - }, - insertLeft : function(val, $input) { - return this.insert(val, $input, 'left'); - }, - numberFormat : function(val, $input) { - if (val.length === 0) { - return val; - } - if ( 'numeral' in window ) { - //If this has been previously formatted, it needs to be unformatted first before being reformatted. - //Else numeral will fail - val = numeral().unformat(val); - val = numeral(val).format( $input.attr('data-sanitize-number-format') ); - } - else { - throw new ReferenceError('Using sanitation function "numberFormat" requires that you include numeral.js ' + - '(http://numeraljs.com/)'); - } - return val; - }, - strip: function(val, $input) { - var toRemove = $input.attr('data-sanitize-strip') || ''; - $.split(toRemove, function(char) { - var regex = new RegExp($.isNumeric(char) ? char : '\\'+char, 'g'); - val = val.replace(regex, ''); - }); - return val; - }, - escape : function(val, $input) { + } + }); + + $.formUtils.addSanitizer({ + name : 'insertRight', + sanitizerFunction : function(val, $input) { + return $.formUtils.sanitizers.insert.sanitizerFunction(val, $input, 'right'); + } + }); + + $.formUtils.addSanitizer({ + name : 'insertLeft', + sanitizerFunction : function(val, $input) { + return $.formUtils.sanitizers.insert.sanitizerFunction(val, $input, 'left'); + } + }); + + $.formUtils.addSanitizer({ + name : 'numberFormat', + sanitizerFunction : function(val, $input) { + if (val.length === 0) { + return val; + } + if ( 'numeral' in window ) { + //If this has been previously formatted, it needs to be unformatted first before being reformatted. + //Else numeral will fail + val = numeral().unformat(val); + val = numeral(val).format( $input.attr('data-sanitize-number-format') ); + } + else { + throw new ReferenceError('Using sanitation function "numberFormat" requires that you include numeral.js ' + + '(http://numeraljs.com/)'); + } + return val; + } + }); + + $.formUtils.addSanitizer({ + name : 'strip', + sanitizerFunction : function(val, $input) { + var toRemove = $input.attr('data-sanitize-strip') || ''; + $.split(toRemove, function(char) { + var regex = new RegExp($.isNumeric(char) ? char : '\\'+char, 'g'); + val = val.replace(regex, ''); + }); + return val; + } + }); + + $.formUtils.addSanitizer({ + name : 'escape', + sanitizerFunction : function(val, $input) { var isEscaped = $input.valAttr('is-escaped'), entities = { '<' : '__%AMP%__lt;', @@ -117,27 +159,35 @@ }); return val.replace(new RegExp('__\%AMP\%__', 'g'), '&'); - } - }, + } + }); + + $.formUtils.registerLoadedModule('sanitize'); + + var inputsThatCantBeSanitized = '[type="button"], [type="submit"], [type="radio"], [type="checkbox"], [type="reset"], [type="search"]', setupSanitation = function(evt, $forms, config) { if ( !$forms ) { $forms = $('form'); } - if ( !$forms.each ) { + if ( !$forms.each ) { $forms = $($forms); } var execSanitationCommands = function() { + var $input = $(this), value = $input.val(); - $.split($input.attr('data-sanitize'), function(command) { - if ( command in sanitizeCommands ) { - value = sanitizeCommands[command](value, $input, config); - } - else { + $.split($input.attr('data-sanitize'), function(command) { + + var sanitizer = $.formUtils.sanitizers[command]; + + if (sanitizer) { + value = sanitizer.sanitizerFunction(value, $input, config); + } else { throw new Error('Use of unknown sanitize command "'+command+'"'); } + }); $input .val(value) diff --git a/test/form.html b/test/form.html index 01b9d3b..c642d69 100644 --- a/test/form.html +++ b/test/form.html @@ -275,6 +275,10 @@

Validate on submit

+
+ + +

Validation Module: Poland

errorMessageKey: 'badEvenNumber', }); + // UK Surname Proper Casing + $.formUtils.addSanitizer({ + name : 'proper_case', + sanitizerFunction : function(value) { + value = value.toLocaleLowerCase(); + value = value.substring(0, 1).toUpperCase() + value.substring(1); + intPointer = value.indexOf(' '); + while (intPointer > -1) { + value = value.substring(0, intPointer + 1) + value.substring(intPointer + 1, intPointer + 2).toUpperCase() + value.substring(intPointer + 2); + intPointer = value.indexOf(' ', intPointer + 1); + } + intPointer = value.indexOf('-'); + if (intPointer > -1) + value = value.substring(0, intPointer + 1) + value.substring(intPointer + 1, intPointer + 2).toUpperCase() + value.substring(intPointer + 2); + intPointer = value.indexOf('O\''); + if (intPointer > -1) + value = value.substring(0, intPointer + 2) + value.substring(intPointer + 2, intPointer + 3).toUpperCase() + value.substring(intPointer + 3); + intPointer = value.indexOf('Mc'); + if (intPointer > -1) + value = value.substring(0, intPointer + 2) + value.substring(intPointer + 2, intPointer + 3).toUpperCase() + value.substring(intPointer + 3); + intPointer = value.indexOf('Mac'); + if (intPointer > -1) + value = value.substring(0, intPointer + 3) + value.substring(intPointer + 3, intPointer + 4).toUpperCase() + value.substring(intPointer + 4); + return value; + } + }); + window.applyValidation = function(validateOnBlur, forms, messagePosition, xtraModule) { if( !forms ) forms = 'form'; From 0bdf3e31389ef304f80a89bd5be1f14bd5b66fea Mon Sep 17 00:00:00 2001 From: Nick Holden Date: Tue, 3 Oct 2017 18:10:22 -0700 Subject: [PATCH 02/15] Fix issue with hyphens in file validation mime types Addresses #646, which reported that mime types in file validations were being parsed incorrectly when they contained hyphens. This change ensures that we only split the allowed file types string at commas and trailing white space and not at hyphens. --- src/modules/file.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/file.js b/src/modules/file.js index 5fdfb83..47e03d6 100644 --- a/src/modules/file.js +++ b/src/modules/file.js @@ -25,7 +25,7 @@ * @return {Array} */ _getTypes = function($input) { - var allowedTypes = $.split( ($input.valAttr('allowing') || '').toLowerCase() ); + var allowedTypes = ($input.valAttr('allowing') || '').toLowerCase().split(/,\s*/); if ($.inArray('jpg', allowedTypes) > -1 && $.inArray('jpeg', allowedTypes) === -1) { allowedTypes.push('jpeg'); } From 564cffd2dec3dd48f51b6731c7e1a860813dba32 Mon Sep 17 00:00:00 2001 From: BrianRosamilia Date: Thu, 4 Jan 2018 12:01:03 -0500 Subject: [PATCH 03/15] Add empty element check in case element was filtered by toggleDisabled --- src/main/jquery-plugins.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/jquery-plugins.js b/src/main/jquery-plugins.js index c3aa1d0..c12d12b 100644 --- a/src/main/jquery-plugins.js +++ b/src/main/jquery-plugins.js @@ -56,6 +56,8 @@ * * @return {jQuery} */ $.fn.validateOnEvent = function (language, config) { + if(this.length === 0) return; + var $elements = this[0].nodeName === 'FORM' ? this.find('*[data-validation-event]') : this; $elements .each(function () { From 34a27ff9bab4bf67d83ebb82b87fd4b9d8ab1254 Mon Sep 17 00:00:00 2001 From: BrianRosamilia Date: Thu, 4 Jan 2018 12:15:50 -0500 Subject: [PATCH 04/15] Fix to comply with jshint --- src/main/jquery-plugins.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/jquery-plugins.js b/src/main/jquery-plugins.js index c12d12b..e0aa610 100644 --- a/src/main/jquery-plugins.js +++ b/src/main/jquery-plugins.js @@ -56,8 +56,10 @@ * * @return {jQuery} */ $.fn.validateOnEvent = function (language, config) { - if(this.length === 0) return; - + if(this.length === 0) { + return; + } + var $elements = this[0].nodeName === 'FORM' ? this.find('*[data-validation-event]') : this; $elements .each(function () { From 9a38879365fdfde0843119f4a9e2c76f3d025b47 Mon Sep 17 00:00:00 2001 From: Victor Jonsson Date: Mon, 23 Apr 2018 09:21:31 +0200 Subject: [PATCH 05/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20baa52..6589ccc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # jQuery Form Validator -jQuery Form Validator is a **feature rich and multilingual** jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code. Even though this plugin has a wide range of validation functions it's **designed to require as little network traffic as possible**. This is achieved by grouping together validation functions in "modules", making it possible to load only those functions that's needed to validate a particular form. +jQuery Form Validator is a **feature rich and multilingual** jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code. **Form demos and full documentation available at http://formvalidator.net/** From ada0d63f1f5b3a384f0ca39b123f756b98dde99e Mon Sep 17 00:00:00 2001 From: Victor Jonsson Date: Mon, 23 Apr 2018 09:24:23 +0200 Subject: [PATCH 06/15] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6589ccc..aa567b8 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # jQuery Form Validator -jQuery Form Validator is a **feature rich and multilingual** jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code. +jQuery Form Validator is a **feature rich and multilingual** jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code. This plugin approaches validation as a form of configuration that should'nt require any knowledge of JavaScript nor programming. **Form demos and full documentation available at http://formvalidator.net/** -[![Travis](https://travis-ci.org/victorjonsson/PHP-Markdown-Documentation-Generator.svg)](https://travis-ci.org/victorjonsson/jQuery-Form-Validator/builds/) +[![Travis](https://travis-ci.org/victorjonsson/jQuery-Form-Validator.svg)](https://travis-ci.org/victorjonsson/jQuery-Form-Validator/builds/) [![npm version](https://badge.fury.io/js/jquery-form-validator.svg)](https://www.npmjs.com/package/jquery-form-validator) From ae14eab042ef8e4ed7a4b1f7da21082f000632fb Mon Sep 17 00:00:00 2001 From: Victor Jonsson Date: Mon, 13 Aug 2018 23:58:01 +0200 Subject: [PATCH 07/15] end of life... --- README.md | 18 +- form-validator/brazil.js | 143 +- form-validator/color.js | 278 ++- form-validator/date.js | 126 +- form-validator/file.js | 367 ++- form-validator/html5.js | 199 +- form-validator/jquery.form-validator.js | 17 + form-validator/jquery.form-validator.min.js | 2381 ++++++++++++++++++- form-validator/jsconf.js | 80 +- form-validator/lang/ar.js | 103 +- form-validator/lang/ca.js | 87 +- form-validator/lang/cs.js | 90 +- form-validator/lang/da.js | 90 +- form-validator/lang/de.js | 90 +- form-validator/lang/es.js | 94 +- form-validator/lang/fa.js | 89 +- form-validator/lang/fr.js | 87 +- form-validator/lang/it.js | 87 +- form-validator/lang/ka.js | 93 +- form-validator/lang/ko.js | 94 +- form-validator/lang/nl.js | 87 +- form-validator/lang/no.js | 87 +- form-validator/lang/pl.js | 96 +- form-validator/lang/pt.js | 90 +- form-validator/lang/ro.js | 90 +- form-validator/lang/ru.js | 91 +- form-validator/lang/sv.js | 88 +- form-validator/lang/tr.js | 103 +- form-validator/lang/vi.js | 86 +- form-validator/location.js | 106 +- form-validator/logic.js | 166 +- form-validator/poland.js | 141 +- form-validator/sanitize.js | 247 +- form-validator/security.js | 630 ++++- form-validator/sepa.js | 227 +- form-validator/sweden.js | 243 +- form-validator/toggleDisabled.js | 143 +- form-validator/uk.js | 167 +- package.json | 4 +- 39 files changed, 7246 insertions(+), 259 deletions(-) diff --git a/README.md b/README.md index aa567b8..077c75d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # jQuery Form Validator -jQuery Form Validator is a **feature rich and multilingual** jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code. This plugin approaches validation as a form of configuration that should'nt require any knowledge of JavaScript nor programming. +*Validation framework that let's you configure, rather than code, your validation logic.* -**Form demos and full documentation available at http://formvalidator.net/** +I started writing this plugin back in 2009 and it has given me much joy over the year. But all good things must come to an end and now it's time for this plugin to pull in its oars and go down with history. + +**NOTICE!** This plugin is no longer being developed! It supports jQuery v. 1.8 >= 2.2.4. No pull requests will become merged in but feel free to fork and do whatever you like! [![Travis](https://travis-ci.org/victorjonsson/jQuery-Form-Validator.svg)](https://travis-ci.org/victorjonsson/jQuery-Form-Validator/builds/) @@ -78,7 +80,7 @@ Read the documentation for the default features at [http://formvalidator.net/#de * **strength** — *Validate the strength of a password* * **server** — *Validate value of input on server side* * **letternumeric** — *Validate that the input value consists out of only letters and/or numbers* - * **recaptcha** - *Validate Google [reCaptcha 2](https://www.google.com/recaptcha/intro/index.html)* + * **recaptcha** - *Validate Google [reCaptcha 2](https://www.google.com/recaptcha/intro/index.html)* Read the documentation for the security module at [http://formvalidator.net/#security-validators](http://formvalidator.net/#security-validators) @@ -133,8 +135,8 @@ Read the documentation for the Swedish module at [http://formvalidator.net/#swed ### Module: uk * **ukvatnumber** - * **uknin** - * **ukutr** + * **uknin** + * **ukutr** Read the documentation for the UK module at [http://formvalidator.net/#uk-validators](http://www.formvalidator.net/#country-specific-validators_uk) @@ -143,12 +145,12 @@ Read the documentation for the UK module at [http://formvalidator.net/#uk-valida * **cep** * **cpf** -### Module: poland +### Module: poland * **plpesel** - *validate polish personal identity number (in Polish identity cards)* * **plnip** - *validate polish VAT identification number* * **plregon** - *validate polish bussiness identity number* - -### Module: color + +### Module: color * **hex** - *validate hex color format* * **rgb** - *validate rgb color format* * **rgba** - *validate rgba color format* diff --git a/form-validator/brazil.js b/form-validator/brazil.js index 6b6fc84..dcaea0b 100644 --- a/form-validator/brazil.js +++ b/form-validator/brazil.js @@ -1,9 +1,138 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: Brazil + * ------------------------------------------ + * Created by Eduardo Cuducos * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * This form validation module adds validators typically used on + * websites in the Brazil. This module adds the following validators: + * - cpf + * - cep + * - brphone + * + * @website http://formvalidator.net/#brazil-validators + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){a.formUtils.registerLoadedModule("brazil"),a.formUtils.addValidator({name:"cpf",validatorFunction:function(a){var b=a.replace(/\D/g,""),c=0,d=0,e=0,f=0;if(11!==b.length||"00000000000"===b)return!1;for(i=1;i<=9;i++)c+=parseInt(b.substring(i-1,i))*(11-i);if(e=10*c%11,e>=10&&(e=0),e!==parseInt(b.substring(9,10)))return!1;for(i=1;i<=10;i++)d+=parseInt(b.substring(i-1,i))*(12-i);return f=10*d%11,f>=10&&(f=0),f===parseInt(b.substring(10,11))},errorMessage:"",errorMessageKey:"badBrazilCPFAnswer"}),a.formUtils.addValidator({name:"brphone",validatorFunction:function(a){return!!a.match(/^(\+[\d]{1,3}[\s]{0,1}){0,1}(\(){0,1}(\d){2}(\)){0,1}(\s){0,1}(\d){4,5}([-. ]){0,1}(\d){4}$/g)},errorMessage:"",errorMessageKey:"badBrazilTelephoneAnswer"}),a.formUtils.addValidator({name:"cep",validatorFunction:function(a){return!!a.match(/^(\d){5}([-. ]){0,1}(\d){3}$/g)},errorMessage:"",errorMessageKey:"badBrazilCEPAnswer"})}(a)}); \ No newline at end of file +(function($) { + + $.formUtils.registerLoadedModule('brazil'); + + $.formUtils.addValidator({ + name : 'cpf', + validatorFunction : function(string) { + + // Based on this post from DevMedia: + // http://www.devmedia.com.br/validar-cpf-com-javascript/23916 + + // clean up the input (digits only) and set some support vars + var cpf = string.replace(/\D/g,''); + var sum1 = 0; + var sum2 = 0; + var remainder1 = 0; + var remainder2 = 0; + + // skip special cases + if (cpf.length !== 11 || cpf === '00000000000') { + return false; + } + + // check 1st verification digit + for (i = 1; i<= 9; i++) { + sum1 += parseInt(cpf.substring(i - 1, i)) * (11 - i); + } + remainder1 = (sum1 * 10) % 11; + if (remainder1 >= 10) { + remainder1 = 0; + } + if (remainder1 !== parseInt(cpf.substring(9, 10))) { + return false; + } + + // check 2nd verification digit + for (i = 1; i <= 10; i++) { + sum2 += parseInt(cpf.substring(i - 1, i)) * (12 - i); + } + remainder2 = (sum2 * 10) % 11; + if (remainder2 >= 10) { + remainder2 = 0; + } + if (remainder2 !== parseInt(cpf.substring(10, 11))) { + return false; + } + + return true; + + }, + errorMessage : '', + errorMessageKey: 'badBrazilCPFAnswer' + + }); + + $.formUtils.addValidator({ + name : 'brphone', + validatorFunction : function(string) { + + // validates telefones such as (having X as numbers): + // (XX) XXXX-XXXX + // (XX) XXXXX-XXXX + // XX XXXXXXXX + // XX XXXXXXXXX + // XXXXXXXXXX + // XXXXXXXXXXX + // +XX XX XXXXX-XXXX + // +X XX XXXX-XXXX + // And so on… + + if (string.match(/^(\+[\d]{1,3}[\s]{0,1}){0,1}(\(){0,1}(\d){2}(\)){0,1}(\s){0,1}(\d){4,5}([-. ]){0,1}(\d){4}$/g)) { + return true; + } + + return false; + + }, + errorMessage : '', + errorMessageKey: 'badBrazilTelephoneAnswer' + + }); + + $.formUtils.addValidator({ + name : 'cep', + validatorFunction : function(string) { + + // validates CEP such as (having X as numbers): + // XXXXX-XXX + // XXXXX.XXX + // XXXXX XXX + // XXXXXXXX + + if (string.match(/^(\d){5}([-. ]){0,1}(\d){3}$/g)) { + return true; + } + + return false; + + }, + errorMessage : '', + errorMessageKey: 'badBrazilCEPAnswer' + + }); + +})(jQuery); + + +})); diff --git a/form-validator/color.js b/form-validator/color.js index 2a891e4..644c464 100644 --- a/form-validator/color.js +++ b/form-validator/color.js @@ -1,9 +1,273 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: Color + * ------------------------------------------ + * Created by dszymczuk * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * + * This form validation module adds validators for some color formats like: hex, rgb, rgba, hsl, hsla. + * Also it allow to use transparent as color + * This module adds the following validators: + * - color + * + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){a.formUtils.registerLoadedModule("color");var b=function(a){return/^(\-|\+)?([0-9]+(\.[0-9]+)?|Infinity)$/.test(a)?Number(a):NaN},c=function(a){return a>0&&a<1},d=function(b){return Math.floor(b)===b&&a.isNumeric(b)};a.formUtils.addValidator({name:"hex",validatorFunction:function(a,b){if("true"===b.valAttr("allow-transparent")&&"transparent"===a)return!0;var c="#"===a[0];if(!c)return!1;var d=4===a.length||7===a.length;if(d){var e=/[0-9a-f]/i,f=a.slice(1).split(""),g=!0;return f.forEach(function(a){null===a.match(e)&&(g=!1)}),g}return!1},errorMessage:"",errorMessageKey:"badHex"}),a.formUtils.addValidator({name:"rgb",validatorFunction:function(a,b){if("true"===b.valAttr("allow-transparent")&&"transparent"===a)return!0;var c=a.replace(/ /g,""),e=/rgb\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3}\)/i;if(c.match(e)){var f=c.replace(/rgb/g,""),g=f.replace(/\(/g,"").replace(/\)/g,""),h=g.split(","),i=!0;return h.forEach(function(a){var b=parseInt(a,10);(d(b)&&0<=b&&b<=255)===!1&&(i=!1)}),i}return!1},errorMessage:"",errorMessageKey:"badRgb"}),a.formUtils.addValidator({name:"rgba",validatorFunction:function(a,e){if("true"===e.valAttr("allow-transparent")&&"transparent"===a)return!0;var f=a.replace(/ /g,""),g=/rgba\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0,1]?.?[0-9]*\)/i;if(f.match(g)){var h=f.replace(/rgba/g,""),i=h.replace(/\(/g,"").replace(/\)/g,""),j=i.split(","),k=!0;return j.forEach(function(a,e){var f=b(a);if(d(f)){var g=f>=0&&f<=255;g||(k=!1),k&&3===e&&(k=f>=0&&f<2)}else c(a)||(k=!1)}),k}return!1},errorMessage:"",errorMessageKey:"badRgba"}),a.formUtils.addValidator({name:"hsl",validatorFunction:function(a,b){if("true"===b.valAttr("allow-transparent")&&"transparent"===a)return!0;var c=a.replace(/ /g,""),e=/hsl\(-?[0-9]{1,3},[0-9]{1,3}%,[0-9]{1,3}%\)/i;if(c.match(e)){var f=c.replace(/hsl/g,""),g=f.replace(/\(/g,"").replace(/\)/g,""),h=g.split(","),i=!0;return h.forEach(function(a,b){var c=parseInt(a,10);if(d(c)){if(0!==b){var e=c>=0&&c<=100;e||(i=!1)}}else i=!1}),i}return!1},errorMessage:"",errorMessageKey:"badHsl"}),a.formUtils.addValidator({name:"hsla",validatorFunction:function(a,c){if("true"===c.valAttr("allow-transparent")&&"transparent"===a)return!0;var e,f=a.replace(/ /g,""),g=/hsla\(-?[0-9]{1,3},[0-9]{1,3}%,[0-9]{1,3}%,[0,1]?.?[0-9]*\)/i;if(f.match(g)){var h=f.replace(/hsla/g,""),i=h.replace(/\(/g,"").replace(/\)/g,""),j=i.split(","),k=!0;return j.forEach(function(a,c){var f=b(a),g=parseInt(a,10);d(f)?(0!==c&&3!==c&&(e=f>=0&&f<=100,e||(k=!1)),k&&3===c&&(k=f>=0&&f<2)):isNaN(f)&&d(g)?(e=g>=0&&g<=100,e||(k=!1)):(f=b(Number(a).toFixed(20)),e=f>=0&&f<=1,e||(k=!1))}),k}return!1},errorMessage:"",errorMessageKey:"badHsla"})}(a)}); \ No newline at end of file +(function($) { + + $.formUtils.registerLoadedModule('color'); + + /* + HELPER FUNCTIONS + */ + var filterFloat = function(value) { + if (/^(\-|\+)?([0-9]+(\.[0-9]+)?|Infinity)$/ + .test(value)) { + return Number(value); + } + + return NaN; + }; + + var isBetween0and1 = function(value) { + return value > 0 && value < 1; + }; + + // workaround for PhantomJS + // https://github.com/ariya/phantomjs/issues/14014 + // can't use Number.isInteger + var isInteger = function(value) { + return Math.floor(value) === value && $.isNumeric(value); + }; + + /** + * Check HEX format + */ + $.formUtils.addValidator({ + name: 'hex', + validatorFunction: function(val, $el) { + if ($el.valAttr('allow-transparent') === 'true' && val === 'transparent') { + return true; + } + + var startWithHex = val[0] === '#'; + if (!startWithHex) { + return false; + } + + var isCorrectLength = val.length === 4 || val.length === 7; + + if (isCorrectLength) { + var regex = /[0-9a-f]/i; + var valueSliced = val.slice(1).split(''); + var isValid = true; + valueSliced.forEach(function(i) { + if (i.match(regex) === null) { + isValid = false; + } + }); + return isValid; + } + + return false; + }, + errorMessage: '', + errorMessageKey: 'badHex' + }); + + /** + * Check RGB format + */ + $.formUtils.addValidator({ + name: 'rgb', + validatorFunction: function(val, $el) { + if ($el.valAttr('allow-transparent') === 'true' && val === 'transparent') { + return true; + } + + var removedSpace = val.replace(/ /g, ''); + var regex = /rgb\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3}\)/i; + + if (removedSpace.match(regex)) { + var removeRgbCall = removedSpace.replace(/rgb/g, ''); + var removeBrackets = removeRgbCall.replace(/\(/g, '').replace(/\)/g, ''); + var valueSliced = removeBrackets.split(','); + var isValid = true; + + valueSliced.forEach(function(i) { + var parsedInt = parseInt(i, 10); + if ((isInteger(parsedInt) && 0 <= parsedInt && parsedInt <= 255) === false) { + isValid = false; + } + }); + return isValid; + } + + return false; + }, + errorMessage: '', + errorMessageKey: 'badRgb' + }); + + /** + * Check RGBA format + */ + $.formUtils.addValidator({ + name: 'rgba', + validatorFunction: function(val, $el) { + if ($el.valAttr('allow-transparent') === 'true' && val === 'transparent') { + return true; + } + + var removedSpace = val.replace(/ /g, ''); + var regex = /rgba\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0,1]?.?[0-9]*\)/i; + + if (removedSpace.match(regex)) { + var removeRgbaCall = removedSpace.replace(/rgba/g, ''); + var removeBrackets = removeRgbaCall.replace(/\(/g, '').replace(/\)/g, ''); + var valueSliced = removeBrackets.split(','); + var isValid = true; + + valueSliced.forEach(function(i, index) { + var value = filterFloat(i); + if (isInteger(value)) { + var isInRange = value >= 0 && value <= 255; + if (!isInRange) { + isValid = false; + } + + if (isValid && index === 3) { + isValid = value >= 0 && value < 2; + } + } else if (!isBetween0and1(i)) { + isValid = false; + } + }); + return isValid; + } + + return false; + }, + errorMessage: '', + errorMessageKey: 'badRgba' + }); + + /** + * Check HSL format + */ + $.formUtils.addValidator({ + name: 'hsl', + validatorFunction: function(val, $el) { + if ($el.valAttr('allow-transparent') === 'true' && val === 'transparent') { + return true; + } + + var removedSpace = val.replace(/ /g, ''); + var regex = /hsl\(-?[0-9]{1,3},[0-9]{1,3}%,[0-9]{1,3}%\)/i; + + if (removedSpace.match(regex)) { + var removeHslCall = removedSpace.replace(/hsl/g, ''); + var removeBrackets = removeHslCall.replace(/\(/g, '').replace(/\)/g, ''); + var valueSliced = removeBrackets.split(','); + var isValid = true; + + valueSliced.forEach(function(i, index) { + var parsedInt = parseInt(i, 10); + + if (isInteger(parsedInt)) { + if (index !== 0) { + var isInRange = parsedInt >= 0 && parsedInt <= 100; + if (!isInRange) { + isValid = false; + } + } + } else { + isValid = false; + } + }); + return isValid; + } + + return false; + }, + errorMessage: '', + errorMessageKey: 'badHsl' + }); + + /** + * Check HSLA format + */ + $.formUtils.addValidator({ + name: 'hsla', + validatorFunction: function(val, $el) { + if ($el.valAttr('allow-transparent') === 'true' && val === 'transparent') { + return true; + } + + var isInRange; + var removedSpace = val.replace(/ /g, ''); + var regex = /hsla\(-?[0-9]{1,3},[0-9]{1,3}%,[0-9]{1,3}%,[0,1]?.?[0-9]*\)/i; + + if (removedSpace.match(regex)) { + var removeHslaCall = removedSpace.replace(/hsla/g, ''); + var removeBrackets = removeHslaCall.replace(/\(/g, '').replace(/\)/g, ''); + var valueSliced = removeBrackets.split(','); + var isValid = true; + + valueSliced.forEach(function(i, index) { + var value = filterFloat(i); + var parsedInt = parseInt(i, 10); + + if (isInteger(value)) { + if (index !== 0 && index !== 3) { + isInRange = value >= 0 && value <= 100; + if (!isInRange) { + isValid = false; + } + } + + if (isValid && index === 3) { + isValid = value >= 0 && value < 2; + } + } else if (isNaN(value) && isInteger(parsedInt)) { + isInRange = parsedInt >= 0 && parsedInt <= 100; + if (!isInRange) { + isValid = false; + } + } else { + value = filterFloat(Number(i).toFixed(20)); + + isInRange = value >= 0 && value <= 1; + if (!isInRange) { + isValid = false; + } + } + }); + + return isValid; + } + + return false; + }, + errorMessage: '', + errorMessageKey: 'badHsla' + }); + +})(jQuery); + + +})); diff --git a/form-validator/date.js b/form-validator/date.js index 350ee2c..8f57021 100644 --- a/form-validator/date.js +++ b/form-validator/date.js @@ -1,9 +1,121 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: Date + * ------------------------------------------ + * Created by Victor Jonsson + * Documentation and issue tracking on Github * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * The following validators will be added by this module: + * - Time (HH:mmm) + * - Birth date + * + * @website http://formvalidator.net/#location-validators + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){function b(a,b,d){var e=new Date(a,b,d),f=new Date,g=f.getFullYear()-e.getFullYear();e.setFullYear(e.getFullYear()+g),e>f&&(g--,e.setFullYear(e.getFullYear()-1));var h=Math.floor((f.getTime()-e.getTime())/864e5),i=g+h/(c(f.getFullYear())?366:365),j=((i+"").split(".")[1]||"").substr(0,3);return i>=0?Math.floor(i)+(j>=915?1:0):(j*=10,Math.floor(i)+(j<=840?1:0))}function c(a){var b=new Date(a,1,28);return b.setDate(b.getDate()+1),1===b.getMonth()}a.formUtils.registerLoadedModule("date"),a.formUtils.addValidator({name:"time",validatorFunction:function(a){if(null===a.match(/^(\d{2}):(\d{2})$/))return!1;var b=parseInt(a.split(":")[0],10),c=parseInt(a.split(":")[1],10);return!(b>23||c>59)},errorMessage:"",errorMessageKey:"badTime"}),a.formUtils.addValidator({name:"birthdate",validatorFunction:function(c,d,e){var f="yyyy-mm-dd";d.valAttr("format")?f=d.valAttr("format"):"undefined"!=typeof e.dateFormat&&(f=e.dateFormat);var g=a.formUtils.parseDate(c,f);if(!g)return!1;var h=g[0],i=g[1],j=g[2],k=b(h,i,j),l=(d.valAttr("age-range")||"0-124").split("-");if(d.trigger("ageCalculated",[k]),2!==l.length||!a.isNumeric(l[0])||!a.isNumeric(l[1]))throw new Error("Date range format invalid");return k>=l[0]&&k<=l[1]},errorMessage:"",errorMessageKey:"badDate"})}(a)}); \ No newline at end of file +(function ($) { + + $.formUtils.registerLoadedModule('date'); + + /* + * Validate time hh:mm + */ + $.formUtils.addValidator({ + name: 'time', + validatorFunction: function (time) { + if (time.match(/^(\d{2}):(\d{2})$/) === null) { + return false; + } else { + var hours = parseInt(time.split(':')[0], 10); + var minutes = parseInt(time.split(':')[1], 10); + if (hours > 23 || minutes > 59) { + return false; + } + } + return true; + }, + errorMessage: '', + errorMessageKey: 'badTime' + }); + + /* + * Is this a valid birth date + */ + $.formUtils.addValidator({ + name: 'birthdate', + validatorFunction: function (val, $el, conf) { + var dateFormat = 'yyyy-mm-dd'; + if ($el.valAttr('format')) { + dateFormat = $el.valAttr('format'); + } + else if (typeof conf.dateFormat !== 'undefined') { + dateFormat = conf.dateFormat; + } + + var inputDate = $.formUtils.parseDate(val, dateFormat); + if (!inputDate) { + return false; + } + + var year = inputDate[0], + month = inputDate[1], + day = inputDate[2], + age = getAge(year, month, day), + allowedAgeRange = ($el.valAttr('age-range') || '0-124').split('-'); + + $el.trigger('ageCalculated', [age]); + + if (allowedAgeRange.length !== 2 || !$.isNumeric(allowedAgeRange[0]) || !$.isNumeric(allowedAgeRange[1])) { + throw new Error('Date range format invalid'); + } + + return age >= allowedAgeRange[0] && age <= allowedAgeRange[1]; + }, + errorMessage: '', + errorMessageKey: 'badDate' + }); + + function getAge(otherDateYear, otherDateMonth, otherDateDay) { + var birthDate = new Date(otherDateYear, otherDateMonth, otherDateDay), now = new Date(), + years = now.getFullYear() - birthDate.getFullYear(); + birthDate.setFullYear(birthDate.getFullYear() + years); + if (birthDate > now) { + years--; + birthDate.setFullYear(birthDate.getFullYear() - 1); + } + var days = Math.floor((now.getTime() - birthDate.getTime()) / (3600 * 24 * 1000)), + yearsOld = years + days / (isLeapYear(now.getFullYear()) ? 366 : 365), + decimals = ((yearsOld + '').split('.')[1] || '').substr(0, 3); + + if (yearsOld >= 0) { + return Math.floor(yearsOld) + (decimals >= 915 ? 1:0); + } else { + decimals *= 10; + return Math.floor(yearsOld) + (decimals <= 840 ? 1:0); + } + } + + function isLeapYear(year) { + var d = new Date(year, 1, 28); + d.setDate(d.getDate() + 1); + return d.getMonth() === 1; + } + +})(jQuery); + + +})); diff --git a/form-validator/file.js b/form-validator/file.js index 9130cd0..40a2145 100644 --- a/form-validator/file.js +++ b/form-validator/file.js @@ -1,9 +1,362 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: File + * ------------------------------------------ + * Created by Victor Jonsson * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * The following validators will be added by this module: + * - mime type + * - file size + * - file extension + * + * @todo, Use $.formUtils.asyncValidation in "dimension" validator + * + * @website http://formvalidator.net/#file-validators + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){a.formUtils.registerLoadedModule("file");var c="undefined"!=typeof b.FileReader,d=function(b){var c=a.split((b.valAttr("allowing")||"").toLowerCase());return a.inArray("jpg",c)>-1&&a.inArray("jpeg",c)===-1?c.push("jpeg"):a.inArray("jpeg",c)>-1&&a.inArray("jpg",c)===-1&&c.push("jpg"),c},e=function(a,b,c,d){var e=d[b]||"";a.errorMessageKey="",a.errorMessage=e.replace("%s",c)},f=function(c,d,e){var f=new FileReader,g=new Image;f.readAsDataURL(c),f.onload=function(c){g.onload=function(){a(b).trigger("imageValidation",[this]),d(this)},g.onerror=function(){e()},g.src=c.target.result}};a.formUtils.addValidator({name:"mime",validatorFunction:function(b,f,g,h){if(c){var i=!0,j=f.get(0).files||[],k="",l=d(f);return j.length&&(a.each(j,function(b,c){return i=!1,k=c.type||c.name.substring(c.name.lastIndexOf(".")+1),a.each(l,function(a,b){if(i=k.indexOf(b)>-1)return!1}),i}),i||(a.formUtils.warn("Trying to upload a file with mime type "+k+" which is not allowed"),e(this,"wrongFileType",l.join(", "),h))),i}return a.formUtils.warn("FileReader not supported by browser, will check file extension"),a.formUtils.validators.validate_extension.validatorFunction(b,f,g,h)},errorMessage:"",errorMessageKey:"wrongFileType"}),a.formUtils.addValidator({name:"extension",validatorFunction:function(b,c,f,g){var h=!0,i=this,j=d(c);return a.each(c.get(0).files||[b],function(b,c){var d="string"==typeof c?c:c.value||c.fileName||c.name,f=d.substr(d.lastIndexOf(".")+1);if(a.inArray(f.toLowerCase(),j)===-1)return h=!1,e(i,"wrongFileType",j.join(", "),g),!1}),h},errorMessage:"",errorMessageKey:"wrongFileType"}),a.formUtils.addValidator({name:"size",validatorFunction:function(b,d,f,g){var h=d.valAttr("max-size");if(!h)return a.formUtils.warn('Input "'+d.attr("name")+'" is missing data-validation-max-size attribute',!0),!0;if(!c)return!0;var i=a.formUtils.convertSizeNameToBytes(h),j=!0;return a.each(d.get(0).files||[],function(a,b){return j=b.size<=i}),j||e(this,"wrongFileSize",h,g),j},errorMessage:"",errorMessageKey:"wrongFileSize"}),a.formUtils.convertSizeNameToBytes=function(a){return a=a.toUpperCase(),"M"===a.substr(a.length-1,1)?1024*parseInt(a.substr(0,a.length-1),10)*1024:"MB"===a.substr(a.length-2,2)?1024*parseInt(a.substr(0,a.length-2),10)*1024:"KB"===a.substr(a.length-2,2)?1024*parseInt(a.substr(0,a.length-2),10):"B"===a.substr(a.length-1,1)?parseInt(a.substr(0,a.length-1),10):parseInt(a,10)},a.formUtils.checkImageDimension=function(a,b,c){var d=!1,e={width:0,height:0},f=function(a){a=a.replace("min","").replace("max","");var b=a.split("x");e.width=b[0],e.height=b[1]?b[1]:b[0]},g=!1,h=!1,i=b.split("-");return 1===i.length?0===i[0].indexOf("min")?g=i[0]:h=i[0]:(g=i[0],h=i[1]),g&&(f(g),(a.widthe.width||a.height>e.height)&&(d=a.width>e.width?c.imageTooWide+" "+e.width+"px":c.imageTooTall+" "+e.height+"px",d+=" ("+c.max+" "+e.width+"x"+e.height+"px)")),d},a.formUtils.checkImageRatio=function(a,b,c){var d=a.width/a.height,e=function(a){var b=a.replace("max","").replace("min","").split(":");return b[0]/b[1]},f=b.split("-"),g=function(a,b,c){return a>=b&&a<=c};if(1===f.length){if(d!==e(f[0]))return c.imageRatioNotAccepted}else if(2===f.length&&!g(d,e(f[0]),e(f[1])))return c.imageRatioNotAccepted;return!1},a.formUtils.addAsyncValidator({name:"dimension",validatorFunction:function(b,d,e,g,h){if(c){var i=e.get(0).files||[],j=this;e.attr("data-validation").indexOf("mime")===-1?(alert("You should validate file type being jpg, gif or png on input "+e[0].name),b(!1)):i.length>1?(alert("Validating image dimensions does not support inputs allowing multiple files"),b(!1)):0===i.length?b(!0):f(i[0],function(c){var d=!1;e.valAttr("dimension")&&(d=a.formUtils.checkImageDimension(c,e.valAttr("dimension"),h)),!d&&e.valAttr("ratio")&&(d=a.formUtils.checkImageRatio(c,e.valAttr("ratio"),h)),d?(j.errorMessage=h.wrongFileDim+" "+e.valAttr("has-not-valid-dim"),b(!1)):b(!0)},function(a){throw a})}else b(!0)},errorMessage:"",errorMessageKey:""}),a(b).one("validatorsLoaded formValidationSetup",function(b,c,d){var e;e=c?c.find('input[type="file"]'):a('input[type="file"]'),a.formUtils.dialogs.removeInputStylingAndMessage(e,d)})}(a,window)}); \ No newline at end of file +(function($, window) { + + $.formUtils.registerLoadedModule('file'); + + 'use strict'; + + var SUPPORTS_FILE_READER = typeof window.FileReader !== 'undefined', + + /** + * @return {Array} + */ + _getTypes = function($input) { + var allowedTypes = ($input.valAttr('allowing') || '').toLowerCase().split(/,\s*/); + if ($.inArray('jpg', allowedTypes) > -1 && $.inArray('jpeg', allowedTypes) === -1) { + allowedTypes.push('jpeg'); + } + else if ($.inArray('jpeg', allowedTypes) > -1 && $.inArray('jpg', allowedTypes) === -1) { + allowedTypes.push('jpg'); + } + return allowedTypes; + }, + + /** + * @param {Object} obj + * @param {String} key + * @param {String} insert + * @param {Object} lang + */ + _generateErrorMsg = function(obj, key, insert, lang) { + var msg = lang[key] || ''; + obj.errorMessageKey = ''; // only use message attached to this object + obj.errorMessage = msg.replace('\%s', insert); + }, + + /** + * @param {String} imgPath + * @param {Function} successCallback + * @param {Function} errCallback + * @private + */ + _loadImage = function(imgPath, successCallback, errCallback) { + var reader = new FileReader(), + image = new Image(); + + reader.readAsDataURL(imgPath); + + reader.onload = function(fileObj) { + image.onload = function() { + $(window).trigger('imageValidation', [this]); + successCallback(this); + }; + + image.onerror= function() { + errCallback(); + }; + + image.src = fileObj.target.result; + }; + }; + + /* + * Validate mime type (falls back on validate_extension in older browsers) + */ + $.formUtils.addValidator({ + name : 'mime', + validatorFunction : function(str, $input, conf, language) { + if( SUPPORTS_FILE_READER ) { + var valid = true, + files = $input.get(0).files || [], + mime = '', + allowedTypes = _getTypes($input); + + if( files.length ) { + $.each(files, function(i, file) { + valid = false; + mime = file.type || file.name.substring(file.name.lastIndexOf('.') + 1); + $.each(allowedTypes, function(j, type) { + valid = mime.indexOf(type) > -1; + if( valid ) { + return false; + } + }); + return valid; + }); + + if (!valid) { + $.formUtils.warn('Trying to upload a file with mime type '+mime+' which is not allowed'); + _generateErrorMsg(this, 'wrongFileType', allowedTypes.join(', '), language); + } + } + + return valid; + + } else { + $.formUtils.warn('FileReader not supported by browser, will check file extension'); + return $.formUtils.validators.validate_extension.validatorFunction(str, $input, conf, language); + } + }, + errorMessage : '', + errorMessageKey: 'wrongFileType' + }); + + /** + * Validate file extension + */ + $.formUtils.addValidator({ + name : 'extension', + validatorFunction : function(value, $input, conf, language) { + var valid = true, + _this = this, + allowedTypes = _getTypes($input); + + $.each($input.get(0).files || [value], function(i, file) { + var val = typeof file === 'string' ? file : (file.value || file.fileName || file.name), + ext = val.substr( val.lastIndexOf('.')+1 ); + + if( $.inArray(ext.toLowerCase(), allowedTypes) === -1 ) { + valid = false; + _generateErrorMsg(_this, 'wrongFileType', allowedTypes.join(', '), language); + return false; + } + }); + + return valid; + }, + errorMessage : '', + errorMessageKey: 'wrongFileType' + }); + + /** + * Validate file size + */ + $.formUtils.addValidator({ + name : 'size', + validatorFunction : function(val, $input, conf, language) { + var maxSize = $input.valAttr('max-size'); + if( !maxSize ) { + $.formUtils.warn('Input "'+$input.attr('name')+'" is missing data-validation-max-size attribute', true); + return true; + } else if( !SUPPORTS_FILE_READER ) { + return true; // no fallback available + } + + var maxBytes = $.formUtils.convertSizeNameToBytes(maxSize), + valid = true; + + $.each($input.get(0).files || [], function(i, file) { + valid = file.size <= maxBytes; + return valid; + }); + + if( !valid ) { + _generateErrorMsg(this, 'wrongFileSize', maxSize, language); + } + return valid; + }, + errorMessage : '', + errorMessageKey: 'wrongFileSize' + }); + + /** + * Make this function accessible via formUtils for unit tests + * @param {String} sizeName + * @return {Number} + */ + $.formUtils.convertSizeNameToBytes = function(sizeName) { + sizeName = sizeName.toUpperCase(); + if( sizeName.substr(sizeName.length-1, 1) === 'M' ) { + return parseInt(sizeName.substr(0, sizeName.length-1), 10) * 1024 * 1024; + } else if( sizeName.substr(sizeName.length-2, 2) === 'MB' ) { + return parseInt(sizeName.substr(0, sizeName.length-2), 10) * 1024 * 1024; + } else if( sizeName.substr(sizeName.length-2, 2) === 'KB' ) { + return parseInt(sizeName.substr(0, sizeName.length-2), 10) * 1024; + } else if( sizeName.substr(sizeName.length-1, 1) === 'B' ) { + return parseInt(sizeName.substr(0, sizeName.length-1), 10); + } else { + return parseInt(sizeName, 10); + } + }; + + /** + * Attach dimension check onto formUtils only for unit testing purpose + * @param {HTMLImageElement} img + * @param {String} dimDeclaration + * @param {Boolean|String} Returns error message if image was invalid, false otherwise + */ + $.formUtils.checkImageDimension = function(img, dimDeclaration, language) { + var error = false, + restrictedDim = {width:0, height:0}, + getDimRestriction = function(dimDeclaration) { + dimDeclaration = dimDeclaration.replace('min', '').replace('max', ''); + var chunks = dimDeclaration.split('x'); + restrictedDim.width = chunks[0]; + restrictedDim.height = chunks[1] ? chunks[1] : chunks[0]; + }, + minDeclaration = false, + maxDeclaration = false, + declarationParts = dimDeclaration.split('-'); + + if( declarationParts.length === 1 ) { + if( declarationParts[0].indexOf('min') === 0 ) { + minDeclaration = declarationParts[0]; + } else { + maxDeclaration = declarationParts[0]; + } + } else { + minDeclaration = declarationParts[0]; + maxDeclaration = declarationParts[1]; + } + + if( minDeclaration ) { + // check min + getDimRestriction(minDeclaration); + if( img.width < restrictedDim.width || img.height < restrictedDim.height ) { + error = language.imageTooSmall + ' ('+language.min+' '+restrictedDim.width+'x'+restrictedDim.height+'px)'; + } + } + + if( !error && maxDeclaration ) { + // Check max + getDimRestriction(maxDeclaration); + if( img.width > restrictedDim.width || img.height > restrictedDim.height ) { + if( img.width > restrictedDim.width ) { + error = language.imageTooWide +' '+restrictedDim.width+'px'; + } else { + error = language.imageTooTall +' '+restrictedDim.height+'px'; + } + error += ' ('+language.max+' '+restrictedDim.width+'x'+restrictedDim.height+'px)'; + } + } + + return error; + }; + + /** + * Attach ratio validation onto formUtils only for unit testing purpose + * @param {HTMLImageElement} img + * @param {String} dimDeclaration + * @param {Boolean|String} Returns error message if image was invalid, false otherwise + */ + $.formUtils.checkImageRatio = function(img, ratioDeclaration, language) { + var ratio = img.width / img.height, + calculateRatio = function(declaration) { + var dims = declaration.replace('max', '').replace('min', '').split(':'); + return dims[0] / dims[1]; + }, + declarationParts = ratioDeclaration.split('-'), + isWithin = function(val, min, max) { + return val >= min && val <= max; + }; + + if ( declarationParts.length === 1 ) { + if ( ratio !== calculateRatio(declarationParts[0]) ) { + return language.imageRatioNotAccepted; + } + } + else if( declarationParts.length === 2 && !isWithin(ratio, calculateRatio(declarationParts[0]), calculateRatio(declarationParts[1])) ) { + return language.imageRatioNotAccepted; + } + return false; + }; + + /** + * Validate image dimension + */ + $.formUtils.addAsyncValidator({ + name : 'dimension', + validatorFunction : function(done, val, $input, conf, language) { + if (!SUPPORTS_FILE_READER) { + // Unable to do the validation, lacking FileReader support + done(true); + } else { + var file = $input.get(0).files || [], + thisValidator = this; + if ($input.attr('data-validation').indexOf('mime') === -1) { + alert('You should validate file type being jpg, gif or png on input ' + $input[0].name); + done(false); + } else if (file.length > 1) { + alert('Validating image dimensions does not support inputs allowing multiple files'); + done(false); + } else if (file.length === 0) { + done(true); + } else { + _loadImage(file[0], function (img) { + var error = false; + + if ($input.valAttr('dimension')) { + error = $.formUtils.checkImageDimension(img, $input.valAttr('dimension'), language); + } + + if (!error && $input.valAttr('ratio')) { + error = $.formUtils.checkImageRatio(img, $input.valAttr('ratio'), language); + } + + // Set validation result flag on input + if (error) { + thisValidator.errorMessage = language.wrongFileDim + ' ' + $input.valAttr('has-not-valid-dim'); + done(false); + } else { + done(true); + } + + }, function (err) { + throw err; + }); + } + } + }, + errorMessage : '', + errorMessageKey: '' // error message created dynamically + // errorMessageKey: 'wrongFileDim' + }); + + /* + * This event listener will remove error messages for file + * inputs when file changes + */ + $(window).one('validatorsLoaded formValidationSetup', function(evt, $form, conf) { + var $inputs; + if( $form ) { + $inputs = $form.find('input[type="file"]'); + } else { + $inputs = $('input[type="file"]'); + } + $.formUtils.dialogs.removeInputStylingAndMessage($inputs, conf); + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/html5.js b/form-validator/html5.js index 8679c23..f5876d9 100644 --- a/form-validator/html5.js +++ b/form-validator/html5.js @@ -1,9 +1,194 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: html5 + * ------------------------------------------ + * Created by Victor Jonsson * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * The following module will make this jQuery plugin serve as a + * html5 fallback. It makes older browsers support the following + * - validation when type="email" + * - validation when type="url" + * - validation when type="time" + * - validation when type="date" + * - validation when type="number" and max="" min="" + * - validation when pattern="REGEXP" + * - validation when using maxlength + * - Using datalist element for creating suggestions + * - placeholders + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){"use strict";a.formUtils.registerLoadedModule("html5");var b="placeholder"in document.createElement("INPUT"),c="options"in document.createElement("DATALIST"),d=!1,e=function(e){e.each(function(){var e=a(this),f=e.find("input,textarea,select"),g=!1;f.each(function(){var b=[],e=a(this),f=e.attr("required"),h={};switch(f&&b.push("required"),(e.attr("type")||"").toLowerCase()){case"time":b.push("time"),a.formUtils.validators.validate_date||d||(d=!0,a.formUtils.loadModules("date"));break;case"url":b.push("url");break;case"email":b.push("email");break;case"date":b.push("date");break;case"number":b.push("number");var i=e.attr("max"),j=e.attr("min"),k=e.attr("step");j||i?(j||(j="0"),i||(i="9007199254740992"),k||(k="1"),h["data-validation-allowing"]="range["+j+";"+i+"]",0!==j.indexOf("-")&&0!==i.indexOf("-")||(h["data-validation-allowing"]+=",negative"),(j.indexOf(".")>-1||i.indexOf(".")>-1||k.indexOf(".")>-1)&&(h["data-validation-allowing"]+=",float")):h["data-validation-allowing"]+=",float,negative"}if(e.attr("pattern")&&(b.push("custom"),h["data-validation-regexp"]=e.attr("pattern")),e.attr("maxlength")&&(b.push("length"),h["data-validation-length"]="max"+e.attr("maxlength")),!c&&e.attr("list")){var l=[],m=a("#"+e.attr("list"));if(m.find("option").each(function(){l.push(a(this).text())}),0===l.length){var n=a.trim(a("#"+e.attr("list")).text()).split("\n");a.each(n,function(b,c){l.push(a.trim(c))})}m.remove(),a.formUtils.suggest(e,l)}if(b.length){f||(h["data-validation-optional"]="true"),g=!0;var o=(e.attr("data-validation")||"")+" "+b.join(" ");e.attr("data-validation",a.trim(o)),a.each(h,function(a,b){e.attr(a,b)})}}),g&&e.trigger("html5ValidationAttrsFound"),b||f.filter("input[placeholder]").each(function(){this.__defaultValue=this.getAttribute("placeholder"),a(this).bind("focus",function(){this.value===this.__defaultValue&&(this.value="",a(this).removeClass("showing-placeholder"))}).bind("blur",function(){""===a.trim(this.value)&&(this.value=this.__defaultValue,a(this).addClass("showing-placeholder"))})})})};a.formUtils.$win.bind("validatorsLoaded formValidationSetup",function(b,c){c||(c=a("form")),e(c)}),a.formUtils.setupValidationUsingHTML5Attr=e}(a,window)}); \ No newline at end of file +(function ($) { + + 'use strict'; + + $.formUtils.registerLoadedModule('html5'); + + var SUPPORTS_PLACEHOLDER = 'placeholder' in document.createElement('INPUT'), + SUPPORTS_DATALIST = 'options' in document.createElement('DATALIST'), + hasLoadedDateModule = false, + setupValidationUsingHTML5Attr = function ($form) { + + $form.each(function () { + var $f = $(this), + $formInputs = $f.find('input,textarea,select'), + foundHtml5Rule = false; + + $formInputs.each(function () { + var validation = [], + $input = $(this), + isRequired = $input.attr('required'), + attrs = {}; + + if (isRequired) { + validation.push('required'); + } + + switch (($input.attr('type') || '').toLowerCase()) { + case 'time': + validation.push('time'); + if (!$.formUtils.validators.validate_date && !hasLoadedDateModule) { + hasLoadedDateModule = true; + $.formUtils.loadModules('date'); + } + break; + case 'url': + validation.push('url'); + break; + case 'email': + validation.push('email'); + break; + case 'date': + validation.push('date'); + break; + case 'number': + validation.push('number'); + var max = $input.attr('max'), + min = $input.attr('min'), + step = $input.attr('step'); + if (min || max) { + if (!min) { + min = '0'; + } + if (!max) { + max = '9007199254740992'; // js max int + } + if (!step) { + step = '1'; // default value + } + + attrs['data-validation-allowing'] = 'range[' + min + ';' + max + ']'; + if (min.indexOf('-') === 0 || max.indexOf('-') === 0) { + attrs['data-validation-allowing'] += ',negative'; + } + if (min.indexOf('.') > -1 || max.indexOf('.') > -1 || step.indexOf('.') > -1) { + attrs['data-validation-allowing'] += ',float'; + } + } else { + attrs['data-validation-allowing'] += ',float,negative'; + } + break; + } + + if ($input.attr('pattern')) { + validation.push('custom'); + attrs['data-validation-regexp'] = $input.attr('pattern'); + } + if ($input.attr('maxlength')) { + validation.push('length'); + attrs['data-validation-length'] = 'max' + $input.attr('maxlength'); + } + + if (!SUPPORTS_DATALIST && $input.attr('list')) { + var suggestions = [], + $list = $('#' + $input.attr('list')); + + $list.find('option').each(function () { + suggestions.push($(this).text()); + }); + + if (suggestions.length === 0) { + // IE fix + var opts = $.trim($('#' + $input.attr('list')).text()).split('\n'); + $.each(opts, function (i, option) { + suggestions.push($.trim(option)); + }); + } + + $list.remove(); + + $.formUtils.suggest($input, suggestions); + } + + if (validation.length) { + if (!isRequired) { + attrs['data-validation-optional'] = 'true'; + } + + foundHtml5Rule = true; + + var validationRules = ($input.attr('data-validation') || '') + ' ' + validation.join(' '); + $input.attr('data-validation', $.trim(validationRules)); + + $.each(attrs, function (attrName, attrVal) { + $input.attr(attrName, attrVal); + }); + } + }); + + if (foundHtml5Rule) { + $f.trigger('html5ValidationAttrsFound'); + } + + if (!SUPPORTS_PLACEHOLDER) { + $formInputs.filter('input[placeholder]').each(function () { + this.__defaultValue = this.getAttribute('placeholder'); + $(this) + .bind('focus', function () { + if (this.value === this.__defaultValue) { + this.value = ''; + $(this).removeClass('showing-placeholder'); + } + }) + .bind('blur', function () { + if ($.trim(this.value) === '') { + this.value = this.__defaultValue; + $(this).addClass('showing-placeholder'); + } + }); + }); + } + + }); + }; + + $.formUtils.$win.bind('validatorsLoaded formValidationSetup', function (evt, $form) { + if (!$form) { + $form = $('form'); + } + setupValidationUsingHTML5Attr($form); + }); + + // Make this method available outside the module + $.formUtils.setupValidationUsingHTML5Attr = setupValidationUsingHTML5Attr; + +})(jQuery, window); + + +})); diff --git a/form-validator/jquery.form-validator.js b/form-validator/jquery.form-validator.js index dcd33fc..bbd6f71 100644 --- a/form-validator/jquery.form-validator.js +++ b/form-validator/jquery.form-validator.js @@ -565,6 +565,10 @@ * * @return {jQuery} */ $.fn.validateOnEvent = function (language, config) { + if(this.length === 0) { + return; + } + var $elements = this[0].nodeName === 'FORM' ? this.find('*[data-validation-event]') : this; $elements .each(function () { @@ -1358,6 +1362,11 @@ */ validators: {}, + /** + * Available sanitizers + */ + sanitizers: {}, + /** * Events triggered by form validator */ @@ -1384,6 +1393,14 @@ this.validators[name] = validator; }, + /** + * Function for adding a sanitizer + * @param {Object} sanitizer + */ + addSanitizer: function (sanitizer) { + this.sanitizers[sanitizer.name] = sanitizer; + }, + /** * Warn user via the console if available */ diff --git a/form-validator/jquery.form-validator.min.js b/form-validator/jquery.form-validator.min.js index d9d1ff3..bbd6f71 100644 --- a/form-validator/jquery.form-validator.min.js +++ b/form-validator/jquery.form-validator.min.js @@ -1,3 +1,19 @@ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * @@ -6,5 +22,2366 @@ * @author Victor Jonsson, http://victorjonsson.se * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b,c){function d(a,b){this.$form=a,this.$input=b,this.reset(),b.on("change paste",this.reset.bind(this))}var e=function(){return!1},f=null,g={numHalted:0,haltValidation:function(b){this.numHalted++,a.formUtils.haltValidation=!0,b.unbind("submit",e).bind("submit",e).find('*[type="submit"]').addClass("disabled").attr("disabled","disabled")},unHaltValidation:function(b){this.numHalted--,0===this.numHalted&&(a.formUtils.haltValidation=!1,b.unbind("submit",e).find('*[type="submit"]').removeClass("disabled").removeAttr("disabled","disabled"))}};d.prototype.reset=function(){this.haltedFormValidation=!1,this.hasRun=!1,this.isRunning=!1,this.result=c},d.prototype.run=function(a,b){return"keyup"===a?null:this.isRunning?(f=a,this.haltedFormValidation||(g.haltValidation(),this.haltedFormValidation=!0),null):this.hasRun?this.result:(f=a,g.haltValidation(this.$form),this.haltedFormValidation=!0,this.isRunning=!0,this.$input.attr("disabled","disabled").addClass("async-validation"),this.$form.addClass("async-validation"),b(function(a){this.done(a)}.bind(this)),null)},d.prototype.done=function(a){this.result=a,this.hasRun=!0,this.isRunning=!1,this.$input.removeAttr("disabled").removeClass("async-validation"),this.$form.removeClass("async-validation"),this.haltedFormValidation&&(g.unHaltValidation(this.$form),"submit"===f?this.$form.trigger("submit"):this.$input.trigger("validation.revalidate"))},d.loadInstance=function(a,b,c){var e,f=b.get(0);return f.asyncValidators||(f.asyncValidators={}),f.asyncValidators[a]?e=f.asyncValidators[a]:(e=new d(c,b),f.asyncValidators[a]=e),e},a.formUtils=a.extend(a.formUtils||{},{asyncValidation:function(a,b,c){return this.warn("Use of deprecated function $.formUtils.asyncValidation, use $.formUtils.addAsyncValidator() instead"),d.loadInstance(a,b,c)},addAsyncValidator:function(b){var c=a.extend({},b),e=c.validatorFunction;c.async=!0,c.validatorFunction=function(a,b,f,g,h,i){var j=d.loadInstance(this.name,b,h);return j.run(i,function(d){e.apply(c,[d,a,b,f,g,h,i])})},this.addValidator(c)}}),a(b).bind("validatorsLoaded formValidationSetup",function(b,c){c||(c=a("form")),c.find("[data-validation]").each(function(){var b=a(this);b.valAttr("async",!1),a.each(a.split(b.attr("data-validation")),function(c,d){var e=a.formUtils.validators["validate_"+d];e&&e.async&&b.valAttr("async","yes")})})})}(a,window),function(a,b){"use strict";function c(b){b&&"custom"===b.errorMessagePosition&&"function"==typeof b.errorMessageCustom&&(a.formUtils.warn("Use of deprecated function errorMessageCustom, use config.submitErrorMessageCallback instead"),b.submitErrorMessageCallback=function(a,c){b.errorMessageCustom(a,b.language.errorTitle,c,b)})}function d(b){if(b.errorMessagePosition&&"object"==typeof b.errorMessagePosition){a.formUtils.warn("Deprecated use of config parameter errorMessagePosition, use config.submitErrorMessageCallback instead");var c=b.errorMessagePosition;b.errorMessagePosition="top",b.submitErrorMessageCallback=function(){return c}}}function e(b){var c=b.find("[data-validation-if-checked]");c.length&&a.formUtils.warn('Detected use of attribute "data-validation-if-checked" which is deprecated. Use "data-validation-depends-on" provided by module "logic"'),c.on("beforeValidation",function(){var c=a(this),d=c.valAttr("if-checked"),e=a('input[name="'+d+'"]',b),f=e.is(":checked"),g=(a.formUtils.getValue(e)||"").toString(),h=c.valAttr("if-checked-value");(!f||h&&h!==g)&&c.valAttr("skipped",!0)})}function f(b){var c={se:"sv",cz:"cs",dk:"da"};if(b.lang in c){var d=c[b.lang];a.formUtils.warn('Deprecated use of lang code "'+b.lang+'" use "'+d+'" instead'),b.lang=d}}a.fn.validateForm=function(b,c){return a.formUtils.warn("Use of deprecated function $.validateForm, use $.isValid instead"),this.isValid(b,c,!0)},a(window).on("formValidationPluginInit",function(a,b){f(b),c(b),d(b)}).on("validatorsLoaded formValidationSetup",function(b,c){c||(c=a("form")),e(c)})}(a),function(a){"use strict";var b={resolveErrorMessage:function(a,b,c,d,e){var f=d.validationErrorMsgAttribute+"-"+c.replace("validate_",""),g=a.attr(f);return g||(g=a.attr(d.validationErrorMsgAttribute),g||(g="function"!=typeof b.errorMessageKey?e[b.errorMessageKey]:e[b.errorMessageKey(d)],g||(g=b.errorMessage))),g},getParentContainer:function(b){if(b.valAttr("error-msg-container"))return a(b.valAttr("error-msg-container"));var c=b.parent();return"checkbox"===b.attr("type")&&b.closest(".checkbox").length?c=b.closest(".checkbox").parent():"radio"===b.attr("type")&&b.closest(".radio").length&&(c=b.closest(".radio").parent()),c.closest(".input-group").length&&(c=c.closest(".input-group").parent()),c},applyInputErrorStyling:function(a,b){a.addClass(b.errorElementClass).removeClass(b.successElementClass),this.getParentContainer(a).addClass(b.inputParentClassOnError).removeClass(b.inputParentClassOnSuccess),""!==b.borderColorOnError&&a.css("border-color",b.borderColorOnError)},applyInputSuccessStyling:function(a,b){a.addClass(b.successElementClass),this.getParentContainer(a).addClass(b.inputParentClassOnSuccess)},removeInputStylingAndMessage:function(a,c){a.removeClass(c.successElementClass).removeClass(c.errorElementClass).css("border-color","");var d=b.getParentContainer(a);if(d.removeClass(c.inputParentClassOnError).removeClass(c.inputParentClassOnSuccess),"function"==typeof c.inlineErrorMessageCallback){var e=c.inlineErrorMessageCallback(a,!1,c);e&&e.html("")}else d.find("."+c.errorMessageClass).remove()},removeAllMessagesAndStyling:function(c,d){if("function"==typeof d.submitErrorMessageCallback){var e=d.submitErrorMessageCallback(c,!1,d);e&&e.html("")}else c.find("."+d.errorMessageClass+".alert").remove();c.find("."+d.errorElementClass+",."+d.successElementClass).each(function(){b.removeInputStylingAndMessage(a(this),d)})},setInlineMessage:function(b,c,d){this.applyInputErrorStyling(b,d);var e,f=document.getElementById(b.attr("name")+"_err_msg"),g=!1,h=function(d){a.formUtils.$win.trigger("validationErrorDisplay",[b,d]),d.html(c)},i=function(){var f=!1;g.find("."+d.errorMessageClass).each(function(){if(this.inputReferer===b[0])return f=a(this),!1}),f?c?h(f):f.remove():""!==c&&(e=a('
'),h(e),e[0].inputReferer=b[0],g.prepend(e))};if(f)a.formUtils.warn("Using deprecated element reference "+f.id),g=a(f),i();else if("function"==typeof d.inlineErrorMessageCallback){if(g=d.inlineErrorMessageCallback(b,c,d),!g)return;i()}else{var j=this.getParentContainer(b);e=j.find("."+d.errorMessageClass+".help-block"),0===e.length&&(e=a("").addClass("help-block").addClass(d.errorMessageClass),e.appendTo(j)),h(e)}},setMessageInTopOfForm:function(b,c,d,e){var f='
{errorTitle}
    {fields}
',g=!1;if("function"!=typeof d.submitErrorMessageCallback||(g=d.submitErrorMessageCallback(b,c,d))){var h={errorTitle:e.errorTitle,fields:"",errorMessageClass:d.errorMessageClass};a.each(c,function(a,b){h.fields+="
  • "+b+"
  • "}),a.each(h,function(a,b){f=f.replace("{"+a+"}",b)}),g?g.html(f):b.children().eq(0).before(a(f))}}};a.formUtils=a.extend(a.formUtils||{},{dialogs:b})}(a),function(a,b,c){"use strict";var d=0;a.fn.validateOnBlur=function(b,c){var d=this,e=this.find("*[data-validation]");return e.each(function(){var e=a(this);if(e.is("[type=radio]")){var f=d.find('[type=radio][name="'+e.attr("name")+'"]');f.bind("blur.validation",function(){e.validateInputOnBlur(b,c,!0,"blur")}),c.validateCheckboxRadioOnClick&&f.bind("click.validation",function(){e.validateInputOnBlur(b,c,!0,"click")})}}),e.bind("blur.validation",function(){a(this).validateInputOnBlur(b,c,!0,"blur")}),c.validateCheckboxRadioOnClick&&this.find("input[type=checkbox][data-validation],input[type=radio][data-validation]").bind("click.validation",function(){a(this).validateInputOnBlur(b,c,!0,"click")}),this},a.fn.validateOnEvent=function(b,c){var d="FORM"===this[0].nodeName?this.find("*[data-validation-event]"):this;return d.each(function(){var d=a(this),e=d.valAttr("event");e&&d.unbind(e+".validation").bind(e+".validation",function(d){9!==(d||{}).keyCode&&a(this).validateInputOnBlur(b,c,!0,e)})}),this},a.fn.showHelpOnFocus=function(b){return b||(b="data-validation-help"),this.find("textarea,input").each(function(){var c=a(this),e="jquery_form_help_"+ ++d,f=c.attr(b);c.removeClass("has-help-text").unbind("focus.help").unbind("blur.help"),f&&c.addClass("has-help-txt").bind("focus.help",function(){var b=c.parent().find("."+e);0===b.length&&(b=a("").addClass(e).addClass("help").addClass("help-block").text(f).hide(),c.after(b)),b.fadeIn()}).bind("blur.help",function(){a(this).parent().find("."+e).fadeOut("slow")})}),this},a.fn.validate=function(b,c,d){var e=a.extend({},a.formUtils.LANG,d||{});this.each(function(){var d=a(this),f=d.closest("form").get(0)||{},g=f.validationConfig||a.formUtils.defaultConfig();d.one("validation",function(a,c){"function"==typeof b&&b(c,this,a)}),d.validateInputOnBlur(e,a.extend({},g,c||{}),!0)})},a.fn.willPostponeValidation=function(){return(this.valAttr("suggestion-nr")||this.valAttr("postpone")||this.hasClass("hasDatepicker"))&&!b.postponedValidation},a.fn.validateInputOnBlur=function(c,d,e,f){if(a.formUtils.eventType=f,this.willPostponeValidation()){var g=this,h=this.valAttr("postpone")||200;return b.postponedValidation=function(){g.validateInputOnBlur(c,d,e,f),b.postponedValidation=!1},setTimeout(function(){b.postponedValidation&&b.postponedValidation()},h),this}c=a.extend({},a.formUtils.LANG,c||{}),a.formUtils.dialogs.removeInputStylingAndMessage(this,d);var i=this,j=i.closest("form"),k=a.formUtils.validateInput(i,c,d,j,f),l=function(){i.validateInputOnBlur(c,d,!1,"blur.revalidated")};return"blur"===f&&i.unbind("validation.revalidate",l).one("validation.revalidate",l),e&&i.removeKeyUpValidation(),k.shouldChangeDisplay&&(k.isValid?a.formUtils.dialogs.applyInputSuccessStyling(i,d):a.formUtils.dialogs.setInlineMessage(i,k.errorMsg,d)),!k.isValid&&e&&i.validateOnKeyUp(c,d),this},a.fn.validateOnKeyUp=function(b,c){return this.each(function(){var d=a(this);d.valAttr("has-keyup-event")||d.valAttr("has-keyup-event","true").bind("keyup.validation",function(a){9!==a.keyCode&&d.validateInputOnBlur(b,c,!1,"keyup")})}),this},a.fn.removeKeyUpValidation=function(){return this.each(function(){a(this).valAttr("has-keyup-event",!1).unbind("keyup.validation")}),this},a.fn.valAttr=function(a,b){return b===c?this.attr("data-validation-"+a):b===!1||null===b?this.removeAttr("data-validation-"+a):(a=a.length>0?"-"+a:"",this.attr("data-validation"+a,b))},a.fn.isValid=function(b,c,d){if(a.formUtils.isLoadingModules){var e=this;return setTimeout(function(){e.isValid(b,c,d)},200),null}c=a.extend({},a.formUtils.defaultConfig(),c||{}),b=a.extend({},a.formUtils.LANG,b||{}),d=d!==!1,a.formUtils.errorDisplayPreventedWhenHalted&&(delete a.formUtils.errorDisplayPreventedWhenHalted,d=!1);var f=function(b,e){a.inArray(b,h)<0&&h.push(b),i.push(e),e.valAttr("current-error",b),d&&a.formUtils.dialogs.applyInputErrorStyling(e,c)},g=[],h=[],i=[],j=this,k=function(b,d){return"submit"===d||"button"===d||"reset"===d||a.inArray(b,c.ignore||[])>-1};if(d&&a.formUtils.dialogs.removeAllMessagesAndStyling(j,c),j.find("input,textarea,select").filter(':not([type="submit"],[type="button"])').each(function(){var d=a(this),e=d.attr("type"),h="radio"===e||"checkbox"===e,i=d.attr("name");if(!k(i,e)&&(!h||a.inArray(i,g)<0)){h&&g.push(i);var l=a.formUtils.validateInput(d,b,c,j,"submit");l.isValid?l.isValid&&l.shouldChangeDisplay&&(d.valAttr("current-error",!1),a.formUtils.dialogs.applyInputSuccessStyling(d,c)):f(l.errorMsg,d)}}),"function"==typeof c.onValidate){var l=c.onValidate(j);a.isArray(l)?a.each(l,function(a,b){f(b.message,b.element)}):l&&l.element&&l.message&&f(l.message,l.element)}return a.formUtils.isValidatingEntireForm=!1,i.length>0&&d&&("top"===c.errorMessagePosition?a.formUtils.dialogs.setMessageInTopOfForm(j,h,c,b):a.each(i,function(b,d){a.formUtils.dialogs.setInlineMessage(d,d.valAttr("current-error"),c)}),c.scrollToTopOnError&&a.formUtils.$win.scrollTop(j.offset().top-20)),!d&&a.formUtils.haltValidation&&(a.formUtils.errorDisplayPreventedWhenHalted=!0),0===i.length&&!a.formUtils.haltValidation},a.fn.restrictLength=function(b){return new a.formUtils.lengthRestriction(this,b),this},a.fn.addSuggestions=function(b){var c=!1;return this.find("input").each(function(){var d=a(this);c=a.split(d.attr("data-suggestions")),c.length>0&&!d.hasClass("has-suggestions")&&(a.formUtils.suggest(d,c,b),d.addClass("has-suggestions"))}),this}}(a,window),function(a){"use strict";a.formUtils=a.extend(a.formUtils||{},{isLoadingModules:!1,loadedModules:{},registerLoadedModule:function(b){this.loadedModules[a.trim(b).toLowerCase()]=!0},hasLoadedModule:function(b){return a.trim(b).toLowerCase()in this.loadedModules},loadModules:function(b,c,d){if(a.formUtils.isLoadingModules)return void setTimeout(function(){a.formUtils.loadModules(b,c,d)},100);var e=function(b,c){var e=a.split(b),f=e.length,g=function(){f--,0===f&&(a.formUtils.isLoadingModules=!1,"function"==typeof d&&d())};f>0&&(a.formUtils.isLoadingModules=!0);var h="?_="+(new Date).getTime(),i=document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0];a.each(e,function(b,d){if(d=a.trim(d),0===d.length||a.formUtils.hasLoadedModule(d))g();else{var e=c+d+(".js"===d.slice(-3)?"":".js"),f=document.createElement("SCRIPT");"function"==typeof define&&define.amd?require([e+(".dev.js"===e.slice(-7)?h:"")],g):(f.type="text/javascript",f.onload=g,f.src=e+(".dev.js"===e.slice(-7)?h:""),f.onerror=function(){a.formUtils.warn("Unable to load form validation module "+e,!0),g()},f.onreadystatechange=function(){"complete"!==this.readyState&&"loaded"!==this.readyState||(g(),this.onload=null,this.onreadystatechange=null)},i.appendChild(f))}})};if(c)e(b,c);else{var f=function(){var c=!1;return a('script[src*="form-validator"]').each(function(){var a=this.src.split("form-validator")[1].split("node_modules").length>1;if(!a)return c=this.src.substr(0,this.src.lastIndexOf("/"))+"/","/"===c&&(c=""),!1}),c!==!1&&(e(b,c),!0)};f()||a(function(){var a=f();a||"function"==typeof d&&d()})}}})}(a),function(a){"use strict";a.split=function(b,c,d){d=void 0===d||d===!0;var e="[,|"+(d?"\\s":"")+"-]\\s*",f=new RegExp(e,"g");if("function"!=typeof c){if(!b)return[];var g=[];return a.each(b.split(c?c:f),function(b,c){c=a.trim(c),c.length&&g.push(c)}),g}b&&a.each(b.split(f),function(b,d){if(d=a.trim(d),d.length)return c(d,b)})},a.validate=function(b){var c=a.extend(a.formUtils.defaultConfig(),{form:"form",validateOnEvent:!1,validateOnBlur:!0,validateCheckboxRadioOnClick:!0,showHelpOnFocus:!0,addSuggestions:!0,modules:"",onModulesLoaded:null,language:!1,onSuccess:!1,onError:!1,onElementValidate:!1});if(b=a.extend(c,b||{}),a(window).trigger("formValidationPluginInit",[b]),b.lang&&"en"!==b.lang){var d="lang/"+b.lang+".js";b.modules+=b.modules.length?","+d:d}a(b.form).each(function(c,d){d.validationConfig=b;var e=a(d);e.trigger("formValidationSetup",[e,b]),e.find(".has-help-txt").unbind("focus.validation").unbind("blur.validation"),e.removeClass("has-validation-callback").unbind("submit.validation").unbind("reset.validation").find("input[data-validation],textarea[data-validation]").unbind("blur.validation"),e.bind("submit.validation",function(c){var d=a(this),e=function(){return c.stopImmediatePropagation(),!1};if(a.formUtils.haltValidation)return e();if(a.formUtils.isLoadingModules)return setTimeout(function(){d.trigger("submit.validation")},200),e();var f=d.isValid(b.language,b);if(a.formUtils.haltValidation)return e();if(!f||"function"!=typeof b.onSuccess)return f||"function"!=typeof b.onError?!!f||e():(b.onError(d),e());var g=b.onSuccess(d);return g===!1?e():void 0}).bind("reset.validation",function(){a.formUtils.dialogs.removeAllMessagesAndStyling(e,b)}).addClass("has-validation-callback"),b.showHelpOnFocus&&e.showHelpOnFocus(),b.addSuggestions&&e.addSuggestions(),b.validateOnBlur&&(e.validateOnBlur(b.language,b),e.bind("html5ValidationAttrsFound",function(){e.validateOnBlur(b.language,b)})),b.validateOnEvent&&e.validateOnEvent(b.language,b)}),""!==b.modules&&a.formUtils.loadModules(b.modules,null,function(){"function"==typeof b.onModulesLoaded&&b.onModulesLoaded();var c="string"==typeof b.form?a(b.form):b.form;a.formUtils.$win.trigger("validatorsLoaded",[c,b])})}}(a),function(a,b){"use strict";var c=a(b);a.formUtils=a.extend(a.formUtils||{},{$win:c,defaultConfig:function(){return{ignore:[],errorElementClass:"error",successElementClass:"valid",borderColorOnError:"#b94a48",errorMessageClass:"form-error",validationRuleAttribute:"data-validation",validationErrorMsgAttribute:"data-validation-error-msg",errorMessagePosition:"inline",errorMessageTemplate:{container:'
    {messages}
    ',messages:"{errorTitle}
      {fields}
    ",field:"
  • {msg}
  • "},scrollToTopOnError:!0,dateFormat:"yyyy-mm-dd",addValidClassOnAll:!1,decimalSeparator:".",inputParentClassOnError:"has-error",inputParentClassOnSuccess:"has-success",validateHiddenInputs:!1,inlineErrorMessageCallback:!1,submitErrorMessageCallback:!1}},validators:{},_events:{load:[],valid:[],invalid:[]},haltValidation:!1,addValidator:function(a){var b=0===a.name.indexOf("validate_")?a.name:"validate_"+a.name;void 0===a.validateOnKeyUp&&(a.validateOnKeyUp=!0),this.validators[b]=a},warn:function(a,c){"console"in b?"function"==typeof b.console.warn?b.console.warn(a):"function"==typeof b.console.log&&b.console.log(a):c&&alert(a)},getValue:function(a,b){var c=b?b.find(a):a;if(c.length>0){var d=c.eq(0).attr("type");return"radio"===d||"checkbox"===d?c.filter(":checked").val()||"":c.val()||""}return!1},validateInput:function(b,c,d,e,f){d=d||a.formUtils.defaultConfig(),c=c||a.formUtils.LANG,e.length||(e=b.parent());var g=this.getValue(b);b.valAttr("skipped",!1).one("beforeValidation",function(){(b.attr("disabled")||!b.is(":visible")&&!d.validateHiddenInputs)&&b.valAttr("skipped",1)}).trigger("beforeValidation",[g,c,d]);var h="true"===b.valAttr("optional"),i=!g&&h,j=b.attr(d.validationRuleAttribute),k=!0,l="",m={isValid:!0,shouldChangeDisplay:!0,errorMsg:""};if(!j||i||b.valAttr("skipped"))return m.shouldChangeDisplay=d.addValidClassOnAll,m;var n=b.valAttr("ignore");return n&&a.each(n.split(""),function(a,b){g=g.replace(new RegExp("\\"+b,"g"),"")}),a.split(j,function(h){0!==h.indexOf("validate_")&&(h="validate_"+h);var i=a.formUtils.validators[h];if(!i)throw new Error('Using undefined validator "'+h+'". Maybe you have forgotten to load the module that "'+h+'" belongs to?');if("validate_checkbox_group"===h&&(b=e.find('[name="'+b.attr("name")+'"]:eq(0)')),("keyup"!==f||i.validateOnKeyUp)&&(k=i.validatorFunction(g,b,d,c,e,f)),!k)return d.validateOnBlur&&b.validateOnKeyUp(c,d),l=a.formUtils.dialogs.resolveErrorMessage(b,i,h,d,c),!1}),k===!1?(b.trigger("validation",!1),m.errorMsg=l,m.isValid=!1,m.shouldChangeDisplay=!0):null===k?m.shouldChangeDisplay=!1:(b.trigger("validation",!0),m.shouldChangeDisplay=!0),"function"==typeof d.onElementValidate&&null!==l&&d.onElementValidate(m.isValid,b,e,l),b.trigger("afterValidation",[m,f]),m},parseDate:function(b,c,d){var e,f,g,h,i=c.replace(/[a-zA-Z]/gi,"").substring(0,1),j="^",k=c.split(i||null);if(a.each(k,function(a,b){j+=(a>0?"\\"+i:"")+"(\\d{"+b.length+"})"}),j+="$",d){var l=[];a.each(b.split(i),function(a,b){1===b.length&&(b="0"+b),l.push(b)}),b=l.join(i)}if(e=b.match(new RegExp(j)),null===e)return!1;var m=function(b,c,d){for(var e=0;e28&&(h%4!==0||h%100===0&&h%400!==0)||2===g&&f>29&&(h%4===0||h%100!==0&&h%400===0)||g>12||0===g)&&(!(this.isShortMonth(g)&&f>30||!this.isShortMonth(g)&&f>31||0===f)&&[h,g,f])},parseDateInt:function(a){return 0===a.indexOf("0")&&(a=a.replace("0","")),parseInt(a,10)},isShortMonth:function(a){return a%2===0&&a<7||a%2!==0&&a>7},lengthRestriction:function(b,c){var d=parseInt(c.text(),10),e=0,f=function(){var a=b.val().length;if(a>d){var f=b.scrollTop();b.val(b.val().substring(0,d)),b.scrollTop(f)}e=d-a,e<0&&(e=0),c.text(e)};a(b).bind("keydown keyup keypress focus blur",f).bind("cut paste",function(){setTimeout(f,100)}),a(document).bind("ready",f)},numericRangeCheck:function(b,c){var d=a.split(c),e=parseInt(c.substr(3),10);return 1===d.length&&c.indexOf("min")===-1&&c.indexOf("max")===-1&&(d=[c,c]),2===d.length&&(bparseInt(d[1],10))?["out",d[0],d[1]]:0===c.indexOf("min")&&be?["max",e]:["ok"]},_numSuggestionElements:0,_selectedSuggestion:null,_previousTypedVal:null,suggest:function(b,d,e){var f={css:{maxHeight:"150px",background:"#FFF",lineHeight:"150%",textDecoration:"underline",overflowX:"hidden",overflowY:"auto",border:"#CCC solid 1px",borderTop:"none",cursor:"pointer"},activeSuggestionCSS:{background:"#E9E9E9"}},g=function(a,b){var c=b.offset();a.css({width:b.outerWidth(),left:c.left+"px",top:c.top+b.outerHeight()+"px"})};e&&a.extend(f,e),f.css.position="absolute",f.css["z-index"]=9999,b.attr("autocomplete","off"),0===this._numSuggestionElements&&c.bind("resize",function(){a(".jquery-form-suggestions").each(function(){var b=a(this),c=b.attr("data-suggest-container");g(b,a(".suggestions-"+c).eq(0))})}),this._numSuggestionElements++;var h=function(b){var c=b.valAttr("suggestion-nr");a.formUtils._selectedSuggestion=null,a.formUtils._previousTypedVal=null,a(".jquery-form-suggestion-"+c).fadeOut("fast")};return b.data("suggestions",d).valAttr("suggestion-nr",this._numSuggestionElements).unbind("focus.suggest").bind("focus.suggest",function(){a(this).trigger("keyup"),a.formUtils._selectedSuggestion=null}).unbind("keyup.suggest").bind("keyup.suggest",function(){var c=a(this),d=[],e=a.trim(c.val()).toLocaleLowerCase();if(e!==a.formUtils._previousTypedVal){a.formUtils._previousTypedVal=e;var i=!1,j=c.valAttr("suggestion-nr"),k=a(".jquery-form-suggestion-"+j);if(k.scrollTop(0),""!==e){var l=e.length>2;a.each(c.data("suggestions"),function(a,b){var c=b.toLocaleLowerCase();return c===e?(d.push(""+b+""),i=!0,!1):void((0===c.indexOf(e)||l&&c.indexOf(e)>-1)&&d.push(b.replace(new RegExp(e,"gi"),"$&")))})}i||0===d.length&&k.length>0?k.hide():d.length>0&&0===k.length?(k=a("
    ").css(f.css).appendTo("body"),b.addClass("suggestions-"+j),k.attr("data-suggest-container",j).addClass("jquery-form-suggestions").addClass("jquery-form-suggestion-"+j)):d.length>0&&!k.is(":visible")&&k.show(),d.length>0&&e.length!==d[0].length&&(g(k,c),k.html(""),a.each(d,function(b,d){a("
    ").append(d).css({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"5px"}).addClass("form-suggest-element").appendTo(k).click(function(){c.focus(),c.val(a(this).text()),c.trigger("change"),h(c)})}))}}).unbind("keydown.validation").bind("keydown.validation",function(b){var c,d,e=b.keyCode?b.keyCode:b.which,g=a(this);if(13===e&&null!==a.formUtils._selectedSuggestion){if(c=g.valAttr("suggestion-nr"),d=a(".jquery-form-suggestion-"+c),d.length>0){var i=d.find("div").eq(a.formUtils._selectedSuggestion).text();g.val(i),g.trigger("change"),h(g),b.preventDefault()}}else{c=g.valAttr("suggestion-nr"),d=a(".jquery-form-suggestion-"+c);var j=d.children();if(j.length>0&&a.inArray(e,[38,40])>-1){38===e?(null===a.formUtils._selectedSuggestion?a.formUtils._selectedSuggestion=j.length-1:a.formUtils._selectedSuggestion--,a.formUtils._selectedSuggestion<0&&(a.formUtils._selectedSuggestion=j.length-1)):40===e&&(null===a.formUtils._selectedSuggestion?a.formUtils._selectedSuggestion=0:a.formUtils._selectedSuggestion++,a.formUtils._selectedSuggestion>j.length-1&&(a.formUtils._selectedSuggestion=0));var k=d.innerHeight(),l=d.scrollTop(),m=d.children().eq(0).outerHeight(),n=m*a.formUtils._selectedSuggestion;return(nl+k)&&d.scrollTop(n),j.removeClass("active-suggestion").css("background","none").eq(a.formUtils._selectedSuggestion).addClass("active-suggestion").css(f.activeSuggestionCSS),b.preventDefault(),!1}}}).unbind("blur.suggest").bind("blur.suggest",function(){h(a(this))}),b},LANG:{errorTitle:"Form submission failed!",requiredField:"This is a required field",requiredFields:"You have not answered all required fields",badTime:"You have not given a correct time",badEmail:"You have not given a correct e-mail address",badTelephone:"You have not given a correct phone number",badSecurityAnswer:"You have not given a correct answer to the security question",badDate:"You have not given a correct date",lengthBadStart:"The input value must be between ",lengthBadEnd:" characters",lengthTooLongStart:"The input value is longer than ",lengthTooShortStart:"The input value is shorter than ",notConfirmed:"Input values could not be confirmed",badDomain:"Incorrect domain value",badUrl:"The input value is not a correct URL",badCustomVal:"The input value is incorrect",andSpaces:" and spaces ",badInt:"The input value was not a correct number",badSecurityNumber:"Your social security number was incorrect",badUKVatAnswer:"Incorrect UK VAT Number",badUKNin:"Incorrect UK NIN",badUKUtr:"Incorrect UK UTR Number",badStrength:"The password isn't strong enough",badNumberOfSelectedOptionsStart:"You have to choose at least ",badNumberOfSelectedOptionsEnd:" answers",badAlphaNumeric:"The input value can only contain alphanumeric characters ",badAlphaNumericExtra:" and ",wrongFileSize:"The file you are trying to upload is too large (max %s)",wrongFileType:"Only files of type %s is allowed",groupCheckedRangeStart:"Please choose between ",groupCheckedTooFewStart:"Please choose at least ",groupCheckedTooManyStart:"Please choose a maximum of ",groupCheckedEnd:" item(s)",badCreditCard:"The credit card number is not correct",badCVV:"The CVV number was not correct",wrongFileDim:"Incorrect image dimensions,",imageTooTall:"the image can not be taller than",imageTooWide:"the image can not be wider than",imageTooSmall:"the image was too small",min:"min",max:"max",imageRatioNotAccepted:"Image ratio is not be accepted",badBrazilTelephoneAnswer:"The phone number entered is invalid",badBrazilCEPAnswer:"The CEP entered is invalid",badBrazilCPFAnswer:"The CPF entered is invalid",badPlPesel:"The PESEL entered is invalid",badPlNip:"The NIP entered is invalid",badPlRegon:"The REGON entered is invalid",badreCaptcha:"Please confirm that you are not a bot",passwordComplexityStart:"Password must contain at least ",passwordComplexitySeparator:", ",passwordComplexityUppercaseInfo:" uppercase letter(s)",passwordComplexityLowercaseInfo:" lowercase letter(s)",passwordComplexitySpecialCharsInfo:" special character(s)",passwordComplexityNumericCharsInfo:" numeric character(s)",passwordComplexityEnd:"."}})}(a,window),function(a){a.formUtils.addValidator({name:"email",validatorFunction:function(b){var c=b.toLowerCase().split("@"),d=c[0],e=c[1];if(d&&e){if(0===d.indexOf('"')){var f=d.length;if(d=d.replace(/\"/g,""),d.length!==f-2)return!1}return a.formUtils.validators.validate_domain.validatorFunction(c[1])&&0!==d.indexOf(".")&&"."!==d.substring(d.length-1,d.length)&&d.indexOf("..")===-1&&!/[^\w\+\.\-\#\-\_\~\!\$\&\'\(\)\*\+\,\;\=\:]/.test(d)}return!1},errorMessage:"",errorMessageKey:"badEmail"}),a.formUtils.addValidator({name:"domain",validatorFunction:function(a){return a.length>0&&a.length<=253&&!/[^a-zA-Z0-9]/.test(a.slice(-2))&&!/[^a-zA-Z0-9]/.test(a.substr(0,1))&&!/[^a-zA-Z0-9\.\-]/.test(a)&&1===a.split("..").length&&a.split(".").length>1},errorMessage:"",errorMessageKey:"badDomain"}),a.formUtils.addValidator({name:"required",validatorFunction:function(b,c,d,e,f){switch(c.attr("type")){case"checkbox":return c.is(":checked");case"radio":return f.find('input[name="'+c.attr("name")+'"]').filter(":checked").length>0;default:return""!==a.trim(b)}},errorMessage:"",errorMessageKey:function(a){return"top"===a.errorMessagePosition||"function"==typeof a.errorMessagePosition?"requiredFields":"requiredField"}}),a.formUtils.addValidator({name:"length",validatorFunction:function(b,c,d,e){var f=c.valAttr("length"),g=c.attr("type");if(void 0===f)return alert('Please add attribute "data-validation-length" to '+c[0].nodeName+" named "+c.attr("name")),!0;var h,i="file"===g&&void 0!==c.get(0).files?c.get(0).files.length:b.length,j=a.formUtils.numericRangeCheck(i,f);switch(j[0]){case"out":this.errorMessage=e.lengthBadStart+f+e.lengthBadEnd,h=!1;break;case"min":this.errorMessage=e.lengthTooShortStart+j[1]+e.lengthBadEnd,h=!1;break;case"max":this.errorMessage=e.lengthTooLongStart+j[1]+e.lengthBadEnd,h=!1;break;default:h=!0}return h},errorMessage:"",errorMessageKey:""}),a.formUtils.addValidator({name:"url",validatorFunction:function(b){var c=/^(https?|ftp):\/\/((((\w|-|\.|~|[\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])(\w|-|\.|~|[\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])(\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|\[|\]|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;if(c.test(b)){var d=b.split("://")[1],e=d.indexOf("/");return e>-1&&(d=d.substr(0,e)),a.formUtils.validators.validate_domain.validatorFunction(d)}return!1},errorMessage:"",errorMessageKey:"badUrl"}),a.formUtils.addValidator({name:"number",validatorFunction:function(a,b,c){if(""!==a){var d,e,f=b.valAttr("allowing")||"",g=b.valAttr("decimal-separator")||c.decimalSeparator,h=!1,i=b.valAttr("step")||"",j=!1,k=b.attr("data-sanitize")||"",l=k.match(/(^|[\s])numberFormat([\s]|$)/i);if(l){if(!window.numeral)throw new ReferenceError("The data-sanitize value numberFormat cannot be used without the numeral library. Please see Data Validation in http://www.formvalidator.net for more information.");a.length&&(a=String(numeral().unformat(a)))}if(f.indexOf("number")===-1&&(f+=",number"),f.indexOf("negative")===-1&&0===a.indexOf("-"))return!1;if(f.indexOf("range")>-1&&(d=parseFloat(f.substring(f.indexOf("[")+1,f.indexOf(";"))),e=parseFloat(f.substring(f.indexOf(";")+1,f.indexOf("]"))),h=!0),""!==i&&(j=!0),","===g){if(a.indexOf(".")>-1)return!1;a=a.replace(",",".")}if(""===a.replace(/[0-9-]/g,"")&&(!h||a>=d&&a<=e)&&(!j||a%i===0))return!0;if(f.indexOf("float")>-1&&null!==a.match(new RegExp("^([0-9-]+)\\.([0-9]+)$"))&&(!h||a>=d&&a<=e)&&(!j||a%i===0))return!0}return!1},errorMessage:"",errorMessageKey:"badInt"}),a.formUtils.addValidator({name:"alphanumeric",validatorFunction:function(b,c,d,e){var f="^([a-zA-Z0-9",g="]+)$",h=c.valAttr("allowing"),i="",j=!1;if(h){i=f+h+g;var k=h.replace(/\\/g,"");k.indexOf(" ")>-1&&(j=!0,k=k.replace(" ",""),k+=e.andSpaces||a.formUtils.LANG.andSpaces),e.badAlphaNumericAndExtraAndSpaces&&e.badAlphaNumericAndExtra?j?this.errorMessage=e.badAlphaNumericAndExtraAndSpaces+k:this.errorMessage=e.badAlphaNumericAndExtra+k+e.badAlphaNumericExtra:this.errorMessage=e.badAlphaNumeric+e.badAlphaNumericExtra+k}else i=f+g,this.errorMessage=e.badAlphaNumeric; -return new RegExp(i).test(b)},errorMessage:"",errorMessageKey:""}),a.formUtils.addValidator({name:"custom",validatorFunction:function(a,b){var c=new RegExp(b.valAttr("regexp"));return c.test(a)},errorMessage:"",errorMessageKey:"badCustomVal"}),a.formUtils.addValidator({name:"date",validatorFunction:function(b,c,d){var e=c.valAttr("format")||d.dateFormat||"yyyy-mm-dd",f="false"===c.valAttr("require-leading-zero");return a.formUtils.parseDate(b,e,f)!==!1},errorMessage:"",errorMessageKey:"badDate"}),a.formUtils.addValidator({name:"checkbox_group",validatorFunction:function(b,c,d,e,f){var g=!0,h=c.attr("name"),i=a('input[type=checkbox][name^="'+h+'"]',f),j=i.filter(":checked").length,k=c.valAttr("qty");if(void 0===k){var l=c.get(0).nodeName;alert('Attribute "data-validation-qty" is missing from '+l+" named "+c.attr("name"))}var m=a.formUtils.numericRangeCheck(j,k);switch(m[0]){case"out":this.errorMessage=e.groupCheckedRangeStart+k+e.groupCheckedEnd,g=!1;break;case"min":this.errorMessage=e.groupCheckedTooFewStart+m[1]+(e.groupCheckedTooFewEnd||e.groupCheckedEnd),g=!1;break;case"max":this.errorMessage=e.groupCheckedTooManyStart+m[1]+(e.groupCheckedTooManyEnd||e.groupCheckedEnd),g=!1;break;default:g=!0}if(!g){var n=function(){i.unbind("click",n),i.filter("*[data-validation]").validateInputOnBlur(e,d,!1,"blur")};i.bind("click",n)}return g}})}(a)}); \ No newline at end of file +/** + */ +(function ($, window, undefined) { + + var disableFormSubmit = function () { + return false; + }, + lastFormEvent = null, + HaltManager = { + numHalted: 0, + haltValidation: function($form) { + this.numHalted++; + $.formUtils.haltValidation = true; + $form + .unbind('submit', disableFormSubmit) + .bind('submit', disableFormSubmit) + .find('*[type="submit"]') + .addClass('disabled') + .attr('disabled', 'disabled'); + }, + unHaltValidation: function($form) { + this.numHalted--; + if (this.numHalted === 0) { + $.formUtils.haltValidation = false; + $form + .unbind('submit', disableFormSubmit) + .find('*[type="submit"]') + .removeClass('disabled') + .removeAttr('disabled', 'disabled'); + } + } + }; + + function AsyncValidation($form, $input) { + this.$form = $form; + this.$input = $input; + this.reset(); + $input.on('change paste', this.reset.bind(this)); + } + + AsyncValidation.prototype.reset = function() { + this.haltedFormValidation = false; + this.hasRun = false; + this.isRunning = false; + this.result = undefined; + }; + + AsyncValidation.prototype.run = function(eventContext, callback) { + if (eventContext === 'keyup') { + return null; + } else if (this.isRunning) { + lastFormEvent = eventContext; + if (!this.haltedFormValidation) { + HaltManager.haltValidation(); + this.haltedFormValidation = true; + } + return null; // Waiting for result + } else if(this.hasRun) { + //this.$input.one('keyup change paste', this.reset.bind(this)); + return this.result; + } else { + lastFormEvent = eventContext; + HaltManager.haltValidation(this.$form); + this.haltedFormValidation = true; + this.isRunning = true; + this.$input + .attr('disabled', 'disabled') + .addClass('async-validation'); + this.$form.addClass('async-validation'); + + callback(function(result) { + this.done(result); + }.bind(this)); + + return null; + } + }; + + AsyncValidation.prototype.done = function(result) { + this.result = result; + this.hasRun = true; + this.isRunning = false; + this.$input + .removeAttr('disabled') + .removeClass('async-validation'); + this.$form.removeClass('async-validation'); + if (this.haltedFormValidation) { + HaltManager.unHaltValidation(this.$form); + if (lastFormEvent === 'submit') { + this.$form.trigger('submit'); + } else { + this.$input.trigger('validation.revalidate'); + } + } + }; + + AsyncValidation.loadInstance = function(validatorName, $input, $form) { + // Return async validator attached to this input element + // or create a new async validator and attach it to the input + var asyncValidation, + input = $input.get(0); + + if (!input.asyncValidators) { + input.asyncValidators = {}; + } + + if (input.asyncValidators[validatorName]) { + asyncValidation = input.asyncValidators[validatorName]; + } else { + asyncValidation = new AsyncValidation($form, $input); + input.asyncValidators[validatorName] = asyncValidation; + } + + return asyncValidation; + }; + + $.formUtils = $.extend($.formUtils || {}, { + + /** + * @deprecated + * @param validatorName + * @param $input + * @param $form + */ + asyncValidation: function(validatorName, $input, $form) { + // @todo: Remove when moving up to version 3.0 + this.warn('Use of deprecated function $.formUtils.asyncValidation, use $.formUtils.addAsyncValidator() instead'); + return AsyncValidation.loadInstance(validatorName, $input, $form); + }, + + /** + * @param {Object} asyncValidator + */ + addAsyncValidator: function (asyncValidator) { + var validator = $.extend({}, asyncValidator), + originalValidatorFunc = validator.validatorFunction; + validator.async = true; + validator.validatorFunction = function (value, $el, config, language, $form, eventContext) { + var asyncValidation = AsyncValidation.loadInstance(this.name, $el, $form); + return asyncValidation.run(eventContext, function(done) { + originalValidatorFunc.apply(validator, [ + done, value, $el, config, language, $form, eventContext + ]); + }); + }; + this.addValidator(validator); + } + }); + + // Tag elements having async validators + $(window).bind('validatorsLoaded formValidationSetup', function (evt, $form) { + if (!$form) { + $form = $('form'); + } + $form.find('[data-validation]').each(function () { + var $input = $(this); + $input.valAttr('async', false); + $.each($.split($input.attr('data-validation')), function (i, validatorName) { + var validator = $.formUtils.validators['validate_'+validatorName]; + if (validator && validator.async) { + $input.valAttr('async', 'yes'); + } + }); + }); + }); + +})(jQuery, window); + +/** + * Deprecated functions and attributes + * @todo: Remove in release of 3.0 + */ +(function ($, undefined) { + + 'use strict'; + + /** + * @deprecated + * @param language + * @param conf + */ + $.fn.validateForm = function (language, conf) { + $.formUtils.warn('Use of deprecated function $.validateForm, use $.isValid instead'); + return this.isValid(language, conf, true); + }; + + $(window) + .on('formValidationPluginInit', function(evt, config) { + convertDeprecatedLangCodeToISO6391(config); + addSupportForCustomErrorMessageCallback(config); + addSupportForElementReferenceInPositionParam(config); + }) + .on('validatorsLoaded formValidationSetup', function(evt, $form) { + if( !$form ) { + $form = $('form'); + } + addSupportForValidationDependingOnCheckedInput($form); + }); + + + function addSupportForCustomErrorMessageCallback(config) { + if (config && + config.errorMessagePosition === 'custom' && + typeof config.errorMessageCustom === 'function') { + + $.formUtils.warn('Use of deprecated function errorMessageCustom, use config.submitErrorMessageCallback instead'); + + config.submitErrorMessageCallback = function($form, errorMessages) { + config.errorMessageCustom( + $form, + config.language.errorTitle, + errorMessages, + config + ); + }; + } + } + + function addSupportForElementReferenceInPositionParam(config) { + if (config.errorMessagePosition && typeof config.errorMessagePosition === 'object') { + $.formUtils.warn('Deprecated use of config parameter errorMessagePosition, use config.submitErrorMessageCallback instead'); + var $errorMessageContainer = config.errorMessagePosition; + config.errorMessagePosition = 'top'; + config.submitErrorMessageCallback = function() { + return $errorMessageContainer; + }; + } + } + + function addSupportForValidationDependingOnCheckedInput($form) { + var $inputsDependingOnCheckedInputs = $form.find('[data-validation-if-checked]'); + if ($inputsDependingOnCheckedInputs.length) { + $.formUtils.warn( + 'Detected use of attribute "data-validation-if-checked" which is '+ + 'deprecated. Use "data-validation-depends-on" provided by module "logic"' + ); + } + + $inputsDependingOnCheckedInputs + .on('beforeValidation', function() { + + var $elem = $(this), + nameOfDependingInput = $elem.valAttr('if-checked'); + + // Set the boolean telling us that the validation depends + // on another input being checked + var $dependingInput = $('input[name="' + nameOfDependingInput + '"]', $form), + dependingInputIsChecked = $dependingInput.is(':checked'), + valueOfDependingInput = ($.formUtils.getValue($dependingInput) || '').toString(), + requiredValueOfDependingInput = $elem.valAttr('if-checked-value'); + + if (!dependingInputIsChecked || !( + !requiredValueOfDependingInput || + requiredValueOfDependingInput === valueOfDependingInput + )) { + $elem.valAttr('skipped', true); + } + + }); + } + + function convertDeprecatedLangCodeToISO6391(config) { + var deprecatedLangCodes = { + se: 'sv', + cz: 'cs', + dk: 'da' + }; + + if (config.lang in deprecatedLangCodes) { + var newLangCode = deprecatedLangCodes[config.lang]; + $.formUtils.warn( + 'Deprecated use of lang code "'+config.lang+'" use "'+newLangCode+'" instead' + ); + config.lang = newLangCode; + } + } + +})(jQuery); + +/** + * Utility methods used for displaying error messages (attached to $.formUtils) + */ +(function ($) { + + 'use strict'; + + var dialogs = { + + resolveErrorMessage: function($elem, validator, validatorName, conf, language) { + var errorMsgAttr = conf.validationErrorMsgAttribute + '-' + validatorName.replace('validate_', ''), + validationErrorMsg = $elem.attr(errorMsgAttr); + + if (!validationErrorMsg) { + validationErrorMsg = $elem.attr(conf.validationErrorMsgAttribute); + if (!validationErrorMsg) { + if (typeof validator.errorMessageKey !== 'function') { + validationErrorMsg = language[validator.errorMessageKey]; + } + else { + validationErrorMsg = language[validator.errorMessageKey(conf)]; + } + if (!validationErrorMsg) { + validationErrorMsg = validator.errorMessage; + } + } + } + return validationErrorMsg; + }, + getParentContainer: function ($elem) { + if ($elem.valAttr('error-msg-container')) { + return $($elem.valAttr('error-msg-container')); + } else { + var $parent = $elem.parent(); + if($elem.attr('type') === 'checkbox' && $elem.closest('.checkbox').length) { + $parent = $elem.closest('.checkbox').parent(); + } else if($elem.attr('type') === 'radio' && $elem.closest('.radio').length) { + $parent = $elem.closest('.radio').parent(); + } + if($parent.closest('.input-group').length) { + $parent = $parent.closest('.input-group').parent(); + } + return $parent; + } + }, + applyInputErrorStyling: function ($input, conf) { + $input + .addClass(conf.errorElementClass) + .removeClass(conf.successElementClass); + + this.getParentContainer($input) + .addClass(conf.inputParentClassOnError) + .removeClass(conf.inputParentClassOnSuccess); + + if (conf.borderColorOnError !== '') { + $input.css('border-color', conf.borderColorOnError); + } + }, + applyInputSuccessStyling: function($input, conf) { + $input.addClass(conf.successElementClass); + this.getParentContainer($input) + .addClass(conf.inputParentClassOnSuccess); + }, + removeInputStylingAndMessage: function($input, conf) { + + // Reset input css + $input + .removeClass(conf.successElementClass) + .removeClass(conf.errorElementClass) + .css('border-color', ''); + + var $parentContainer = dialogs.getParentContainer($input); + + // Reset parent css + $parentContainer + .removeClass(conf.inputParentClassOnError) + .removeClass(conf.inputParentClassOnSuccess); + + // Remove possible error message + if (typeof conf.inlineErrorMessageCallback === 'function') { + var $errorMessage = conf.inlineErrorMessageCallback($input, false, conf); + if ($errorMessage) { + $errorMessage.html(''); + } + } else { + $parentContainer + .find('.' + conf.errorMessageClass) + .remove(); + } + + }, + removeAllMessagesAndStyling: function($form, conf) { + + // Remove error messages in top of form + if (typeof conf.submitErrorMessageCallback === 'function') { + var $errorMessagesInTopOfForm = conf.submitErrorMessageCallback($form, false, conf); + if ($errorMessagesInTopOfForm) { + $errorMessagesInTopOfForm.html(''); + } + } else { + $form.find('.' + conf.errorMessageClass + '.alert').remove(); + } + + // Remove input css/messages + $form.find('.' + conf.errorElementClass + ',.' + conf.successElementClass).each(function() { + dialogs.removeInputStylingAndMessage($(this), conf); + }); + }, + setInlineMessage: function ($input, errorMsg, conf) { + + this.applyInputErrorStyling($input, conf); + + var custom = document.getElementById($input.attr('name') + '_err_msg'), + $messageContainer = false, + setErrorMessage = function ($elem) { + $.formUtils.$win.trigger('validationErrorDisplay', [$input, $elem]); + $elem.html(errorMsg); + }, + addErrorToMessageContainer = function() { + var $found = false; + $messageContainer.find('.' + conf.errorMessageClass).each(function () { + if (this.inputReferer === $input[0]) { + $found = $(this); + return false; + } + }); + if ($found) { + if (!errorMsg) { + $found.remove(); + } else { + setErrorMessage($found); + } + } else if(errorMsg !== '') { + $message = $('
    '); + setErrorMessage($message); + $message[0].inputReferer = $input[0]; + $messageContainer.prepend($message); + } + }, + $message; + + if (custom) { + // Todo: remove in 3.0 + $.formUtils.warn('Using deprecated element reference ' + custom.id); + $messageContainer = $(custom); + addErrorToMessageContainer(); + } else if (typeof conf.inlineErrorMessageCallback === 'function') { + $messageContainer = conf.inlineErrorMessageCallback($input, errorMsg, conf); + if (!$messageContainer) { + // Error display taken care of by inlineErrorMessageCallback + return; + } + addErrorToMessageContainer(); + } else { + var $parent = this.getParentContainer($input); + $message = $parent.find('.' + conf.errorMessageClass + '.help-block'); + if ($message.length === 0) { + $message = $('').addClass('help-block').addClass(conf.errorMessageClass); + $message.appendTo($parent); + } + setErrorMessage($message); + } + }, + setMessageInTopOfForm: function ($form, errorMessages, conf, lang) { + var view = '
    '+ + '{errorTitle}'+ + '
      {fields}
    '+ + '
    ', + $container = false; + + if (typeof conf.submitErrorMessageCallback === 'function') { + $container = conf.submitErrorMessageCallback($form, errorMessages, conf); + if (!$container) { + // message display taken care of by callback + return; + } + } + + var viewParams = { + errorTitle: lang.errorTitle, + fields: '', + errorMessageClass: conf.errorMessageClass + }; + + $.each(errorMessages, function (i, msg) { + viewParams.fields += '
  • '+msg+'
  • '; + }); + + $.each(viewParams, function(param, value) { + view = view.replace('{'+param+'}', value); + }); + + if ($container) { + $container.html(view); + } else { + $form.children().eq(0).before($(view)); + } + } + }; + + $.formUtils = $.extend($.formUtils || {}, { + dialogs: dialogs + }); + +})(jQuery); + +/** + * File declaring all methods if this plugin which is applied to $.fn. + */ +(function($, window, undefined) { + + 'use strict'; + + var _helpers = 0; + + + /** + * Assigns validateInputOnBlur function to elements blur event + * + * @param {Object} language Optional, will override $.formUtils.LANG + * @param {Object} conf Optional, will override the default settings + * @return {jQuery} + */ + $.fn.validateOnBlur = function (language, conf) { + var $form = this, + $elems = this.find('*[data-validation]'); + + $elems.each(function(){ + var $this = $(this); + if ($this.is('[type=radio]')){ + var $additionals = $form.find('[type=radio][name="' + $this.attr('name') + '"]'); + $additionals.bind('blur.validation', function(){ + $this.validateInputOnBlur(language, conf, true, 'blur'); + }); + if (conf.validateCheckboxRadioOnClick) { + $additionals.bind('click.validation', function () { + $this.validateInputOnBlur(language, conf, true, 'click'); + }); + } + } + }); + + $elems.bind('blur.validation', function () { + $(this).validateInputOnBlur(language, conf, true, 'blur'); + }); + + if (conf.validateCheckboxRadioOnClick) { + // bind click event to validate on click for radio & checkboxes for nice UX + this.find('input[type=checkbox][data-validation],input[type=radio][data-validation]') + .bind('click.validation', function () { + $(this).validateInputOnBlur(language, conf, true, 'click'); + }); + } + + return this; + }; + + /* + * Assigns validateInputOnBlur function to elements custom event + * @param {Object} language Optional, will override $.formUtils.LANG + * @param {Object} settings Optional, will override the default settings + * * @return {jQuery} + */ + $.fn.validateOnEvent = function (language, config) { + if(this.length === 0) { + return; + } + + var $elements = this[0].nodeName === 'FORM' ? this.find('*[data-validation-event]') : this; + $elements + .each(function () { + var $el = $(this), + etype = $el.valAttr('event'); + if (etype) { + $el + .unbind(etype + '.validation') + .bind(etype + '.validation', function (evt) { + if( (evt || {}).keyCode !== 9 ) { + $(this).validateInputOnBlur(language, config, true, etype); + } + }); + } + }); + return this; + }; + + /** + * fade in help message when input gains focus + * fade out when input loses focus + * + * + * @param {String} attrName - Optional, default is data-help + * @return {jQuery} + */ + $.fn.showHelpOnFocus = function (attrName) { + if (!attrName) { + attrName = 'data-validation-help'; + } + + // Add help text listeners + this.find('textarea,input').each(function () { + var $elem = $(this), + className = 'jquery_form_help_' + (++_helpers), + help = $elem.attr(attrName); + + // Reset + $elem + .removeClass('has-help-text') + .unbind('focus.help') + .unbind('blur.help'); + + if (help) { + $elem + .addClass('has-help-txt') + .bind('focus.help', function () { + var $help = $elem.parent().find('.' + className); + if ($help.length === 0) { + $help = $('') + .addClass(className) + .addClass('help') + .addClass('help-block') // twitter bs + .text(help) + .hide(); + + $elem.after($help); + } + $help.fadeIn(); + }) + .bind('blur.help', function () { + $(this) + .parent() + .find('.' + className) + .fadeOut('slow'); + }); + } + }); + + return this; + }; + + /** + * @param {Function} cb + * @param {Object} [conf] + * @param {Object} [lang] + */ + $.fn.validate = function(cb, conf, lang) { + var language = $.extend({}, $.formUtils.LANG, lang || {}); + this.each(function() { + var $elem = $(this), + closestFormElem = $elem.closest('form').get(0) || {}, + formDefaultConfig = closestFormElem.validationConfig || $.formUtils.defaultConfig(); + + $elem.one('validation', function(evt, isValid) { + if ( typeof cb === 'function' ) { + cb(isValid, this, evt); + } + }); + + $elem.validateInputOnBlur( + language, + $.extend({}, formDefaultConfig, conf || {}), + true + ); + }); + }; + + /** + * Tells whether or not validation of this input will have to postpone the form submit () + * @returns {Boolean} + */ + $.fn.willPostponeValidation = function() { + return (this.valAttr('suggestion-nr') || + this.valAttr('postpone') || + this.hasClass('hasDatepicker')) && + !window.postponedValidation; + }; + + /** + * Validate single input when it loses focus + * shows error message in a span element + * that is appended to the parent element + * + * @param {Object} [language] Optional, will override $.formUtils.LANG + * @param {Object} [conf] Optional, will override the default settings + * @param {Boolean} attachKeyupEvent Optional + * @param {String} eventContext + * @return {jQuery} + */ + $.fn.validateInputOnBlur = function (language, conf, attachKeyupEvent, eventContext) { + + $.formUtils.eventType = eventContext; + + if ( this.willPostponeValidation() ) { + // This validation has to be postponed + var _self = this, + postponeTime = this.valAttr('postpone') || 200; + + window.postponedValidation = function () { + _self.validateInputOnBlur(language, conf, attachKeyupEvent, eventContext); + window.postponedValidation = false; + }; + + setTimeout(function () { + if (window.postponedValidation) { + window.postponedValidation(); + } + }, postponeTime); + + return this; + } + + language = $.extend({}, $.formUtils.LANG, language || {}); + $.formUtils.dialogs.removeInputStylingAndMessage(this, conf); + + var $elem = this, + $form = $elem.closest('form'), + result = $.formUtils.validateInput( + $elem, + language, + conf, + $form, + eventContext + ); + + var reValidate = function() { + $elem.validateInputOnBlur(language, conf, false, 'blur.revalidated'); + }; + + if (eventContext === 'blur') { + $elem + .unbind('validation.revalidate', reValidate) + .one('validation.revalidate', reValidate); + } + + if (attachKeyupEvent) { + $elem.removeKeyUpValidation(); + } + + if (result.shouldChangeDisplay) { + if (result.isValid) { + $.formUtils.dialogs.applyInputSuccessStyling($elem, conf); + } else { + $.formUtils.dialogs.setInlineMessage($elem, result.errorMsg, conf); + } + } + + if (!result.isValid && attachKeyupEvent) { + $elem.validateOnKeyUp(language, conf); + } + + return this; + }; + + /** + * Validate element on keyup-event + */ + $.fn.validateOnKeyUp = function(language, conf) { + this.each(function() { + var $input = $(this); + if (!$input.valAttr('has-keyup-event')) { + $input + .valAttr('has-keyup-event', 'true') + .bind('keyup.validation', function (evt) { + if( evt.keyCode !== 9 ) { + $input.validateInputOnBlur(language, conf, false, 'keyup'); + } + }); + } + }); + return this; + }; + + /** + * Remove validation on keyup + */ + $.fn.removeKeyUpValidation = function() { + this.each(function() { + $(this) + .valAttr('has-keyup-event', false) + .unbind('keyup.validation'); + }); + return this; + }; + + /** + * Short hand for fetching/adding/removing element attributes + * prefixed with 'data-validation-' + * + * @param {String} name + * @param {String|Boolean} [val] + * @return {String|undefined|jQuery} + * @protected + */ + $.fn.valAttr = function (name, val) { + if (val === undefined) { + return this.attr('data-validation-' + name); + } else if (val === false || val === null) { + return this.removeAttr('data-validation-' + name); + } else { + name = ((name.length > 0) ? '-' + name : ''); + return this.attr('data-validation' + name, val); + } + }; + + /** + * Function that validates all inputs in active form + * + * @param {Object} [language] + * @param {Object} [conf] + * @param {Boolean} [displayError] Defaults to true + */ + $.fn.isValid = function (language, conf, displayError) { + + if ($.formUtils.isLoadingModules) { + var $self = this; + setTimeout(function () { + $self.isValid(language, conf, displayError); + }, 200); + return null; + } + + conf = $.extend({}, $.formUtils.defaultConfig(), conf || {}); + language = $.extend({}, $.formUtils.LANG, language || {}); + displayError = displayError !== false; + + if ($.formUtils.errorDisplayPreventedWhenHalted) { + // isValid() was called programmatically with argument displayError set + // to false when the validation was halted by any of the validators + delete $.formUtils.errorDisplayPreventedWhenHalted; + displayError = false; + } + + /** + * Adds message to error message stack if not already in the message stack + * + * @param {String} mess + * @para {jQuery} $elem + */ + var addErrorMessage = function (mess, $elem) { + if ($.inArray(mess, errorMessages) < 0) { + errorMessages.push(mess); + } + errorInputs.push($elem); + $elem.valAttr('current-error', mess); + if (displayError) { + $.formUtils.dialogs.applyInputErrorStyling($elem, conf); + } + }, + + /** Holds inputs (of type checkox or radio) already validated, to prevent recheck of mulitple checkboxes & radios */ + checkedInputs = [], + + /** Error messages for this validation */ + errorMessages = [], + + /** Input elements which value was not valid */ + errorInputs = [], + + /** Form instance */ + $form = this, + + /** + * Tells whether or not to validate element with this name and of this type + * + * @param {String} name + * @param {String} type + * @return {Boolean} + */ + ignoreInput = function (name, type) { + if (type === 'submit' || type === 'button' || type === 'reset') { + return true; + } + return $.inArray(name, conf.ignore || []) > -1; + }; + + // Reset style and remove error class + if (displayError) { + $.formUtils.dialogs.removeAllMessagesAndStyling($form, conf); + } + + // Validate element values + $form.find('input,textarea,select').filter(':not([type="submit"],[type="button"])').each(function () { + var $elem = $(this), + elementType = $elem.attr('type'), + isCheckboxOrRadioBtn = elementType === 'radio' || elementType === 'checkbox', + elementName = $elem.attr('name'); + + if (!ignoreInput(elementName, elementType) && (!isCheckboxOrRadioBtn || $.inArray(elementName, checkedInputs) < 0)) { + + if (isCheckboxOrRadioBtn) { + checkedInputs.push(elementName); + } + + var result = $.formUtils.validateInput( + $elem, + language, + conf, + $form, + 'submit' + ); + + if (!result.isValid) { + addErrorMessage(result.errorMsg, $elem); + } else if (result.isValid && result.shouldChangeDisplay) { + $elem.valAttr('current-error', false); + $.formUtils.dialogs.applyInputSuccessStyling($elem, conf); + } + } + + }); + + // Run validation callback + if (typeof conf.onValidate === 'function') { + var errors = conf.onValidate($form); + if ($.isArray(errors)) { + $.each(errors, function (i, err) { + addErrorMessage(err.message, err.element); + }); + } + else if (errors && errors.element && errors.message) { + addErrorMessage(errors.message, errors.element); + } + } + + // Reset form validation flag + $.formUtils.isValidatingEntireForm = false; + + // Validation failed + if (errorInputs.length > 0) { + if (displayError) { + if (conf.errorMessagePosition === 'top') { + $.formUtils.dialogs.setMessageInTopOfForm($form, errorMessages, conf, language); + } else { + $.each(errorInputs, function (i, $input) { + $.formUtils.dialogs.setInlineMessage($input, $input.valAttr('current-error'), conf); + }); + } + if (conf.scrollToTopOnError) { + $.formUtils.$win.scrollTop($form.offset().top - 20); + } + } + } + + if (!displayError && $.formUtils.haltValidation) { + $.formUtils.errorDisplayPreventedWhenHalted = true; + } + + return errorInputs.length === 0 && !$.formUtils.haltValidation; + }; + + /** + * Plugin for displaying input length restriction + */ + $.fn.restrictLength = function (maxLengthElement) { + new $.formUtils.lengthRestriction(this, maxLengthElement); + return this; + }; + + /** + * Add suggestion dropdown to inputs having data-suggestions with a comma + * separated string with suggestions + * @param {Array} [settings] + * @returns {jQuery} + */ + $.fn.addSuggestions = function (settings) { + var sugs = false; + this.find('input').each(function () { + var $field = $(this); + + sugs = $.split($field.attr('data-suggestions')); + + if (sugs.length > 0 && !$field.hasClass('has-suggestions')) { + $.formUtils.suggest($field, sugs, settings); + $field.addClass('has-suggestions'); + } + }); + return this; + }; + + +})(jQuery, window); + +/** + * Utility methods used for handling loading of modules (attached to $.formUtils) + */ +(function($) { + + 'use strict'; + + $.formUtils = $.extend($.formUtils || {}, { + + /** + * @var {Boolean} + */ + isLoadingModules: false, + + /** + * @var {Object} + */ + loadedModules: {}, + + /** + * @param {String} name + */ + registerLoadedModule: function (name) { + this.loadedModules[$.trim(name).toLowerCase()] = true; + }, + + /** + * @param {String} name + * @return {Boolean} + */ + hasLoadedModule: function (name) { + return $.trim(name).toLowerCase() in this.loadedModules; + }, + + /** + * @example + * $.formUtils.loadModules('date, security.dev'); + * + * Will load the scripts date.js and security.dev.js from the + * directory where this script resides. If you want to load + * the modules from another directory you can use the + * path argument. + * + * The script will be cached by the browser unless the module + * name ends with .dev + * + * @param {String} modules - Comma separated string with module file names (no directory nor file extension) + * @param {String} [path] - Path where the module files are located if their not in the same directory as the core modules + * @param {function} [callback] - Callback invoked when all modules are loaded + */ + loadModules: function (modules, path, callback) { + + if ($.formUtils.isLoadingModules) { + setTimeout(function () { + $.formUtils.loadModules(modules, path, callback); + }, 100); + return; + } + + var loadModuleScripts = function (modules, path) { + + var moduleList = $.split(modules), + numModules = moduleList.length, + moduleLoadedCallback = function () { + numModules--; + if (numModules === 0) { + $.formUtils.isLoadingModules = false; + if (typeof callback === 'function') { + callback(); + } + } + }; + + if (numModules > 0) { + $.formUtils.isLoadingModules = true; + } + + var cacheSuffix = '?_=' + ( new Date().getTime() ), + appendToElement = document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]; + + $.each(moduleList, function (i, modName) { + modName = $.trim(modName); + if (modName.length === 0 || $.formUtils.hasLoadedModule(modName)) { + moduleLoadedCallback(); + } else { + var scriptUrl = path + modName + (modName.slice(-3) === '.js' ? '' : '.js'), + script = document.createElement('SCRIPT'); + + if (typeof define === 'function' && define.amd) { + require([scriptUrl + ( scriptUrl.slice(-7) === '.dev.js' ? cacheSuffix : '' )], moduleLoadedCallback); + } else { + // Load the script + script.type = 'text/javascript'; + script.onload = moduleLoadedCallback; + script.src = scriptUrl + ( scriptUrl.slice(-7) === '.dev.js' ? cacheSuffix : '' ); + script.onerror = function() { + $.formUtils.warn('Unable to load form validation module '+scriptUrl, true); + moduleLoadedCallback(); + }; + script.onreadystatechange = function () { + // IE 7 fix + if (this.readyState === 'complete' || this.readyState === 'loaded') { + moduleLoadedCallback(); + // Handle memory leak in IE + this.onload = null; + this.onreadystatechange = null; + } + }; + appendToElement.appendChild(script); + } + } + }); + }; + + if (path) { + loadModuleScripts(modules, path); + } else { + var findScriptPathAndLoadModules = function () { + var foundPath = false; + $('script[src*="form-validator"]').each(function () { + var isScriptFromPluginNodeModulesDirectory = this.src.split('form-validator')[1].split('node_modules').length > 1; + if (!isScriptFromPluginNodeModulesDirectory) { + foundPath = this.src.substr(0, this.src.lastIndexOf('/')) + '/'; + if (foundPath === '/') { + foundPath = ''; + } + return false; + } + }); + + if (foundPath !== false) { + loadModuleScripts(modules, foundPath); + return true; + } + return false; + }; + + if (!findScriptPathAndLoadModules()) { + $(function () { + var hasLoadedModuleScripts = findScriptPathAndLoadModules(); + if (!hasLoadedModuleScripts) { + // The modules may have been inserted via a minified script + if (typeof callback === 'function') { + callback(); + } + } + }); + } + } + } + + }); + +})(jQuery); + +/** + * Setup function for the plugin + */ +(function ($) { + + 'use strict'; + + + /** + * A bit smarter split function + * delimiter can be space, comma, dash or pipe + * @param {String} val + * @param {Function|String} [callback] + * @param {Boolean} [allowSpaceAsDelimiter] + * @returns {Array|void} + */ + $.split = function (val, callback, allowSpaceAsDelimiter) { + // default to true + allowSpaceAsDelimiter = allowSpaceAsDelimiter === undefined || allowSpaceAsDelimiter === true; + var pattern = '[,|'+(allowSpaceAsDelimiter ? '\\s':'')+'-]\\s*', + regex = new RegExp(pattern, 'g'); + if (typeof callback !== 'function') { + // return array + if (!val) { + return []; + } + var values = []; + $.each(val.split(callback ? callback : regex), + function (i, str) { + str = $.trim(str); + if (str.length) { + values.push(str); + } + } + ); + return values; + } else if (val) { + // exec callback func on each + $.each(val.split(regex), + function (i, str) { + str = $.trim(str); + if (str.length) { + return callback(str, i); + } + } + ); + } + }; + + /** + * Short hand function that makes the validation setup require less code + * @param conf + */ + $.validate = function (conf) { + + var defaultConf = $.extend($.formUtils.defaultConfig(), { + form: 'form', + validateOnEvent: false, + validateOnBlur: true, + validateCheckboxRadioOnClick: true, + showHelpOnFocus: true, + addSuggestions: true, + modules: '', + onModulesLoaded: null, + language: false, + onSuccess: false, + onError: false, + onElementValidate: false + }); + + conf = $.extend(defaultConf, conf || {}); + + $(window).trigger('formValidationPluginInit', [conf]); + + if( conf.lang && conf.lang !== 'en' ) { + var langModule = 'lang/'+conf.lang+'.js'; + conf.modules += conf.modules.length ? ','+langModule : langModule; + } + + // Add validation to forms + $(conf.form).each(function (i, form) { + + // Make a reference to the config for this form + form.validationConfig = conf; + + // Trigger jQuery event that we're about to setup validation + var $form = $(form); + $form.trigger('formValidationSetup', [$form, conf]); + + // Remove classes and event handlers that might have been + // added by a previous call to $.validate + $form.find('.has-help-txt') + .unbind('focus.validation') + .unbind('blur.validation'); + + $form + .removeClass('has-validation-callback') + .unbind('submit.validation') + .unbind('reset.validation') + .find('input[data-validation],textarea[data-validation]') + .unbind('blur.validation'); + + // Validate when submitted + $form.bind('submit.validation', function (evt) { + + var $form = $(this), + stop = function() { + evt.stopImmediatePropagation(); + return false; + }; + + if ($.formUtils.haltValidation) { + // pressing several times on submit button while validation is halted + return stop(); + } + + if ($.formUtils.isLoadingModules) { + setTimeout(function () { + $form.trigger('submit.validation'); + }, 200); + return stop(); + } + + var valid = $form.isValid(conf.language, conf); + if ($.formUtils.haltValidation) { + // Validation got halted by one of the validators + return stop(); + } else { + if (valid && typeof conf.onSuccess === 'function') { + var callbackResponse = conf.onSuccess($form); + if (callbackResponse === false) { + return stop(); + } + } else if (!valid && typeof conf.onError === 'function') { + conf.onError($form); + return stop(); + } else { + return valid ? true : stop(); + } + } + }) + .bind('reset.validation', function () { + $.formUtils.dialogs.removeAllMessagesAndStyling($form, conf); + }) + .addClass('has-validation-callback'); + + if (conf.showHelpOnFocus) { + $form.showHelpOnFocus(); + } + if (conf.addSuggestions) { + $form.addSuggestions(); + } + if (conf.validateOnBlur) { + $form.validateOnBlur(conf.language, conf); + $form.bind('html5ValidationAttrsFound', function () { + $form.validateOnBlur(conf.language, conf); + }); + } + if (conf.validateOnEvent) { + $form.validateOnEvent(conf.language, conf); + } + }); + + if (conf.modules !== '') { + $.formUtils.loadModules(conf.modules, null, function() { + if (typeof conf.onModulesLoaded === 'function') { + conf.onModulesLoaded(); + } + var $form = typeof conf.form === 'string' ? $(conf.form) : conf.form; + $.formUtils.$win.trigger('validatorsLoaded', [$form, conf]); + }); + } + }; + +})(jQuery); + +/** + * Utility methods and properties attached to $.formUtils + */ +(function($, window) { + + 'use strict'; + + var $win = $(window); + + $.formUtils = $.extend($.formUtils || {}, { + + $win: $win, + + /** + * Default config for $(...).isValid(); + */ + defaultConfig: function () { + return { + ignore: [], // Names of inputs not to be validated even though `validationRuleAttribute` containing the validation rules tells us to + errorElementClass: 'error', // Class that will be put on elements which value is invalid + successElementClass: 'valid', // Class that will be put on elements that has been validated with success + borderColorOnError: '#b94a48', // Border color of elements which value is invalid, empty string to not change border color + errorMessageClass: 'form-error', // class name of div containing error messages when validation fails + validationRuleAttribute: 'data-validation', // name of the attribute holding the validation rules + validationErrorMsgAttribute: 'data-validation-error-msg', // define custom err msg inline with element + errorMessagePosition: 'inline', // Can be either "top" or "inline" + errorMessageTemplate: { + container: '
    {messages}
    ', + messages: '{errorTitle}
      {fields}
    ', + field: '
  • {msg}
  • ' + }, + scrollToTopOnError: true, + dateFormat: 'yyyy-mm-dd', + addValidClassOnAll: false, // whether or not to apply class="valid" even if the input wasn't validated + decimalSeparator: '.', + inputParentClassOnError: 'has-error', // twitter-bootstrap default class name + inputParentClassOnSuccess: 'has-success', // twitter-bootstrap default class name + validateHiddenInputs: false, // whether or not hidden inputs should be validated + inlineErrorMessageCallback: false, + submitErrorMessageCallback: false + }; + }, + + /** + * Available validators + */ + validators: {}, + + /** + * Available sanitizers + */ + sanitizers: {}, + + /** + * Events triggered by form validator + */ + _events: {load: [], valid: [], invalid: []}, + + /** + * Setting this property to true during validation will + * stop further validation from taking place and form will + * not be sent + */ + haltValidation: false, + + /** + * Function for adding a validator + * @see $.formUtils.addAsyncValidator (async.js) + * @param {Object} validator + */ + addValidator: function (validator) { + // prefix with "validate_" for backward compatibility reasons + var name = validator.name.indexOf('validate_') === 0 ? validator.name : 'validate_' + validator.name; + if (validator.validateOnKeyUp === undefined) { + validator.validateOnKeyUp = true; + } + this.validators[name] = validator; + }, + + /** + * Function for adding a sanitizer + * @param {Object} sanitizer + */ + addSanitizer: function (sanitizer) { + this.sanitizers[sanitizer.name] = sanitizer; + }, + + /** + * Warn user via the console if available + */ + warn: function(msg, fallbackOnAlert) { + if( 'console' in window ) { + if( typeof window.console.warn === 'function' ) { + window.console.warn(msg); + } else if( typeof window.console.log === 'function' ) { + window.console.log(msg); + } + } else if (fallbackOnAlert) { + // This is for some old IE version... + alert(msg); + } + }, + + /** + * Same as input $.fn.val() but also supporting input of typ radio or checkbox + * @example + * + * $.formUtils.getValue('.myRadioButtons', $('#some-form')); + * $.formUtils.getValue($('#some-form').find('.check-boxes')); + * + * @param query + * @param $parent + * @returns {String|Boolean} + */ + getValue: function(query, $parent) { + var $inputs = $parent ? $parent.find(query) : query; + if ($inputs.length > 0 ) { + var type = $inputs.eq(0).attr('type'); + if (type === 'radio' || type === 'checkbox') { + return $inputs.filter(':checked').val() || ''; + } else { + return $inputs.val() || ''; + } + } + return false; + }, + + /** + * Validate the value of given element according to the validation rules + * found in the attribute data-validation. Will return an object representing + * a validation result, having the props shouldChangeDisplay, isValid and errorMsg + * @param {jQuery} $elem + * @param {Object} language ($.formUtils.LANG) + * @param {Object} conf + * @param {jQuery} $form + * @param {String} [eventContext] + * @return {Object} + */ + validateInput: function ($elem, language, conf, $form, eventContext) { + + conf = conf || $.formUtils.defaultConfig(); + language = language || $.formUtils.LANG; + + if (!$form.length) { + $form = $elem.parent(); + } + + var value = this.getValue($elem); + + $elem + .valAttr('skipped', false) + .one('beforeValidation', function() { + // Skip input because its hidden or disabled + // Doing this in a callback makes it possible for others to prevent the default + // behaviour by binding to the same event and call evt.stopImmediatePropagation() + if ($elem.attr('disabled') || (!$elem.is(':visible') && !conf.validateHiddenInputs)) { + $elem.valAttr('skipped', 1); + } + }) + .trigger('beforeValidation', [value, language, conf]); + + var inputIsOptional = $elem.valAttr('optional') === 'true', + skipBecauseItsEmpty = !value && inputIsOptional, + validationRules = $elem.attr(conf.validationRuleAttribute), + isValid = true, + errorMsg = '', + result = {isValid: true, shouldChangeDisplay:true, errorMsg:''}; + + // For input type="number", browsers attempt to parse the entered value into a number. + // If the input is not numeric, browsers handle the situation differently: + // Chrome 48 simply disallows non-numeric input; FF 44 clears out the input box on blur; + // Safari 5 parses the entered string to find a leading number. + // If the input fails browser validation, the browser sets the input value equal to an empty string. + // Therefore, we cannot distinguish (apart from hacks) between an empty input type="text" and one with a + // value that can't be parsed by the browser. + + if (!validationRules || skipBecauseItsEmpty || $elem.valAttr('skipped')) { + result.shouldChangeDisplay = conf.addValidClassOnAll; + return result; + } + + // Filter out specified characters + var ignore = $elem.valAttr('ignore'); + if (ignore) { + $.each(ignore.split(''), function(i, character) { + value = value.replace(new RegExp('\\'+character, 'g'), ''); + }); + } + + $.split(validationRules, function (rule) { + + if (rule.indexOf('validate_') !== 0) { + rule = 'validate_' + rule; + } + + var validator = $.formUtils.validators[rule]; + + if (validator) { + + // special change of element for checkbox_group rule + if (rule === 'validate_checkbox_group') { + // set element to first in group, so error msg attr doesn't need to be set on all elements in group + $elem = $form.find('[name="' + $elem.attr('name') + '"]:eq(0)'); + } + + if (eventContext !== 'keyup' || validator.validateOnKeyUp) { + // A validator can prevent itself from getting triggered on keyup + isValid = validator.validatorFunction(value, $elem, conf, language, $form, eventContext); + } + + if (!isValid) { + if (conf.validateOnBlur) { + $elem.validateOnKeyUp(language, conf); + } + errorMsg = $.formUtils.dialogs.resolveErrorMessage($elem, validator, rule, conf, language); + return false; // break iteration + } + + } else { + + // todo: Add some validator lookup function and tell immediately which module is missing + throw new Error('Using undefined validator "' + rule + + '". Maybe you have forgotten to load the module that "' + rule +'" belongs to?'); + + } + + }); + + + if (isValid === false) { + $elem.trigger('validation', false); + result.errorMsg = errorMsg; + result.isValid = false; + result.shouldChangeDisplay = true; + } else if (isValid === null) { + // A validatorFunction returning null means that it's not able to validate + // the input at this time. Most probably some async stuff need to gets finished + // first and then the validator will re-trigger the validation. + result.shouldChangeDisplay = false; + } else { + $elem.trigger('validation', true); + result.shouldChangeDisplay = true; + } + + // Run element validation callback + if (typeof conf.onElementValidate === 'function' && errorMsg !== null) { + conf.onElementValidate(result.isValid, $elem, $form, errorMsg); + } + + $elem.trigger('afterValidation', [result, eventContext]); + + return result; + }, + + /** + * Is it a correct date according to given dateFormat. Will return false if not, otherwise + * an array 0=>year 1=>month 2=>day + * + * @param {String} val + * @param {String} dateFormat + * @param {Boolean} [addMissingLeadingZeros] + * @return {Array}|{Boolean} + */ + parseDate: function (val, dateFormat, addMissingLeadingZeros) { + var divider = dateFormat.replace(/[a-zA-Z]/gi, '').substring(0, 1), + regexp = '^', + formatParts = dateFormat.split(divider || null), + matches, day, month, year; + + $.each(formatParts, function (i, part) { + regexp += (i > 0 ? '\\' + divider : '') + '(\\d{' + part.length + '})'; + }); + + regexp += '$'; + + if (addMissingLeadingZeros) { + var newValueParts = []; + $.each(val.split(divider), function(i, part) { + if(part.length === 1) { + part = '0'+part; + } + newValueParts.push(part); + }); + val = newValueParts.join(divider); + } + + matches = val.match(new RegExp(regexp)); + if (matches === null) { + return false; + } + + var findDateUnit = function (unit, formatParts, matches) { + for (var i = 0; i < formatParts.length; i++) { + if (formatParts[i].substring(0, 1) === unit) { + return $.formUtils.parseDateInt(matches[i + 1]); + } + } + return -1; + }; + + month = findDateUnit('m', formatParts, matches); + day = findDateUnit('d', formatParts, matches); + year = findDateUnit('y', formatParts, matches); + + if ((month === 2 && day > 28 && (year % 4 !== 0 || year % 100 === 0 && year % 400 !== 0)) || + (month === 2 && day > 29 && (year % 4 === 0 || year % 100 !== 0 && year % 400 === 0)) || + month > 12 || month === 0) { + return false; + } + if ((this.isShortMonth(month) && day > 30) || (!this.isShortMonth(month) && day > 31) || day === 0) { + return false; + } + + return [year, month, day]; + }, + + /** + * skum fix. är talet 05 eller lägre ger parseInt rätt int annars får man 0 när man kör parseInt? + * + * @param {String} val + * @return {Number} + */ + parseDateInt: function (val) { + if (val.indexOf('0') === 0) { + val = val.replace('0', ''); + } + return parseInt(val, 10); + }, + + /** + * Has month only 30 days? + * + * @param {Number} m + * @return {Boolean} + */ + isShortMonth: function (m) { + return (m % 2 === 0 && m < 7) || (m % 2 !== 0 && m > 7); + }, + + /** + * Restrict input length + * + * @param {jQuery} $inputElement Jquery Html object + * @param {jQuery} $maxLengthElement jQuery Html Object + * @return void + */ + lengthRestriction: function ($inputElement, $maxLengthElement) { + // read maxChars from counter display initial text value + var maxChars = parseInt($maxLengthElement.text(), 10), + charsLeft = 0, + + // internal function does the counting and sets display value + countCharacters = function () { + var numChars = $inputElement.val().length; + if (numChars > maxChars) { + // get current scroll bar position + var currScrollTopPos = $inputElement.scrollTop(); + // trim value to max length + $inputElement.val($inputElement.val().substring(0, maxChars)); + $inputElement.scrollTop(currScrollTopPos); + } + charsLeft = maxChars - numChars; + if (charsLeft < 0) { + charsLeft = 0; + } + + // set counter text + $maxLengthElement.text(charsLeft); + }; + + // bind events to this element + // setTimeout is needed, cut or paste fires before val is available + $($inputElement).bind('keydown keyup keypress focus blur', countCharacters) + .bind('cut paste', function () { + setTimeout(countCharacters, 100); + }); + + // count chars on pageload, if there are prefilled input-values + $(document).bind('ready', countCharacters); + }, + + /** + * Test numeric against allowed range + * + * @param $value int + * @param $rangeAllowed str; (1-2, min1, max2, 10) + * @return array + */ + numericRangeCheck: function (value, rangeAllowed) { + // split by dash + var range = $.split(rangeAllowed), + // min or max + minmax = parseInt(rangeAllowed.substr(3), 10); + + if( range.length === 1 && rangeAllowed.indexOf('min') === -1 && rangeAllowed.indexOf('max') === -1 ) { + range = [rangeAllowed, rangeAllowed]; // only a number, checking agains an exact number of characters + } + + // range ? + if (range.length === 2 && (value < parseInt(range[0], 10) || value > parseInt(range[1], 10) )) { + return [ 'out', range[0], range[1] ]; + } // value is out of range + else if (rangeAllowed.indexOf('min') === 0 && (value < minmax )) // min + { + return ['min', minmax]; + } // value is below min + else if (rangeAllowed.indexOf('max') === 0 && (value > minmax )) // max + { + return ['max', minmax]; + } // value is above max + // since no other returns executed, value is in allowed range + return [ 'ok' ]; + }, + + + _numSuggestionElements: 0, + _selectedSuggestion: null, + _previousTypedVal: null, + + /** + * Utility function that can be used to create plugins that gives + * suggestions when inputs is typed into + * @param {jQuery} $elem + * @param {Array} suggestions + * @param {Object} settings - Optional + * @return {jQuery} + */ + suggest: function ($elem, suggestions, settings) { + var conf = { + css: { + maxHeight: '150px', + background: '#FFF', + lineHeight: '150%', + textDecoration: 'underline', + overflowX: 'hidden', + overflowY: 'auto', + border: '#CCC solid 1px', + borderTop: 'none', + cursor: 'pointer' + }, + activeSuggestionCSS: { + background: '#E9E9E9' + } + }, + setSuggsetionPosition = function ($suggestionContainer, $input) { + var offset = $input.offset(); + $suggestionContainer.css({ + width: $input.outerWidth(), + left: offset.left + 'px', + top: (offset.top + $input.outerHeight()) + 'px' + }); + }; + + if (settings) { + $.extend(conf, settings); + } + + conf.css.position = 'absolute'; + conf.css['z-index'] = 9999; + $elem.attr('autocomplete', 'off'); + + if (this._numSuggestionElements === 0) { + // Re-position suggestion container if window size changes + $win.bind('resize', function () { + $('.jquery-form-suggestions').each(function () { + var $container = $(this), + suggestID = $container.attr('data-suggest-container'); + setSuggsetionPosition($container, $('.suggestions-' + suggestID).eq(0)); + }); + }); + } + + this._numSuggestionElements++; + + var onSelectSuggestion = function ($el) { + var suggestionId = $el.valAttr('suggestion-nr'); + $.formUtils._selectedSuggestion = null; + $.formUtils._previousTypedVal = null; + $('.jquery-form-suggestion-' + suggestionId).fadeOut('fast'); + }; + + $elem + .data('suggestions', suggestions) + .valAttr('suggestion-nr', this._numSuggestionElements) + .unbind('focus.suggest') + .bind('focus.suggest', function () { + $(this).trigger('keyup'); + $.formUtils._selectedSuggestion = null; + }) + .unbind('keyup.suggest') + .bind('keyup.suggest', function () { + var $input = $(this), + foundSuggestions = [], + val = $.trim($input.val()).toLocaleLowerCase(); + + if (val === $.formUtils._previousTypedVal) { + return; + } + else { + $.formUtils._previousTypedVal = val; + } + + var hasTypedSuggestion = false, + suggestionId = $input.valAttr('suggestion-nr'), + $suggestionContainer = $('.jquery-form-suggestion-' + suggestionId); + + $suggestionContainer.scrollTop(0); + + // Find the right suggestions + if (val !== '') { + var findPartial = val.length > 2; + $.each($input.data('suggestions'), function (i, suggestion) { + var lowerCaseVal = suggestion.toLocaleLowerCase(); + if (lowerCaseVal === val) { + foundSuggestions.push('' + suggestion + ''); + hasTypedSuggestion = true; + return false; + } else if (lowerCaseVal.indexOf(val) === 0 || (findPartial && lowerCaseVal.indexOf(val) > -1)) { + foundSuggestions.push(suggestion.replace(new RegExp(val, 'gi'), '$&')); + } + }); + } + + // Hide suggestion container + if (hasTypedSuggestion || (foundSuggestions.length === 0 && $suggestionContainer.length > 0)) { + $suggestionContainer.hide(); + } + + // Create suggestion container if not already exists + else if (foundSuggestions.length > 0 && $suggestionContainer.length === 0) { + $suggestionContainer = $('
    ').css(conf.css).appendTo('body'); + $elem.addClass('suggestions-' + suggestionId); + $suggestionContainer + .attr('data-suggest-container', suggestionId) + .addClass('jquery-form-suggestions') + .addClass('jquery-form-suggestion-' + suggestionId); + } + + // Show hidden container + else if (foundSuggestions.length > 0 && !$suggestionContainer.is(':visible')) { + $suggestionContainer.show(); + } + + // add suggestions + if (foundSuggestions.length > 0 && val.length !== foundSuggestions[0].length) { + + // put container in place every time, just in case + setSuggsetionPosition($suggestionContainer, $input); + + // Add suggestions HTML to container + $suggestionContainer.html(''); + $.each(foundSuggestions, function (i, text) { + $('
    ') + .append(text) + .css({ + overflow: 'hidden', + textOverflow: 'ellipsis', + whiteSpace: 'nowrap', + padding: '5px' + }) + .addClass('form-suggest-element') + .appendTo($suggestionContainer) + .click(function () { + $input.focus(); + $input.val($(this).text()); + $input.trigger('change'); + onSelectSuggestion($input); + }); + }); + } + }) + .unbind('keydown.validation') + .bind('keydown.validation', function (e) { + var code = (e.keyCode ? e.keyCode : e.which), + suggestionId, + $suggestionContainer, + $input = $(this); + + if (code === 13 && $.formUtils._selectedSuggestion !== null) { + suggestionId = $input.valAttr('suggestion-nr'); + $suggestionContainer = $('.jquery-form-suggestion-' + suggestionId); + if ($suggestionContainer.length > 0) { + var newText = $suggestionContainer.find('div').eq($.formUtils._selectedSuggestion).text(); + $input.val(newText); + $input.trigger('change'); + onSelectSuggestion($input); + e.preventDefault(); + } + } + else { + suggestionId = $input.valAttr('suggestion-nr'); + $suggestionContainer = $('.jquery-form-suggestion-' + suggestionId); + var $suggestions = $suggestionContainer.children(); + if ($suggestions.length > 0 && $.inArray(code, [38, 40]) > -1) { + if (code === 38) { // key up + if ($.formUtils._selectedSuggestion === null) { + $.formUtils._selectedSuggestion = $suggestions.length - 1; + } + else{ + $.formUtils._selectedSuggestion--; + } + if ($.formUtils._selectedSuggestion < 0) { + $.formUtils._selectedSuggestion = $suggestions.length - 1; + } + } + else if (code === 40) { // key down + if ($.formUtils._selectedSuggestion === null) { + $.formUtils._selectedSuggestion = 0; + } + else { + $.formUtils._selectedSuggestion++; + } + if ($.formUtils._selectedSuggestion > ($suggestions.length - 1)) { + $.formUtils._selectedSuggestion = 0; + } + } + + // Scroll in suggestion window + var containerInnerHeight = $suggestionContainer.innerHeight(), + containerScrollTop = $suggestionContainer.scrollTop(), + suggestionHeight = $suggestionContainer.children().eq(0).outerHeight(), + activeSuggestionPosY = suggestionHeight * ($.formUtils._selectedSuggestion); + + if (activeSuggestionPosY < containerScrollTop || activeSuggestionPosY > (containerScrollTop + containerInnerHeight)) { + $suggestionContainer.scrollTop(activeSuggestionPosY); + } + + $suggestions + .removeClass('active-suggestion') + .css('background', 'none') + .eq($.formUtils._selectedSuggestion) + .addClass('active-suggestion') + .css(conf.activeSuggestionCSS); + + e.preventDefault(); + return false; + } + } + }) + .unbind('blur.suggest') + .bind('blur.suggest', function () { + onSelectSuggestion($(this)); + }); + + return $elem; + }, + + /** + * Error dialogs + * + * @var {Object} + */ + LANG: { + errorTitle: 'Form submission failed!', + requiredField: 'This is a required field', + requiredFields: 'You have not answered all required fields', + badTime: 'You have not given a correct time', + badEmail: 'You have not given a correct e-mail address', + badTelephone: 'You have not given a correct phone number', + badSecurityAnswer: 'You have not given a correct answer to the security question', + badDate: 'You have not given a correct date', + lengthBadStart: 'The input value must be between ', + lengthBadEnd: ' characters', + lengthTooLongStart: 'The input value is longer than ', + lengthTooShortStart: 'The input value is shorter than ', + notConfirmed: 'Input values could not be confirmed', + badDomain: 'Incorrect domain value', + badUrl: 'The input value is not a correct URL', + badCustomVal: 'The input value is incorrect', + andSpaces: ' and spaces ', + badInt: 'The input value was not a correct number', + badSecurityNumber: 'Your social security number was incorrect', + badUKVatAnswer: 'Incorrect UK VAT Number', + badUKNin: 'Incorrect UK NIN', + badUKUtr: 'Incorrect UK UTR Number', + badStrength: 'The password isn\'t strong enough', + badNumberOfSelectedOptionsStart: 'You have to choose at least ', + badNumberOfSelectedOptionsEnd: ' answers', + badAlphaNumeric: 'The input value can only contain alphanumeric characters ', + badAlphaNumericExtra: ' and ', + wrongFileSize: 'The file you are trying to upload is too large (max %s)', + wrongFileType: 'Only files of type %s is allowed', + groupCheckedRangeStart: 'Please choose between ', + groupCheckedTooFewStart: 'Please choose at least ', + groupCheckedTooManyStart: 'Please choose a maximum of ', + groupCheckedEnd: ' item(s)', + badCreditCard: 'The credit card number is not correct', + badCVV: 'The CVV number was not correct', + wrongFileDim : 'Incorrect image dimensions,', + imageTooTall : 'the image can not be taller than', + imageTooWide : 'the image can not be wider than', + imageTooSmall : 'the image was too small', + min : 'min', + max : 'max', + imageRatioNotAccepted : 'Image ratio is not be accepted', + badBrazilTelephoneAnswer: 'The phone number entered is invalid', + badBrazilCEPAnswer: 'The CEP entered is invalid', + badBrazilCPFAnswer: 'The CPF entered is invalid', + badPlPesel: 'The PESEL entered is invalid', + badPlNip: 'The NIP entered is invalid', + badPlRegon: 'The REGON entered is invalid', + badreCaptcha: 'Please confirm that you are not a bot', + passwordComplexityStart: 'Password must contain at least ', + passwordComplexitySeparator: ', ', + passwordComplexityUppercaseInfo: ' uppercase letter(s)', + passwordComplexityLowercaseInfo: ' lowercase letter(s)', + passwordComplexitySpecialCharsInfo: ' special character(s)', + passwordComplexityNumericCharsInfo: ' numeric character(s)', + passwordComplexityEnd: '.' + } + }); + +})(jQuery, window); + +/** + * File declaring all default validators. + */ +(function($) { + + /* + * Validate email + */ + $.formUtils.addValidator({ + name: 'email', + validatorFunction: function (email) { + + var emailParts = email.toLowerCase().split('@'), + localPart = emailParts[0], + domain = emailParts[1]; + + if (localPart && domain) { + + if( localPart.indexOf('"') === 0 ) { + var len = localPart.length; + localPart = localPart.replace(/\"/g, ''); + if( localPart.length !== (len-2) ) { + return false; // It was not allowed to have more than two apostrophes + } + } + + return $.formUtils.validators.validate_domain.validatorFunction(emailParts[1]) && + localPart.indexOf('.') !== 0 && + localPart.substring(localPart.length-1, localPart.length) !== '.' && + localPart.indexOf('..') === -1 && + !(/[^\w\+\.\-\#\-\_\~\!\$\&\'\(\)\*\+\,\;\=\:]/.test(localPart)); + } + + return false; + }, + errorMessage: '', + errorMessageKey: 'badEmail' + }); + + /* + * Validate domain name + */ + $.formUtils.addValidator({ + name: 'domain', + validatorFunction: function (val) { + return val.length > 0 && + val.length <= 253 && // Including sub domains + !(/[^a-zA-Z0-9]/.test(val.slice(-2))) && !(/[^a-zA-Z0-9]/.test(val.substr(0, 1))) && !(/[^a-zA-Z0-9\.\-]/.test(val)) && + val.split('..').length === 1 && + val.split('.').length > 1; + }, + errorMessage: '', + errorMessageKey: 'badDomain' + }); + + /* + * Validate required + */ + $.formUtils.addValidator({ + name: 'required', + validatorFunction: function (val, $el, config, language, $form) { + switch ($el.attr('type')) { + case 'checkbox': + return $el.is(':checked'); + case 'radio': + return $form.find('input[name="' + $el.attr('name') + '"]').filter(':checked').length > 0; + default: + return $.trim(val) !== ''; + } + }, + errorMessage: '', + errorMessageKey: function(config) { + if (config.errorMessagePosition === 'top' || typeof config.errorMessagePosition === 'function') { + return 'requiredFields'; + } + else { + return 'requiredField'; + } + } + }); + + /* + * Validate length range + */ + $.formUtils.addValidator({ + name: 'length', + validatorFunction: function (val, $el, conf, lang) { + var lengthAllowed = $el.valAttr('length'), + type = $el.attr('type'); + + if (lengthAllowed === undefined) { + alert('Please add attribute "data-validation-length" to ' + $el[0].nodeName + ' named ' + $el.attr('name')); + return true; + } + + // check if length is above min, below max or within range. + var len = type === 'file' && $el.get(0).files !== undefined ? $el.get(0).files.length : val.length, + lengthCheckResults = $.formUtils.numericRangeCheck(len, lengthAllowed), + checkResult; + + switch (lengthCheckResults[0]) { // outside of allowed range + case 'out': + this.errorMessage = lang.lengthBadStart + lengthAllowed + lang.lengthBadEnd; + checkResult = false; + break; + // too short + case 'min': + this.errorMessage = lang.lengthTooShortStart + lengthCheckResults[1] + lang.lengthBadEnd; + checkResult = false; + break; + // too long + case 'max': + this.errorMessage = lang.lengthTooLongStart + lengthCheckResults[1] + lang.lengthBadEnd; + checkResult = false; + break; + // ok + default: + checkResult = true; + } + + return checkResult; + }, + errorMessage: '', + errorMessageKey: '' + }); + + /* + * Validate url + */ + $.formUtils.addValidator({ + name: 'url', + validatorFunction: function (url) { + // written by Scott Gonzalez: http://projects.scottsplayground.com/iri/ + // - Victor Jonsson added support for arrays in the url ?arg[]=sdfsdf + // - General improvements made by Stéphane Moureau + + var urlFilter = /^(https?|ftp):\/\/((((\w|-|\.|~|[\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])(\w|-|\.|~|[\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])(\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|\[|\]|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i; + if (urlFilter.test(url)) { + var domain = url.split('://')[1], + domainSlashPos = domain.indexOf('/'); + + if (domainSlashPos > -1) { + domain = domain.substr(0, domainSlashPos); + } + + return $.formUtils.validators.validate_domain.validatorFunction(domain); // todo: add support for IP-addresses + } + return false; + }, + errorMessage: '', + errorMessageKey: 'badUrl' + }); + + /* + * Validate number (floating or integer) + */ + $.formUtils.addValidator({ + name: 'number', + validatorFunction: function (val, $el, conf) { + if (val !== '') { + var allowing = $el.valAttr('allowing') || '', + decimalSeparator = $el.valAttr('decimal-separator') || conf.decimalSeparator, + allowsRange = false, + begin, end, + steps = $el.valAttr('step') || '', + allowsSteps = false, + sanitize = $el.attr('data-sanitize') || '', + isFormattedWithNumeral = sanitize.match(/(^|[\s])numberFormat([\s]|$)/i); + + if (isFormattedWithNumeral) { + if (!window.numeral) { + throw new ReferenceError('The data-sanitize value numberFormat cannot be used without the numeral' + + ' library. Please see Data Validation in http://www.formvalidator.net for more information.'); + } + //Unformat input first, then convert back to String + if (val.length) { + val = String(numeral().unformat(val)); + } + } + + if (allowing.indexOf('number') === -1) { + allowing += ',number'; + } + + if (allowing.indexOf('negative') === -1 && val.indexOf('-') === 0) { + return false; + } + + if (allowing.indexOf('range') > -1) { + begin = parseFloat(allowing.substring(allowing.indexOf('[') + 1, allowing.indexOf(';'))); + end = parseFloat(allowing.substring(allowing.indexOf(';') + 1, allowing.indexOf(']'))); + allowsRange = true; + } + + if (steps !== '') { + allowsSteps = true; + } + + if (decimalSeparator === ',') { + if (val.indexOf('.') > -1) { + return false; + } + // Fix for checking range with floats using , + val = val.replace(',', '.'); + } + if (val.replace(/[0-9-]/g, '') === '' && (!allowsRange || (val >= begin && val <= end)) && (!allowsSteps || (val % steps === 0))) { + return true; + } + + if (allowing.indexOf('float') > -1 && val.match(new RegExp('^([0-9-]+)\\.([0-9]+)$')) !== null && (!allowsRange || (val >= begin && val <= end)) && (!allowsSteps || (val % steps === 0))) { + return true; + } + } + return false; + }, + errorMessage: '', + errorMessageKey: 'badInt' + }); + + /* + * Validate alpha numeric + */ + $.formUtils.addValidator({ + name: 'alphanumeric', + validatorFunction: function (val, $el, conf, language) { + var patternStart = '^([a-zA-Z0-9', + patternEnd = ']+)$', + additionalChars = $el.valAttr('allowing'), + pattern = '', + hasSpaces = false; + + if (additionalChars) { + pattern = patternStart + additionalChars + patternEnd; + var extra = additionalChars.replace(/\\/g, ''); + if (extra.indexOf(' ') > -1) { + hasSpaces = true; + extra = extra.replace(' ', ''); + extra += language.andSpaces || $.formUtils.LANG.andSpaces; + } + + if(language.badAlphaNumericAndExtraAndSpaces && language.badAlphaNumericAndExtra) { + if(hasSpaces) { + this.errorMessage = language.badAlphaNumericAndExtraAndSpaces + extra; + } else { + this.errorMessage = language.badAlphaNumericAndExtra + extra + language.badAlphaNumericExtra; + } + } else { + this.errorMessage = language.badAlphaNumeric + language.badAlphaNumericExtra + extra; + } + } else { + pattern = patternStart + patternEnd; + this.errorMessage = language.badAlphaNumeric; + } + + return new RegExp(pattern).test(val); + }, + errorMessage: '', + errorMessageKey: '' + }); + + /* + * Validate against regexp + */ + $.formUtils.addValidator({ + name: 'custom', + validatorFunction: function (val, $el) { + var regexp = new RegExp($el.valAttr('regexp')); + return regexp.test(val); + }, + errorMessage: '', + errorMessageKey: 'badCustomVal' + }); + + /* + * Validate date + */ + $.formUtils.addValidator({ + name: 'date', + validatorFunction: function (date, $el, conf) { + var dateFormat = $el.valAttr('format') || conf.dateFormat || 'yyyy-mm-dd', + addMissingLeadingZeros = $el.valAttr('require-leading-zero') === 'false'; + return $.formUtils.parseDate(date, dateFormat, addMissingLeadingZeros) !== false; + }, + errorMessage: '', + errorMessageKey: 'badDate' + }); + + + /* + * Validate group of checkboxes, validate qty required is checked + * written by Steve Wasiura : http://stevewasiura.waztech.com + * element attrs + * data-validation="checkbox_group" + * data-validation-qty="1-2" // min 1 max 2 + * data-validation-error-msg="chose min 1, max of 2 checkboxes" + */ + $.formUtils.addValidator({ + name: 'checkbox_group', + validatorFunction: function (val, $el, conf, lang, $form) { + // preset return var + var isValid = true, + // get name of element. since it is a checkbox group, all checkboxes will have same name + elname = $el.attr('name'), + // get checkboxes and count the checked ones + $checkBoxes = $('input[type=checkbox][name^="' + elname + '"]', $form), + checkedCount = $checkBoxes.filter(':checked').length, + // get el attr that specs qty required / allowed + qtyAllowed = $el.valAttr('qty'); + + if (qtyAllowed === undefined) { + var elementType = $el.get(0).nodeName; + alert('Attribute "data-validation-qty" is missing from ' + elementType + ' named ' + $el.attr('name')); + } + + // call Utility function to check if count is above min, below max, within range etc. + var qtyCheckResults = $.formUtils.numericRangeCheck(checkedCount, qtyAllowed); + + // results will be array, [0]=result str, [1]=qty int + switch (qtyCheckResults[0]) { + // outside allowed range + case 'out': + this.errorMessage = lang.groupCheckedRangeStart + qtyAllowed + lang.groupCheckedEnd; + isValid = false; + break; + // below min qty + case 'min': + this.errorMessage = lang.groupCheckedTooFewStart + qtyCheckResults[1] + (lang.groupCheckedTooFewEnd || lang.groupCheckedEnd); + isValid = false; + break; + // above max qty + case 'max': + this.errorMessage = lang.groupCheckedTooManyStart + qtyCheckResults[1] + (lang.groupCheckedTooManyEnd || lang.groupCheckedEnd); + isValid = false; + break; + // ok + default: + isValid = true; + } + + if( !isValid ) { + var _triggerOnBlur = function() { + $checkBoxes.unbind('click', _triggerOnBlur); + $checkBoxes.filter('*[data-validation]').validateInputOnBlur(lang, conf, false, 'blur'); + }; + $checkBoxes.bind('click', _triggerOnBlur); + } + + return isValid; + } + // errorMessage : '', // set above in switch statement + // errorMessageKey: '' // not used + }); + +})(jQuery); + + +})); diff --git a/form-validator/jsconf.js b/form-validator/jsconf.js index 64b9548..b846e76 100644 --- a/form-validator/jsconf.js +++ b/form-validator/jsconf.js @@ -1,9 +1,75 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: JSconf + * ------------------------------------------ + * Created by Victor Jonsson * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * This module makes it possible to configure form validation using javascript + * + * @website http://formvalidator.net/#location-validators + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){"use strict";a.formUtils.registerLoadedModule("jsconf"),a.setupValidation=function(b){var c=a(b.form||"form");a.each(b.validate||b.validation||{},function(b,d){var e;e="#"===b[0]?a(b):"."===b[0]?c.find(b):c.find('*[name="'+b+'"]'),e.attr("data-validation",d.validation),a.each(d,function(a,b){"validation"!==a&&b!==!1&&(b===!0&&(b="true"),"_"===a[0]?(a=a.substring(1),b===!1?e.removeAttr(a):e.attr(a,b)):e.valAttr(a,b))})}),a.validate(b)}}(a)}); \ No newline at end of file +(function($) { + + 'use strict'; + + $.formUtils.registerLoadedModule('jsconf'); + + $.setupValidation = function(conf) { + var $forms = $(conf.form || 'form'); + $.each(conf.validate || conf.validation || {}, function(elemRef, attr) { + var $elem; + if ( elemRef[0] === '#' ) { + $elem = $(elemRef); + } + else if ( elemRef[0] === '.' ) { + $elem = $forms.find(elemRef); + } + else { + $elem = $forms.find('*[name="' +elemRef+ '"]'); + } + + $elem.attr('data-validation', attr.validation); + + $.each(attr, function(name, val) { + if( name !== 'validation' && val !== false) { + if( val === true ) { + val = 'true'; + } + if( name[0] === '_' ) { + name = name.substring(1); + if( val === false ) { + $elem.removeAttr(name); + } else { + $elem.attr(name, val); + } + } else { + $elem.valAttr(name, val); + } + } + }); + }); + + $.validate(conf); + + }; + +})(jQuery); + + +})); diff --git a/form-validator/lang/ar.js b/form-validator/lang/ar.js index 0916652..bed8259 100644 --- a/form-validator/lang/ar.js +++ b/form-validator/lang/ar.js @@ -1,9 +1,98 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Arabic language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/ar"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"فَشِلَ إرسال النموذج",requiredField:"هذا الحقل مطلوب",requiredFields:"لم يتم ملأ جميع الحقول المطلوبة.",badTime:"حقل الوقت خاطىء",badEmail:"البريد الإلكتروني المدخل خاطئ",badTelephone:"رقم الهاتف المدخل خاطئ",badSecurityAnswer:"لم يتم الإجابة عن سؤال الأمان",badDate:"تاريخ مدخل خاطئ",lengthBadStart:"القيمة المدخلة يجب أن تكون بين ",lengthBadEnd:" حروف",lengthTooLongStart:"القيمة المدخل أطول من ",lengthTooShortStart:"القيمة المدخل أقصر من ",notConfirmed:"لم يتم تأكيد القيمة المدخلة",badDomain:"قيمة نطاق خاطئة",badUrl:"القيمة المدخلة ليست رابطاً صالحاً",badCustomVal:"القيمة المدخلة غير صالحة",andSpaces:" ومسافات ",badInt:"القيمة المدخلة ليست رقماً صحيحاً",badSecurityNumber:"رقم بطاقة الهوية غير صحيح",badUKVatAnswer:"رقم UK VAT غير صحيح",badUKNin:"غير صحيح UK NINرقم ",badUKUtr:"غير صحيح UK UTR رقم",badStrength:"كلمة المرور غير قوية",badNumberOfSelectedOptionsStart:"يجب اختيار على الأقل ",badNumberOfSelectedOptionsEnd:" أجوبة",badAlphaNumeric:"القيمة المدخلة يجب أن تتضمن حروف وأرقام فقط ",badAlphaNumericExtra:" و ",wrongFileSize:"الملف المراد تحميله كبير جداً (الحد المسموج %s)",wrongFileType:"ملفات من نوع %s فقط مسموحة",groupCheckedRangeStart:"من فضلك اختر بين ",groupCheckedTooFewStart:"من فضلك اختر على الأقل ",groupCheckedTooManyStart:"من فضلك اختر بحد أقصى ",groupCheckedEnd:" مرات",badCreditCard:"رقم بطاقة ائتمانية خاطىء",badCVV:"رمز الأمان خاطئ",wrongFileDim:"حدود الصورة غير صالحة",imageTooTall:"الصورة يمكن أن تكون أطول من",imageTooWide:"الصورة يمكن أن تكون أعرض من",imageTooSmall:"صورة صغيرة جداً",min:"أدنى",max:"أقصى",imageRatioNotAccepted:"أبعاد صورة غير مقبولة",badBrazilTelephoneAnswer:"رقم هاتف مدخل خاطىء",badBrazilCEPAnswer:"قيمة CEP المدخلة غير صحيحة",badBrazilCPFAnswer:"قيمة CPF المدخلة غير صحيحة",badPlPesel:"قيمة Pl PESEL المدخلة غير صحيحة",badPlNip:"قيمة Pl NIP المدخلة غير صحيحة",badPlRegon:"قيمة Pl REGON المدخلة غير صحيحة",badreCaptcha:"من فضلك أكد أنك لست روبوتاً",passwordComplexityStart:"كملة المرور تتكون على الأقل من ",passwordComplexitySeparator:", ",passwordComplexityUppercaseInfo:" حروف كبيرة",passwordComplexityLowercaseInfo:" حروف صغيرة",passwordComplexitySpecialCharsInfo:" رموز خاصة",passwordComplexityNumericCharsInfo:" أرقام",passwordComplexityEnd:"."}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/ar'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'فَشِلَ إرسال النموذج', + requiredField: 'هذا الحقل مطلوب', + requiredFields: 'لم يتم ملأ جميع الحقول المطلوبة.', + badTime: 'حقل الوقت خاطىء', + badEmail: 'البريد الإلكتروني المدخل خاطئ', + badTelephone: 'رقم الهاتف المدخل خاطئ', + badSecurityAnswer: 'لم يتم الإجابة عن سؤال الأمان', + badDate: 'تاريخ مدخل خاطئ', + lengthBadStart: 'القيمة المدخلة يجب أن تكون بين ', + lengthBadEnd: ' حروف', + lengthTooLongStart: 'القيمة المدخل أطول من ', + lengthTooShortStart: 'القيمة المدخل أقصر من ', + notConfirmed: 'لم يتم تأكيد القيمة المدخلة', + badDomain: 'قيمة نطاق خاطئة', + badUrl: 'القيمة المدخلة ليست رابطاً صالحاً', + badCustomVal: 'القيمة المدخلة غير صالحة', + andSpaces: ' ومسافات ', + badInt: 'القيمة المدخلة ليست رقماً صحيحاً', + badSecurityNumber: 'رقم بطاقة الهوية غير صحيح', + badUKVatAnswer: 'رقم UK VAT غير صحيح', + badUKNin: 'غير صحيح UK NINرقم ', + badUKUtr: 'غير صحيح UK UTR رقم', + badStrength: 'كلمة المرور غير قوية', + badNumberOfSelectedOptionsStart: 'يجب اختيار على الأقل ', + badNumberOfSelectedOptionsEnd: ' أجوبة', + badAlphaNumeric: 'القيمة المدخلة يجب أن تتضمن حروف وأرقام فقط ', + badAlphaNumericExtra: ' و ', + wrongFileSize: 'الملف المراد تحميله كبير جداً (الحد المسموج %s)', + wrongFileType: 'ملفات من نوع %s فقط مسموحة', + groupCheckedRangeStart: 'من فضلك اختر بين ', + groupCheckedTooFewStart: 'من فضلك اختر على الأقل ', + groupCheckedTooManyStart: 'من فضلك اختر بحد أقصى ', + groupCheckedEnd: ' مرات', + badCreditCard: 'رقم بطاقة ائتمانية خاطىء', + badCVV: 'رمز الأمان خاطئ', + wrongFileDim : 'حدود الصورة غير صالحة', + imageTooTall : 'الصورة يمكن أن تكون أطول من', + imageTooWide : 'الصورة يمكن أن تكون أعرض من', + imageTooSmall : 'صورة صغيرة جداً', + min : 'أدنى', + max : 'أقصى', + imageRatioNotAccepted : 'أبعاد صورة غير مقبولة', + badBrazilTelephoneAnswer: 'رقم هاتف مدخل خاطىء', + badBrazilCEPAnswer: 'قيمة CEP المدخلة غير صحيحة', + badBrazilCPFAnswer: 'قيمة CPF المدخلة غير صحيحة', + badPlPesel: 'قيمة Pl PESEL المدخلة غير صحيحة', + badPlNip: 'قيمة Pl NIP المدخلة غير صحيحة', + badPlRegon: 'قيمة Pl REGON المدخلة غير صحيحة', + badreCaptcha: 'من فضلك أكد أنك لست روبوتاً', + passwordComplexityStart: 'كملة المرور تتكون على الأقل من ', + passwordComplexitySeparator: ', ', + passwordComplexityUppercaseInfo: ' حروف كبيرة', + passwordComplexityLowercaseInfo: ' حروف صغيرة', + passwordComplexitySpecialCharsInfo: ' رموز خاصة', + passwordComplexityNumericCharsInfo: ' أرقام', + passwordComplexityEnd: '.' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/ca.js b/form-validator/lang/ca.js index 4c71299..1ce45a4 100644 --- a/form-validator/lang/ca.js +++ b/form-validator/lang/ca.js @@ -1,9 +1,82 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Catalan language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/ca"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"El formulari no s'ha pogut enviar!",requiredField:"Aquest camp és obligatori",requiredFields:"No ha contestat tots els camps requerits",badTime:"L'hora proporcionada no és vàlida",badEmail:"La direcció d'e-mail no és vàlida",badTelephone:"El número de telèfon proporcionat no és vàlid",badSecurityAnswer:"La resposta a la seva pregunta de seguretat és incorrecte",badDate:"La data proporcionada no és vàlida",lengthBadStart:"La seva resposta s'ha d'incloure entre ",lengthBadEnd:" caràcters",lengthTooLongStart:"La seva resposta ha de ser menor a ",lengthTooShortStart:"La seva resposta ha de ser major a ",notConfirmed:"Els valors proporcionats no poden ser confirmats",badDomain:"Ha introduït un domini incorrecte",badUrl:"La URL proporcionada no és vàlida",badCustomVal:"Els valors proporcionats no són vàlids",andSpaces:" i espais ",badInt:"El valor proporcionat no és un número vàlid",badSecurityNumber:"El número de seguretat social proporcionat és incorrecte",badUKVatAnswer:"El número VAT proporcionat no és vàlid pel Regne Unit",badStrength:"La contrasenya proporcionada no és suficientment segura",badNumberOfSelectedOptionsStart:"Ha de seleccionar almenys",badNumberOfSelectedOptionsEnd:" resposta(es)",badAlphaNumeric:"El valor proporcionat només ha de contenir caràcters alfanumèrics (a-z i números)",badAlphaNumericExtra:" i",wrongFileSize:"L'arxiu que està tractant de pujar és massa gran (màx. %s)",wrongFileType:"Només els arxius de tipus %s estan permesos",groupCheckedRangeStart:"Si us plau, triï entre ",groupCheckedTooFewStart:"Si us plau, triï almenys ",groupCheckedTooManyStart:"Si us plau, triï un màxim de ",groupCheckedEnd:" element(s)",badCreditCard:"El número de targeta de crèdit proporcionat no és vàlid",badCVV:"CVV proporcionat no és vàlid",wrongFileDim:"Les dimensions de la imatge no són vàlides,",imageTooTall:"l'alçada de la imatge no pot ser major a",imageTooWide:"l'amplada de la imatge no pot ser major a",imageTooSmall:"la imatge és massa petita",min:"min.",max:"màx.",imageRatioNotAccepted:"La proporció de la imatge (alçada x amplada) no és vàlida"}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/ca'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'El formulari no s\'ha pogut enviar!', + requiredField: 'Aquest camp és obligatori', + requiredFields: 'No ha contestat tots els camps requerits', + badTime: 'L\'hora proporcionada no és vàlida', + badEmail: 'La direcció d\'e-mail no és vàlida', + badTelephone: 'El número de telèfon proporcionat no és vàlid', + badSecurityAnswer: 'La resposta a la seva pregunta de seguretat és incorrecte', + badDate: 'La data proporcionada no és vàlida', + lengthBadStart: 'La seva resposta s\'ha d\'incloure entre ', + lengthBadEnd: ' caràcters', + lengthTooLongStart: 'La seva resposta ha de ser menor a ', + lengthTooShortStart: 'La seva resposta ha de ser major a ', + notConfirmed: 'Els valors proporcionats no poden ser confirmats', + badDomain: 'Ha introduït un domini incorrecte', + badUrl: 'La URL proporcionada no és vàlida', + badCustomVal: 'Els valors proporcionats no són vàlids', + andSpaces: ' i espais ', + badInt: 'El valor proporcionat no és un número vàlid', + badSecurityNumber: 'El número de seguretat social proporcionat és incorrecte', + badUKVatAnswer: 'El número VAT proporcionat no és vàlid pel Regne Unit', + badStrength: 'La contrasenya proporcionada no és suficientment segura', + badNumberOfSelectedOptionsStart: 'Ha de seleccionar almenys', + badNumberOfSelectedOptionsEnd: ' resposta(es)', + badAlphaNumeric: 'El valor proporcionat només ha de contenir caràcters alfanumèrics (a-z i números)', + badAlphaNumericExtra: ' i', + wrongFileSize: 'L\'arxiu que està tractant de pujar és massa gran (màx. %s)', + wrongFileType: 'Només els arxius de tipus %s estan permesos', + groupCheckedRangeStart: 'Si us plau, triï entre ', + groupCheckedTooFewStart: 'Si us plau, triï almenys ', + groupCheckedTooManyStart: 'Si us plau, triï un màxim de ', + groupCheckedEnd: ' element(s)', + badCreditCard: 'El número de targeta de crèdit proporcionat no és vàlid', + badCVV: 'CVV proporcionat no és vàlid', + wrongFileDim: 'Les dimensions de la imatge no són vàlides,', + imageTooTall: 'l\'alçada de la imatge no pot ser major a', + imageTooWide: 'l\'amplada de la imatge no pot ser major a', + imageTooSmall: 'la imatge és massa petita', + min: 'min.', + max: 'màx.', + imageRatioNotAccepted : 'La proporció de la imatge (alçada x amplada) no és vàlida' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/cs.js b/form-validator/lang/cs.js index 1ba122e..3ff61d8 100644 --- a/form-validator/lang/cs.js +++ b/form-validator/lang/cs.js @@ -1,9 +1,85 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Czech language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/cs"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Podání formuláře selhalo!",requiredField:"Toto pole je povinné",requiredfields:"Nebyly vyplněny všechny požadované pole",badTime:"Neplatný čas",badEmail:"Neplatná e-mailová adresa",badTelephone:"Neplatné telefonní číslo",badSecurityAnswer:"Chybná odpověď na bezpečnostní otázku",badDate:"Nesprávné datum",lengthBadStart:"Zadaná hodnota musí být v rozmezí ",lengthBadEnd:" znaků",lengthTooLongStart:"Zadaná hodnota je větší než ",lengthTooShortStart:"Zadaná hodnota je menší než ",notConfirmed:"Zadané hodnoty nebyly potvrzené",badDomain:"Neplatná doména",badUrl:"Neplatný URL",badCustomVal:"Zadaná hodnota je chybná",andSpaces:" a mezery",badInt:"Neplatné číslo",badSecurityNumber:"Neplatné číslo zabezpečení",badUKVatAnswer:"Neplatné číslo DIČ ",badStrength:"Vaše heslo není dostatečně silné",badNumberOfSelectedOptionsStart:"Musíte vybrat nejméně ",badNumberOfSelectedOptionsEnd:" odpověď",badAlphaNumeric:"Zadaná hodnota může obsahovat pouze alfanumerické znaky ",badAlphaNumericExtra:" a ",wrongFileSize:"Soubor je příliš velký (max %s)",wrongFileType:"Pouze soubory typu %s",groupCheckedRangeStart:"Prosím, vyberte ",groupCheckedTooFewStart:"Vyberte prosím nejméně ",groupCheckedTooManyStart:"Vyberte prosím maximálně ",groupCheckedEnd:" složka(y)",badCreditCard:"Číslo kreditní karty je neplatné",badCVV:"Číslo CVV je neplatné",wrongFileDim:"Nesprávné rozměry obrázku,",imageTooTall:"obraz nemůže být vyšší než",imageTooWide:"obraz nemůže být širší než",imageTooSmall:"obraz je příliš malý",min:"min",max:"max",imageRatioNotAccepted:"Poměr obrázku je nesprávný",badBrazilTelephoneAnswer:"Neplatné telefonní číslo",badBrazilCEPAnswer:"Neplatné CEP",badBrazilCPFAnswer:"Neplatné CPF"}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/cs'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'Podání formuláře selhalo!', + requiredField: 'Toto pole je povinné', + requiredfields: 'Nebyly vyplněny všechny požadované pole', + badTime: 'Neplatný čas', + badEmail: 'Neplatná e-mailová adresa', + badTelephone: 'Neplatné telefonní číslo', + badSecurityAnswer: 'Chybná odpověď na bezpečnostní otázku', + badDate: 'Nesprávné datum', + lengthBadStart: 'Zadaná hodnota musí být v rozmezí ', + lengthBadEnd: ' znaků', + lengthTooLongStart: 'Zadaná hodnota je větší než ', + lengthTooShortStart: 'Zadaná hodnota je menší než ', + notConfirmed: 'Zadané hodnoty nebyly potvrzené', + badDomain: 'Neplatná doména', + badUrl: 'Neplatný URL', + badCustomVal: 'Zadaná hodnota je chybná', + andSpaces: ' a mezery', + badInt: 'Neplatné číslo', + badSecurityNumber: 'Neplatné číslo zabezpečení', + badUKVatAnswer: 'Neplatné číslo DIČ ', + badStrength: 'Vaše heslo není dostatečně silné', + badNumberOfSelectedOptionsStart: 'Musíte vybrat nejméně ', + badNumberOfSelectedOptionsEnd: ' odpověď', + badAlphaNumeric: 'Zadaná hodnota může obsahovat pouze alfanumerické znaky ', + badAlphaNumericExtra: ' a ', + wrongFileSize: 'Soubor je příliš velký (max %s)', + wrongFileType: 'Pouze soubory typu %s', + groupCheckedRangeStart: 'Prosím, vyberte ', + groupCheckedTooFewStart: 'Vyberte prosím nejméně ', + groupCheckedTooManyStart: 'Vyberte prosím maximálně ', + groupCheckedEnd: ' složka(y)', + badCreditCard: 'Číslo kreditní karty je neplatné', + badCVV: 'Číslo CVV je neplatné', + wrongFileDim: 'Nesprávné rozměry obrázku,', + imageTooTall: 'obraz nemůže být vyšší než', + imageTooWide: 'obraz nemůže být širší než', + imageTooSmall: 'obraz je příliš malý', + min: 'min', + max: 'max', + imageRatioNotAccepted: 'Poměr obrázku je nesprávný', + badBrazilTelephoneAnswer: 'Neplatné telefonní číslo', + badBrazilCEPAnswer: 'Neplatné CEP', + badBrazilCPFAnswer: 'Neplatné CPF' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/da.js b/form-validator/lang/da.js index 514b054..f07b170 100644 --- a/form-validator/lang/da.js +++ b/form-validator/lang/da.js @@ -1,9 +1,85 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Danish language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/da"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={andSpaces:" og mellemrum ",badAlphaNumeric:"Det indtastede kan kun indeholde alfanumeriske karakter ",badAlphaNumericExtra:" og ",badCVV:"Det angivne CVV nummer er ugyldigt",badCreditCard:"Det angivne kortnummer er ugyldigt",badCustomVal:"Den indtastede værdi er ugyldig",badDate:"Den angivne dato er ugyldig",badDomain:"Det angivne domæne er ugyldigt",badEmail:"Den angivne email adresse er ugyldig",badInt:"Det angivne tal er ugyldigt",badNumberOfSelectedOptionsEnd:" svar",badNumberOfSelectedOptionsStart:"Du skal vælge mindst ",badSecurityAnswer:"Du har ikke angivet et korrekt svar til sikkerhedsspørgsmålet",badSecurityNumber:"Dit CPR nummer er ikke korrekt",badStrength:"Det angivne password er ikke stærkt nok",badTelephone:"Det angivne telefonnummer er ugyldigt",badTime:"Det angivne tidspunkt er ugyldigt",badUrl:"Den angivne URL er ugyldig",badreCaptcha:"Verificer venligst at du ikke er en bot",errorTitle:"Formular forespørgslen fejlede!",groupCheckedEnd:" ting",groupCheckedRangeStart:"Vælg venligst mellem ",groupCheckedTooFewStart:"Vælg mindst ",groupCheckedTooManyStart:"Vælg højst ",imageRatioNotAccepted:"Billedets dimensioner er ikke acceptable",imageTooSmall:"Billedet er for lille",imageTooTall:"Billedet må ikke være højere end",imageTooWide:"Billedet må ikke være bredere end",lengthBadEnd:" tegn",lengthBadStart:"Feltets værdi skal være mellem ",lengthTooLongStart:"Feltets værdi må ikke være længere end ",lengthTooShortStart:"Feltets værdi må ikke være kortere end ",max:"max",min:"min",notConfirmed:"Feltværdierne kunne ikke bekræftes",requiredField:"Dette felt er påkrævet",requiredFields:"Du har ikke udfyldt alle påkrævede felter",wrongFileDim:"Forkerte billede dimensioner,",wrongFileSize:"Filen du forsøger at uploade er for stor (max %s)",wrongFileType:"Udelukkende filer at følgedne type er tilladt %s"}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/da'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + andSpaces: ' og mellemrum ', + badAlphaNumeric: 'Det indtastede kan kun indeholde alfanumeriske karakter ', + badAlphaNumericExtra: ' og ', + badCVV: 'Det angivne CVV nummer er ugyldigt', + badCreditCard:'Det angivne kortnummer er ugyldigt', + badCustomVal: 'Den indtastede værdi er ugyldig', + badDate: 'Den angivne dato er ugyldig', + badDomain: 'Det angivne domæne er ugyldigt', + badEmail: 'Den angivne email adresse er ugyldig', + badInt: 'Det angivne tal er ugyldigt', + badNumberOfSelectedOptionsEnd: ' svar', + badNumberOfSelectedOptionsStart: 'Du skal vælge mindst ', + badSecurityAnswer: 'Du har ikke angivet et korrekt svar til sikkerhedsspørgsmålet', + badSecurityNumber: 'Dit CPR nummer er ikke korrekt', + badStrength: 'Det angivne password er ikke stærkt nok', + badTelephone: 'Det angivne telefonnummer er ugyldigt', + badTime: 'Det angivne tidspunkt er ugyldigt', + badUrl: 'Den angivne URL er ugyldig', + badreCaptcha: 'Verificer venligst at du ikke er en bot', + errorTitle: 'Formular forespørgslen fejlede!', + groupCheckedEnd: ' ting', + groupCheckedRangeStart: 'Vælg venligst mellem ', + groupCheckedTooFewStart: 'Vælg mindst ', + groupCheckedTooManyStart: 'Vælg højst ', + imageRatioNotAccepted: 'Billedets dimensioner er ikke acceptable', + imageTooSmall: 'Billedet er for lille', + imageTooTall: 'Billedet må ikke være højere end', + imageTooWide: 'Billedet må ikke være bredere end', + lengthBadEnd: ' tegn', + lengthBadStart: 'Feltets værdi skal være mellem ', + lengthTooLongStart: 'Feltets værdi må ikke være længere end ', + lengthTooShortStart: 'Feltets værdi må ikke være kortere end ', + max: 'max', + min: 'min', + notConfirmed: 'Feltværdierne kunne ikke bekræftes', + requiredField: 'Dette felt er påkrævet', + requiredFields: 'Du har ikke udfyldt alle påkrævede felter', + wrongFileDim: 'Forkerte billede dimensioner,', + wrongFileSize: 'Filen du forsøger at uploade er for stor (max %s)', + wrongFileType: 'Udelukkende filer at følgedne type er tilladt %s' + }; + + }); + +})(jQuery, window); + + + + + +})); diff --git a/form-validator/lang/de.js b/form-validator/lang/de.js index 6b2ba42..3123968 100644 --- a/form-validator/lang/de.js +++ b/form-validator/lang/de.js @@ -1,9 +1,85 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * German language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/de"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Ihre Anfrage konnte nicht gesendet werden!",requiredField:"Dies ist ein Pflichtfeld",requiredFields:"Sie haben nicht alle Fragen beantwortet",badTime:"Sie haben nicht die korrekte Zeit eingegeben",badEmail:"Sie haben keine gültige E-Mail-Adresse eingegeben",badTelephone:"Sie haben keine richtige Telefonnummer eingetragen",badSecurityAnswer:"Sie haben die falsche Antwort auf die Sicherheitsfrage eingegeben",badDate:"Eingabe eines falschen Datums",lengthBadStart:"Der eingegebene Wert muss dazwischen sein ",lengthBadEnd:"  Zeichen",lengthTooLongStart:"Der eingegebene Wert ist größer als ",lengthTooShortStart:"Der eingegebene Wert ist kleiner als ",notConfirmed:"Die Eingaben sind unterschiedlich",badDomain:"Sie haben die falsche Domäne eingetragen",badUrl:"Sie haben nicht die richtige URL eingegeben",badCustomVal:"Eingabe einer falschen Antwort",andSpaces:" und Leerzeichen",badInt:"Sie haben keine Nummer eingegeben",badSecurityNumber:"Sie haben eine falsche Sozialversicherungsnummer eingegeben",badUKVatAnswer:"Sie haben keine UK-Umsatzsteuer-Identifikationsnummer eingegeben",badStrength:"Sie haben ein Kennwort, das nicht sicher genug ist eingegeben",badNumberOfSelectedOptionsStart:"Wählen Sie zu mindestens ",badNumberOfSelectedOptionsEnd:" Antwort",badAlphaNumeric:"Sie können nur alphanumerische Zeichen (Buchstaben und Zahlen) eingeben",badAlphaNumericExtra:" und",wrongFileSize:"Die Datei, die Sie hochzuladen versuchen, ist zu groß (max %s)",wrongFileType:"Nur Dateien vom Typ %s sind zulässig",groupCheckedRangeStart:"Wählen Sie zwischen",groupCheckedTooFewStart:"Dann müssen Sie zumindest sicher,",groupCheckedTooManyStart:"Sie können nicht mehr als zu machen",groupCheckedEnd:" Auswahl",badCreditCard:"Sie haben eine ungültige Kreditkartennummer eingegeben",badCVV:"Sie haben eine falsche CVV eingegeben",wrongFileDim:"Illegale Bildgröße,",imageTooTall:"Bild kann nicht größer sein als",imageTooWide:"Bild kann nicht breiter sein als",imageTooSmall:"Bild ist zu klein",min:"min",max:"max",imageRatioNotAccepted:"Bildverhältnis wird nicht akzeptiert",badBrazilTelephoneAnswer:"Die eingegebene Telefonnummer ist nicht korrekt",badBrazilCEPAnswer:"Der CEP ist ungültig",badBrazilCPFAnswer:"Der CEP ist ungültig"}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/de'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'Ihre Anfrage konnte nicht gesendet werden!', + requiredField: 'Dies ist ein Pflichtfeld', + requiredFields: 'Sie haben nicht alle Fragen beantwortet', + badTime: 'Sie haben nicht die korrekte Zeit eingegeben', + badEmail: 'Sie haben keine gültige E-Mail-Adresse eingegeben', + badTelephone: 'Sie haben keine richtige Telefonnummer eingetragen', + badSecurityAnswer: 'Sie haben die falsche Antwort auf die Sicherheitsfrage eingegeben', + badDate: 'Eingabe eines falschen Datums', + lengthBadStart: 'Der eingegebene Wert muss dazwischen sein ', + lengthBadEnd: '  Zeichen', + lengthTooLongStart: 'Der eingegebene Wert ist größer als ', + lengthTooShortStart: 'Der eingegebene Wert ist kleiner als ', + notConfirmed: 'Die Eingaben sind unterschiedlich', + badDomain: 'Sie haben die falsche Domäne eingetragen', + badUrl: 'Sie haben nicht die richtige URL eingegeben', + badCustomVal: 'Eingabe einer falschen Antwort', + andSpaces: ' und Leerzeichen', + badInt: 'Sie haben keine Nummer eingegeben', + badSecurityNumber: 'Sie haben eine falsche Sozialversicherungsnummer eingegeben', + badUKVatAnswer: 'Sie haben keine UK-Umsatzsteuer-Identifikationsnummer eingegeben', + badStrength: 'Sie haben ein Kennwort, das nicht sicher genug ist eingegeben', + badNumberOfSelectedOptionsStart: 'Wählen Sie zu mindestens ', + badNumberOfSelectedOptionsEnd: ' Antwort', + badAlphaNumeric: 'Sie können nur alphanumerische Zeichen (Buchstaben und Zahlen) eingeben', + badAlphaNumericExtra: ' und', + wrongFileSize: 'Die Datei, die Sie hochzuladen versuchen, ist zu groß (max %s)', + wrongFileType: 'Nur Dateien vom Typ %s sind zulässig', + groupCheckedRangeStart: 'Wählen Sie zwischen', + groupCheckedTooFewStart: 'Dann müssen Sie zumindest sicher,', + groupCheckedTooManyStart: 'Sie können nicht mehr als zu machen', + groupCheckedEnd: ' Auswahl', + badCreditCard: 'Sie haben eine ungültige Kreditkartennummer eingegeben', + badCVV: 'Sie haben eine falsche CVV eingegeben', + wrongFileDim: 'Illegale Bildgröße,', + imageTooTall: 'Bild kann nicht größer sein als', + imageTooWide: 'Bild kann nicht breiter sein als', + imageTooSmall: 'Bild ist zu klein', + min: 'min', + max: 'max', + imageRatioNotAccepted : 'Bildverhältnis wird nicht akzeptiert', + badBrazilTelephoneAnswer: 'Die eingegebene Telefonnummer ist nicht korrekt', + badBrazilCEPAnswer: 'Der CEP ist ungültig', + badBrazilCPFAnswer: 'Der CEP ist ungültig' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/es.js b/form-validator/lang/es.js index 285f4aa..ed6535d 100644 --- a/form-validator/lang/es.js +++ b/form-validator/lang/es.js @@ -1,9 +1,89 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Spanish language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/es"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"El formulario no se ha podido enviar!",requiredField:"Este campo es obligatorio",requiredFields:"No ha contestado todos los campos requeridos",badTime:"La hora proporcionada no es válida",badEmail:"La dirección de e-mail no es válida",badTelephone:"El número de teléfono proporcionado no es válido",badSecurityAnswer:"La respuesta a su pregunta de seguridad es incorrecta",badDate:"La fecha proporcionada no es válida",lengthBadStart:"Su respuesta debe incluir entre ",lengthBadEnd:" caracteres",lengthTooLongStart:"Su respuesta debe de ser menor a ",lengthTooShortStart:"Su respuesta debe de ser mayor a ",notConfirmed:"Los valores proporcionados no pudieron ser confirmados",badDomain:"Ha introducido un dominio incorrecto",badUrl:"La URL proporcionada no es válida",badCustomVal:"Los valores proporcionados no son válidos",andSpaces:" y espacios ",badInt:"El valor proporcionado no es un número válido",badSecurityNumber:"El número de seguridad social proporcionado es incorrecto",badUKVatAnswer:"El número VAT proporcionado no es válido para el Reino Unido",badStrength:"La contraseña proporcionada no es lo suficientemente segura",badNumberOfSelectedOptionsStart:"Debe seleccionar al menos",badNumberOfSelectedOptionsEnd:" respuesta(s)",badAlphaNumeric:"El valor proporcionado solo debe contener caracteres alfanuméricos (a-z y números)",badAlphaNumericExtra:" y",wrongFileSize:"El archivo que está tratando de subir es demasiado grande (máx. %s)",wrongFileType:"Sólo los archivos del tipo %s están permitido",groupCheckedRangeStart:"Por favor, elija entre ",groupCheckedTooFewStart:"Por favor, elija al menos ",groupCheckedTooManyStart:"Por favor, elija un máximo de ",groupCheckedEnd:" ítem(s)",badCreditCard:"El número de tarjeta de crédito proporcionado no es válido",badCVV:"CVV proporcionado no es válido",wrongFileDim:"Las dimensiones de la imagen no son validas,",imageTooTall:"el alto de la imagen no puede ser mayor a",imageTooWide:"el ancho de la imagen no puede ser mayor a",imageTooSmall:"la imagen es demasiado pequeña",min:"min.",max:"máx.",imageRatioNotAccepted:"La proporción de imagen (alto x ancho) no es válida",passwordComplexityStart:"La contraseña debe contener al menos ",passwordComplexitySeparator:", ",passwordComplexityUppercaseInfo:" mayúscula(s)",passwordComplexityLowercaseInfo:" minúscula(s)",passwordComplexitySpecialCharsInfo:" caracter(es) especial(es)",passwordComplexityNumericCharsInfo:" número(s)",passwordComplexityEnd:"."}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/es'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'El formulario no se ha podido enviar!', + requiredField: 'Este campo es obligatorio', + requiredFields: 'No ha contestado todos los campos requeridos', + badTime: 'La hora proporcionada no es válida', + badEmail: 'La dirección de e-mail no es válida', + badTelephone: 'El número de teléfono proporcionado no es válido', + badSecurityAnswer: 'La respuesta a su pregunta de seguridad es incorrecta', + badDate: 'La fecha proporcionada no es válida', + lengthBadStart: 'Su respuesta debe incluir entre ', + lengthBadEnd: ' caracteres', + lengthTooLongStart: 'Su respuesta debe de ser menor a ', + lengthTooShortStart: 'Su respuesta debe de ser mayor a ', + notConfirmed: 'Los valores proporcionados no pudieron ser confirmados', + badDomain: 'Ha introducido un dominio incorrecto', + badUrl: 'La URL proporcionada no es válida', + badCustomVal: 'Los valores proporcionados no son válidos', + andSpaces: ' y espacios ', + badInt: 'El valor proporcionado no es un número válido', + badSecurityNumber: 'El número de seguridad social proporcionado es incorrecto', + badUKVatAnswer: 'El número VAT proporcionado no es válido para el Reino Unido', + badStrength: 'La contraseña proporcionada no es lo suficientemente segura', + badNumberOfSelectedOptionsStart: 'Debe seleccionar al menos', + badNumberOfSelectedOptionsEnd: ' respuesta(s)', + badAlphaNumeric: 'El valor proporcionado solo debe contener caracteres alfanuméricos (a-z y números)', + badAlphaNumericExtra: ' y', + wrongFileSize: 'El archivo que está tratando de subir es demasiado grande (máx. %s)', + wrongFileType: 'Sólo los archivos del tipo %s están permitido', + groupCheckedRangeStart: 'Por favor, elija entre ', + groupCheckedTooFewStart: 'Por favor, elija al menos ', + groupCheckedTooManyStart: 'Por favor, elija un máximo de ', + groupCheckedEnd: ' ítem(s)', + badCreditCard: 'El número de tarjeta de crédito proporcionado no es válido', + badCVV: 'CVV proporcionado no es válido', + wrongFileDim: 'Las dimensiones de la imagen no son validas,', + imageTooTall: 'el alto de la imagen no puede ser mayor a', + imageTooWide: 'el ancho de la imagen no puede ser mayor a', + imageTooSmall: 'la imagen es demasiado pequeña', + min: 'min.', + max: 'máx.', + imageRatioNotAccepted : 'La proporción de imagen (alto x ancho) no es válida', + passwordComplexityStart: 'La contraseña debe contener al menos ', + passwordComplexitySeparator: ', ', + passwordComplexityUppercaseInfo: ' mayúscula(s)', + passwordComplexityLowercaseInfo: ' minúscula(s)', + passwordComplexitySpecialCharsInfo: ' caracter(es) especial(es)', + passwordComplexityNumericCharsInfo: ' número(s)', + passwordComplexityEnd: '.' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/fa.js b/form-validator/lang/fa.js index 36a6091..267faee 100644 --- a/form-validator/lang/fa.js +++ b/form-validator/lang/fa.js @@ -1,9 +1,84 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/* jshint -W100 */ +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Farsi language package + * + * @website http://formvalidator.net/ + * @license MIT + * @version 0.0.1 */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/fa"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"ثبت فرم با مشکل مواجه شد!",requiredField:"شما همه فیلدهای ضروری را تکمیل نکرده اید",requiredFields:"شما فیلد ضروری را تکمیل نکرده اید",badTime:"زمان درستی را وارد نکرده اید",badEmail:"آدرس ایمیل را به درستی وارد نکرده اید",badTelephone:"شماره تلفن وارد شده معتبر نیست",badSecurityAnswer:"شما به سوال امنیتی درست پاسخ نداده اید",badDate:"تاریخ درستی را وارد نکرده اید",lengthBadStart:"مقدار وارد شده باید ",lengthBadEnd:" حرف باشد.",lengthTooLongStart:"مقدار ورودی بیشتر از ",lengthTooShortStart:"مقدار ورودی کمتر از ",notConfirmed:"ورودی ها یکسان نیستند",badDomain:"آدرس دامنه به درستی وارد نشده است",badUrl:"آدرس اینترنتی به درستی وارد نشده است",badCustomVal:"مقدار ورودی نادرست است",andSpaces:" و فاصله خالی ",badInt:"مقدار ورودی باید عدد باشد",badSecurityNumber:"شماره امنیت اجتماعی شما معتبر نیست",badUKVatAnswer:"شماره مالیاتی شما درست نیست",badStrength:"کلمه عبور به قدر کافی مستحکم نیست",badNumberOfSelectedOptionsStart:"شما باید حداقل ",badNumberOfSelectedOptionsEnd:" پاسخ را انتخاب کنید",badAlphaNumeric:"مقدار ورودی می تواند حروف و شماره باشد ",badAlphaNumericExtra:" و ",wrongFileSize:"حجم فایل انتخابی زیاد است. (حداکثر %s)",wrongFileType:"فقط فایل های با فرمت %s مجاز هستند",groupCheckedRangeStart:"لطفا بین ",groupCheckedTooFewStart:"لطفا حداقل ",groupCheckedTooManyStart:"لطفا حداکثر ",groupCheckedEnd:" گزینه انتخاب کنید",badCreditCard:"شماره کارت اعتباری معتبر نیست",badCVV:"کد شناسایی سی وی وی معتبر نیست",wrongFileDim:"ابعاد تصویر صحیح نیست,",imageTooTall:"حداکثر طول تصویر",imageTooWide:"حداکثر عرض تصویر",imageTooSmall:"تصویر خیلی کوچک است",min:"حداقل",max:"حداکثر",imageRatioNotAccepted:"نسبت ابعاد تصویر مناسب نیست"}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/fa'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'ثبت فرم با مشکل مواجه شد!', + requiredField: 'شما همه فیلدهای ضروری را تکمیل نکرده اید', + requiredFields: 'شما فیلد ضروری را تکمیل نکرده اید', + badTime: 'زمان درستی را وارد نکرده اید', + badEmail: 'آدرس ایمیل را به درستی وارد نکرده اید', + badTelephone: 'شماره تلفن وارد شده معتبر نیست', + badSecurityAnswer: 'شما به سوال امنیتی درست پاسخ نداده اید', + badDate: 'تاریخ درستی را وارد نکرده اید', + lengthBadStart: 'مقدار وارد شده باید ', + lengthBadEnd: ' حرف باشد.', + lengthTooLongStart: 'مقدار ورودی بیشتر از ', + lengthTooShortStart: 'مقدار ورودی کمتر از ', + notConfirmed: 'ورودی ها یکسان نیستند', + badDomain: 'آدرس دامنه به درستی وارد نشده است', + badUrl: 'آدرس اینترنتی به درستی وارد نشده است', + badCustomVal: 'مقدار ورودی نادرست است', + andSpaces: ' و فاصله خالی ', + badInt: 'مقدار ورودی باید عدد باشد', + badSecurityNumber: 'شماره امنیت اجتماعی شما معتبر نیست', + badUKVatAnswer: 'شماره مالیاتی شما درست نیست', + badStrength: 'کلمه عبور به قدر کافی مستحکم نیست', + badNumberOfSelectedOptionsStart: 'شما باید حداقل ', + badNumberOfSelectedOptionsEnd: ' پاسخ را انتخاب کنید', + badAlphaNumeric: 'مقدار ورودی می تواند حروف و شماره باشد ', + badAlphaNumericExtra: ' و ', + wrongFileSize: 'حجم فایل انتخابی زیاد است. (حداکثر %s)', + wrongFileType: 'فقط فایل های با فرمت %s مجاز هستند', + groupCheckedRangeStart: 'لطفا بین ', + groupCheckedTooFewStart: 'لطفا حداقل ', + groupCheckedTooManyStart: 'لطفا حداکثر ', + groupCheckedEnd: ' گزینه انتخاب کنید', + badCreditCard: 'شماره کارت اعتباری معتبر نیست', + badCVV: 'کد شناسایی سی وی وی معتبر نیست', + wrongFileDim : 'ابعاد تصویر صحیح نیست,', + imageTooTall : 'حداکثر طول تصویر', + imageTooWide : 'حداکثر عرض تصویر', + imageTooSmall : 'تصویر خیلی کوچک است', + min : 'حداقل', + max : 'حداکثر', + imageRatioNotAccepted : 'نسبت ابعاد تصویر مناسب نیست' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/fr.js b/form-validator/lang/fr.js index 43bf242..2ad20ca 100644 --- a/form-validator/lang/fr.js +++ b/form-validator/lang/fr.js @@ -1,9 +1,82 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * French language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/fr"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Le formulaire n'a pas pu être envoyé!",requiredField:"Ce champ est obligatoire",requiredFields:"Vous n'avez pas rempli tous les champs",badTime:"Vous n'avez pas saisi l'heure correctement",badEmail:"Vous n'avez pas saisi une adresse e-mail valide",badTelephone:"Vous n'avez pas saisi un numéro de téléphone valide",badSecurityAnswer:"Vous avez saisi une mauvaise réponse à la question de sécurité",badDate:"Vous n'avez pas saisi une date correcte",lengthBadStart:"Votre saisie doit comporter entre ",lengthBadEnd:" caractères",lengthTooLongStart:"Vous avez saisi une réponse qui est plus longue que ",lengthTooShortStart:"Votre saisie est plus courte que ",notConfirmed:"Les saisies ne sont pas identiques",badDomain:"Vous avez saisi un domaine incorrect",badUrl:"Vous avez saisi une URL incorrecte",badCustomVal:"Re-saisissez une réponse correcte",andSpaces:" et des espaces ",badInt:"Vous n'avez pas saisi un numéro",badSecurityNumber:"Vous avez saisi un mauvais numéro de sécurité sociale",badUKVatAnswer:"Vous n'avez pas saisi un numéro de TVA au Royaume-Uni",badStrength:"Vous avez saisi un mot de passe pas assez sécurisé",badNumberOfSelectedOptionsStart:"Vous devez sélectionner au moins ",badNumberOfSelectedOptionsEnd:" réponse(s)",badAlphaNumeric:"Vous ne pouvez répondre qu'avec des caractères alphanumériques et des chiffres ",badAlphaNumericExtra:" et ",wrongFileSize:"Le fichier que vous essayez de télécharger est trop grand (max %s)",wrongFileType:"Seuls les fichiers du type %s sont autorisés",groupCheckedRangeStart:"Choisissez entre ",groupCheckedTooFewStart:"Vous devez faire au moins ",groupCheckedTooManyStart:"Vous ne pouvez pas faire plus de ",groupCheckedEnd:" sélection(s)",badCreditCard:"Vous avez saisi un numéro de carte de crédit invalide",badCVV:"Vous avez saisi un CVV incorrect",wrongFileDim:"Mauvaise taille de l'image, ",imageTooTall:"l'image ne peut pas être plus élevée que",imageTooWide:"l'image ne peut pas être plus large que",imageTooSmall:"l'image est trop petite",min:"moins",max:"max",imageRatioNotAccepted:"Ratio de l'image non accepté"}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/fr'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'Le formulaire n\'a pas pu être envoyé!', + requiredField: 'Ce champ est obligatoire', + requiredFields: 'Vous n\'avez pas rempli tous les champs', + badTime: 'Vous n\'avez pas saisi l\'heure correctement', + badEmail: 'Vous n\'avez pas saisi une adresse e-mail valide', + badTelephone: 'Vous n\'avez pas saisi un numéro de téléphone valide', + badSecurityAnswer: 'Vous avez saisi une mauvaise réponse à la question de sécurité', + badDate: 'Vous n\'avez pas saisi une date correcte', + lengthBadStart: 'Votre saisie doit comporter entre ', + lengthBadEnd: ' caractères', + lengthTooLongStart: 'Vous avez saisi une réponse qui est plus longue que ', + lengthTooShortStart: 'Votre saisie est plus courte que ', + notConfirmed: 'Les saisies ne sont pas identiques', + badDomain: 'Vous avez saisi un domaine incorrect', + badUrl: 'Vous avez saisi une URL incorrecte', + badCustomVal: 'Re-saisissez une réponse correcte', + andSpaces: ' et des espaces ', + badInt: 'Vous n\'avez pas saisi un numéro', + badSecurityNumber: 'Vous avez saisi un mauvais numéro de sécurité sociale', + badUKVatAnswer: 'Vous n\'avez pas saisi un numéro de TVA au Royaume-Uni', + badStrength: 'Vous avez saisi un mot de passe pas assez sécurisé', + badNumberOfSelectedOptionsStart: 'Vous devez sélectionner au moins ', + badNumberOfSelectedOptionsEnd: ' réponse(s)', + badAlphaNumeric: 'Vous ne pouvez répondre qu\'avec des caractères alphanumériques et des chiffres ', + badAlphaNumericExtra: ' et ', + wrongFileSize: 'Le fichier que vous essayez de télécharger est trop grand (max %s)', + wrongFileType: 'Seuls les fichiers du type %s sont autorisés', + groupCheckedRangeStart: 'Choisissez entre ', + groupCheckedTooFewStart: 'Vous devez faire au moins ', + groupCheckedTooManyStart: 'Vous ne pouvez pas faire plus de ', + groupCheckedEnd: ' sélection(s)', + badCreditCard: 'Vous avez saisi un numéro de carte de crédit invalide', + badCVV: 'Vous avez saisi un CVV incorrect', + wrongFileDim: 'Mauvaise taille de l\'image, ', + imageTooTall: 'l\'image ne peut pas être plus élevée que', + imageTooWide: 'l\'image ne peut pas être plus large que', + imageTooSmall: 'l\'image est trop petite', + min: 'moins', + max: 'max', + imageRatioNotAccepted: 'Ratio de l\'image non accepté' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/it.js b/form-validator/lang/it.js index 94bf719..e21e0bd 100644 --- a/form-validator/lang/it.js +++ b/form-validator/lang/it.js @@ -1,9 +1,82 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Italian language package + * + * @website http://formvalidator.net/ + * @license MIT + * @version 2.2.163 */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/it"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Impossibile inviare il modulo!",requiredField:"Campo obbligatorio",requiredFields:"Non sono stati compilati tutti i campi richiesti",badTime:"L'ora scelta non è valida",badEmail:"Questo indirizzo email non è valido",badTelephone:"Il numero di telefono imputato non è valido",badSecurityAnswer:"La risposta alla domanda di sicurezza è errata",badDate:"La data scelta non è valida",lengthBadStart:"La sua risposta non può essere più lunga di ",lengthBadEnd:" caratteri",lengthTooLongStart:"La lunghezza della risposta deve essere minore di ",lengthTooShortStart:"La lunghezza della risposta deve essere maggiore di ",notConfirmed:"Il valore non è stato confermato.",badDomain:"Il dominio inserito non è corretto.",badUrl:"L' URL inserito non è valido",badCustomVal:"I valori inseriti non sono validi",andSpaces:" e spazi ",badInt:"Il numero inserito non è valido",badSecurityNumber:"Il numero di sicurezza inserito non è valido",badUKVatAnswer:"La Partita IVA (VAT) inserita non è valida nel Regno Unito",badStrength:"La password proposta non è sufficientemente sicura",badNumberOfSelectedOptionsStart:"Deve selezionare almeno",badNumberOfSelectedOptionsEnd:" risposta/e",badAlphaNumeric:"Il valore proposto deve contenere caratteri alfanumerici (a-z e 1234...)",badAlphaNumericExtra:"",wrongFileSize:"Il file che si sta cercando di caricare è troppo grande (massimo %s)",wrongFileType:"Solo i file di tipo %s possono essere inviati",groupCheckedRangeStart:"Si prega di scegliere tra ",groupCheckedTooFewStart:"Si prega di selezionare un minimo di ",groupCheckedTooManyStart:"Si prega di selezionare un massimo di ",groupCheckedEnd:" opzione/i",badCreditCard:"Il numero di carta di credito non risulta valido",badCVV:"CVV non valido",wrongFileDim:"La dimensione dell'immagine non è valida,",imageTooTall:"il lato alto dell'immagine non può essere maggiore di",imageTooWide:"il lato lungo dell'immagine non può essere maggiore di",imageTooSmall:"L'immagine è troppo piccola",min:"min.",max:"máx.",imageRatioNotAccepted:"La proporzione dell' immagine (altezza x larghezza) non è valida"}})}(a,window)}); \ No newline at end of file +(function($, window) { + 'use strict'; + + $.formUtils.registerLoadedModule('lang/it'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'Impossibile inviare il modulo!', + requiredField: 'Campo obbligatorio', + requiredFields: 'Non sono stati compilati tutti i campi richiesti', + badTime: 'L\'ora scelta non è valida', + badEmail: 'Questo indirizzo email non è valido', + badTelephone: 'Il numero di telefono imputato non è valido', + badSecurityAnswer: 'La risposta alla domanda di sicurezza è errata', + badDate: 'La data scelta non è valida', + lengthBadStart: 'La sua risposta non può essere più lunga di ', + lengthBadEnd: ' caratteri', + lengthTooLongStart: 'La lunghezza della risposta deve essere minore di ', + lengthTooShortStart: 'La lunghezza della risposta deve essere maggiore di ', + notConfirmed: 'Il valore non è stato confermato.', + badDomain: 'Il dominio inserito non è corretto.', + badUrl: 'L\' URL inserito non è valido', + badCustomVal: 'I valori inseriti non sono validi', + andSpaces: ' e spazi ', + badInt: 'Il numero inserito non è valido', + badSecurityNumber: 'Il numero di sicurezza inserito non è valido', + badUKVatAnswer: 'La Partita IVA (VAT) inserita non è valida nel Regno Unito', + badStrength: 'La password proposta non è sufficientemente sicura', + badNumberOfSelectedOptionsStart: 'Deve selezionare almeno', + badNumberOfSelectedOptionsEnd: ' risposta/e', + badAlphaNumeric: 'Il valore proposto deve contenere caratteri alfanumerici (a-z e 1234...)', + badAlphaNumericExtra: '', + wrongFileSize: 'Il file che si sta cercando di caricare è troppo grande (massimo %s)', + wrongFileType: 'Solo i file di tipo %s possono essere inviati', + groupCheckedRangeStart: 'Si prega di scegliere tra ', + groupCheckedTooFewStart: 'Si prega di selezionare un minimo di ', + groupCheckedTooManyStart: 'Si prega di selezionare un massimo di ', + groupCheckedEnd: ' opzione/i', + badCreditCard: 'Il numero di carta di credito non risulta valido', + badCVV: 'CVV non valido', + wrongFileDim: 'La dimensione dell\'immagine non è valida,', + imageTooTall: 'il lato alto dell\'immagine non può essere maggiore di', + imageTooWide: 'il lato lungo dell\'immagine non può essere maggiore di', + imageTooSmall: 'L\'immagine è troppo piccola', + min: 'min.', + max: 'máx.', + imageRatioNotAccepted : 'La proporzione dell\' immagine (altezza x larghezza) non è valida' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/ka.js b/form-validator/lang/ka.js index 3b5a0f1..bcf4233 100644 --- a/form-validator/lang/ka.js +++ b/form-validator/lang/ka.js @@ -1,9 +1,88 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Georgian language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/ka"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"ფორმა ვერ გაიგზავნა!",requiredField:"ველის შევსება სავალდებულოა",requiredFields:"თქვენ არ შეგივსიათ ყველა სავალდებულო ველი",badTime:"თქვენ მიუთითეთ არასწორი დრო",badEmail:"თქვენ მიუთითეთ არასწორი ელ.ფოსტის მისამართი",badTelephone:"თქვენ მიუთითეთ არასწორი ტელეფონის ნომერი",badSecurityAnswer:"თქვენ გაეცით არასწორი პასუხი უსაფრთხოების კითხვას",badDate:"თქვენ მიუთითეთ არასწორი თარიღი",lengthBadStart:"ველის მნიშვნელობის სიგრძე უნდა იყოს ",lengthBadEnd:" შუალედში",lengthTooLongStart:"ველის მნიშვნელობის სიგრძე უნდა იყოს მაქსიმუმ ",lengthTooShortStart:"ველის მნიშვნელობის სიგრძე უნდა იყოს მინიმუმ ",notConfirmed:"ველის მნიშვნელობები ვერ დადასტურდა",badDomain:"არასწორი დომენის მისამართი",badUrl:"ველის მნიშვნელობა არ არის მართებული URL მისამართი",badCustomVal:"ველის მნიშვნელობა არ არის მართებული",andSpaces:" და გამოტოვებები ",badInt:"ველის მნიშვნელობა არ არის მართებული რიცხვი",badStrength:"პაროლი არ არის საკმარისად ძლიერი (კარგი)",badNumberOfSelectedOptionsStart:"თქვენ უნდა აირჩიოთ სულ მცირე ",badNumberOfSelectedOptionsEnd:" პასუხი",badAlphaNumeric:"ველის მნიშვნელობა უნდა შეიცავდეს მხოლოდ ციფრებსა და ასოებს ",badAlphaNumericExtra:" და ",wrongFileSize:"ფაილი, რომლის ატვირთვასაც ცდილობთ არის ძალიან დიდი (დასაშვებია მაქსიმუმ %s)",wrongFileType:"დასაშვებია მხოლოდ შემდეგი გაფართოების ფაილები: %s",groupCheckedRangeStart:"გთხოვთ, აირჩიოთ ",groupCheckedTooFewStart:"გთხოვთ, აირჩიოთ სულ მცირე ",groupCheckedTooManyStart:"გთხოვთ, აირჩიოთ მაქსიმუმ ",groupCheckedEnd:" პუნქტი",badCreditCard:"საკრედიტო ბარათის ნომერი არ არის მართებული",badCVV:"CVV კოდი არ არის მართებული",wrongFileDim:"არამართებული სურათის ზომები,",imageTooTall:"სურათი არ უნდა იყოს უფრო გრძელი ვიდრე",imageTooWide:"სურათი არ უნდა იყოს უფრო ფართე ვიდრე",imageTooSmall:"სურათი არის ძალიან პატარა",min:"მინიმუმ",max:"მაქსიმუმ",imageRatioNotAccepted:"სურათის სიგრძისა და სიგანის ეს თანაფარდობა დაუშვებელია",badBrazilTelephoneAnswer:"მითითებული ტელეფონის ნომერი არ არის მართებული",badreCaptcha:"დაადასტურეთ, რომ არ ხართ რობოტი",passwordComplexityStart:"პაროლი უნდა შეიცავდეს მინიმუმ ",passwordComplexitySeparator:", ",passwordComplexityUppercaseInfo:" დიდი ასო(ები)",passwordComplexityLowercaseInfo:" პატარა ასო(ები)",passwordComplexitySpecialCharsInfo:" სპეციალური სიმბოლო(ები)",passwordComplexityNumericCharsInfo:" რიცხვითი მნიშვნელობა(ები)",passwordComplexityEnd:"."}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/ka'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'ფორმა ვერ გაიგზავნა!', + requiredField: 'ველის შევსება სავალდებულოა', + requiredFields: 'თქვენ არ შეგივსიათ ყველა სავალდებულო ველი', + badTime: 'თქვენ მიუთითეთ არასწორი დრო', + badEmail: 'თქვენ მიუთითეთ არასწორი ელ.ფოსტის მისამართი', + badTelephone: 'თქვენ მიუთითეთ არასწორი ტელეფონის ნომერი', + badSecurityAnswer: 'თქვენ გაეცით არასწორი პასუხი უსაფრთხოების კითხვას', + badDate: 'თქვენ მიუთითეთ არასწორი თარიღი', + lengthBadStart: 'ველის მნიშვნელობის სიგრძე უნდა იყოს ', + lengthBadEnd: ' შუალედში', + lengthTooLongStart: 'ველის მნიშვნელობის სიგრძე უნდა იყოს მაქსიმუმ ', + lengthTooShortStart: 'ველის მნიშვნელობის სიგრძე უნდა იყოს მინიმუმ ', + notConfirmed: 'ველის მნიშვნელობები ვერ დადასტურდა', + badDomain: 'არასწორი დომენის მისამართი', + badUrl: 'ველის მნიშვნელობა არ არის მართებული URL მისამართი', + badCustomVal: 'ველის მნიშვნელობა არ არის მართებული', + andSpaces: ' და გამოტოვებები ', + badInt: 'ველის მნიშვნელობა არ არის მართებული რიცხვი', + badStrength: 'პაროლი არ არის საკმარისად ძლიერი (კარგი)', + badNumberOfSelectedOptionsStart: 'თქვენ უნდა აირჩიოთ სულ მცირე ', + badNumberOfSelectedOptionsEnd: ' პასუხი', + badAlphaNumeric: 'ველის მნიშვნელობა უნდა შეიცავდეს მხოლოდ ციფრებსა და ასოებს ', + badAlphaNumericExtra: ' და ', + wrongFileSize: 'ფაილი, რომლის ატვირთვასაც ცდილობთ არის ძალიან დიდი (დასაშვებია მაქსიმუმ %s)', + wrongFileType: 'დასაშვებია მხოლოდ შემდეგი გაფართოების ფაილები: %s', + groupCheckedRangeStart: 'გთხოვთ, აირჩიოთ ', + groupCheckedTooFewStart: 'გთხოვთ, აირჩიოთ სულ მცირე ', + groupCheckedTooManyStart: 'გთხოვთ, აირჩიოთ მაქსიმუმ ', + groupCheckedEnd: ' პუნქტი', + badCreditCard: 'საკრედიტო ბარათის ნომერი არ არის მართებული', + badCVV: 'CVV კოდი არ არის მართებული', + wrongFileDim: 'არამართებული სურათის ზომები,', + imageTooTall: 'სურათი არ უნდა იყოს უფრო გრძელი ვიდრე', + imageTooWide: 'სურათი არ უნდა იყოს უფრო ფართე ვიდრე', + imageTooSmall: 'სურათი არის ძალიან პატარა', + min: 'მინიმუმ', + max: 'მაქსიმუმ', + imageRatioNotAccepted: 'სურათის სიგრძისა და სიგანის ეს თანაფარდობა დაუშვებელია', + badBrazilTelephoneAnswer: 'მითითებული ტელეფონის ნომერი არ არის მართებული', + badreCaptcha: 'დაადასტურეთ, რომ არ ხართ რობოტი', + passwordComplexityStart: 'პაროლი უნდა შეიცავდეს მინიმუმ ', + passwordComplexitySeparator: ', ', + passwordComplexityUppercaseInfo: ' დიდი ასო(ები)', + passwordComplexityLowercaseInfo: ' პატარა ასო(ები)', + passwordComplexitySpecialCharsInfo: ' სპეციალური სიმბოლო(ები)', + passwordComplexityNumericCharsInfo: ' რიცხვითი მნიშვნელობა(ები)', + passwordComplexityEnd: '.' + }; + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/ko.js b/form-validator/lang/ko.js index a791f84..c56d807 100644 --- a/form-validator/lang/ko.js +++ b/form-validator/lang/ko.js @@ -1,9 +1,89 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Korean language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/ko"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"이 양식은 보낼 수 없습니다!",requiredField:"필수 입력란입니다.",requiredFields:"모든 필수 입력란을 입력해야 합니다.",badTime:"시간을 정확하게 입력하지 않았습니다.",badEmail:"e-mail을 정확하게 입력하지 않았습니다.",badTelephone:"전화번호를 정확하게 입력하지 않았습니다.",badSecurityAnswer:"보안 입력을 정확하게 입력하지 않았습니다.",badDate:"날짜를 정확하게 입력하지 않았습니다.",lengthBadStart:"입력 값은 ",lengthBadEnd:" 사이의 문자여야 합니다.",lengthTooLongStart:"입력 값의 길이가 ",lengthTooLongEnd:" 보다 깁니다.",lengthTooShortStart:"입력 값의 길이가 ",lengthTooShortEnd:" 보다 짧습니다.",notConfirmed:"입력 값이 일치하지 않습니다.",badDomain:"도메인을 정확하게 입력하지 않았습니다.",badUrl:"URL을 정확하게 입력하지 않았습니다.",badCustomVal:"입력 값이 정확하지 않습니다.",badInt:"입력 값이 숫자가 아닙니다.",badSecurityNumber:"주민등록번호가 정확하지 않습니다.",badStrength:"암호를 더 복잡하게 조합해야 합니다.",badNumberOfSelectedOptionsStart:"최소한 ",badNumberOfSelectedOptionsEnd:" 개 항목 이상을 선택해야 합니다.",badAlphaNumeric:"입력 값은 문자와 숫자만 허용합니다.",badAlphaNumericAndExtra:"입력 값은 문자와 숫자와 ",badAlphaNumericExtra:" 만 허용합니다.",badAlphaNumericAndExtraAndSpaces:"입력 값은 문자와 숫자와 ",andSpaces:" 와 빈문자(spaces)만 허용합니다. ",wrongFileSize:"업로드 하려고 하는 파일의 크기가 너무 큽니다. (최대 %s)",wrongFileType:"파일 타입은 %s 만 허용합니다.",groupCheckedRangeStart:"",groupCheckedEnd:" 개 항목을 선택해야 합니다.",groupCheckedTooFewStart:"최소한 ",groupCheckedTooFewEnd:" 개 항목 이상을 선택해야 합니다.",groupCheckedTooManyStart:"",groupCheckedTooManyEnd:" 개 항목 이하를 선택해야 합니다.",badCreditCard:"신용카드번호를 정확하지 않습니다.",badCVV:"CVV 번호가 정확하지 않습니다.",wrongFileDim:"잘못된 이미지 크기 ,",imageTooTall:"이미지 길이가 ",imageTooTallEnd:" 보다 길어야 합니다.",imageTooWide:"이미지 넓이가 ",imageTooWideEnd:" 보다 넓어야 합니다.",imageTooSmall:"이미지 크기가 너무 작습니다.",min:"min",max:"max",imageRatioNotAccepted:"이미지 비율이 맞지 않습니다."}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/ko'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: '이 양식은 보낼 수 없습니다!', + requiredField: '필수 입력란입니다.', + requiredFields: '모든 필수 입력란을 입력해야 합니다.', + badTime: '시간을 정확하게 입력하지 않았습니다.', + badEmail: 'e-mail을 정확하게 입력하지 않았습니다.', + badTelephone: '전화번호를 정확하게 입력하지 않았습니다.', + badSecurityAnswer: '보안 입력을 정확하게 입력하지 않았습니다.', + badDate: '날짜를 정확하게 입력하지 않았습니다.', + lengthBadStart: '입력 값은 ', + lengthBadEnd: ' 사이의 문자여야 합니다.', + lengthTooLongStart: '입력 값의 길이가 ', + lengthTooLongEnd: ' 보다 깁니다.', + lengthTooShortStart: '입력 값의 길이가 ', + lengthTooShortEnd: ' 보다 짧습니다.', + notConfirmed: '입력 값이 일치하지 않습니다.', + badDomain: '도메인을 정확하게 입력하지 않았습니다.', + badUrl: 'URL을 정확하게 입력하지 않았습니다.', + badCustomVal: '입력 값이 정확하지 않습니다.', + badInt: '입력 값이 숫자가 아닙니다.', + badSecurityNumber: '주민등록번호가 정확하지 않습니다.', + badStrength: '암호를 더 복잡하게 조합해야 합니다.', + badNumberOfSelectedOptionsStart: '최소한 ', + badNumberOfSelectedOptionsEnd: ' 개 항목 이상을 선택해야 합니다.', + badAlphaNumeric: '입력 값은 문자와 숫자만 허용합니다.', + badAlphaNumericAndExtra: '입력 값은 문자와 숫자와 ', + badAlphaNumericExtra: ' 만 허용합니다.', + badAlphaNumericAndExtraAndSpaces: '입력 값은 문자와 숫자와 ', + andSpaces: ' 와 빈문자(spaces)만 허용합니다. ', + wrongFileSize: '업로드 하려고 하는 파일의 크기가 너무 큽니다. (최대 %s)', + wrongFileType: '파일 타입은 %s 만 허용합니다.', + groupCheckedRangeStart: '', + groupCheckedEnd: ' 개 항목을 선택해야 합니다.', + groupCheckedTooFewStart: '최소한 ', + groupCheckedTooFewEnd: ' 개 항목 이상을 선택해야 합니다.', + groupCheckedTooManyStart: '', + groupCheckedTooManyEnd: ' 개 항목 이하를 선택해야 합니다.', + badCreditCard: '신용카드번호를 정확하지 않습니다.', + badCVV: 'CVV 번호가 정확하지 않습니다.', + wrongFileDim : '잘못된 이미지 크기 ,', + imageTooTall : '이미지 길이가 ', + imageTooTallEnd : ' 보다 길어야 합니다.', + imageTooWide : '이미지 넓이가 ', + imageTooWideEnd : ' 보다 넓어야 합니다.', + imageTooSmall : '이미지 크기가 너무 작습니다.', + min : 'min', + max : 'max', + imageRatioNotAccepted : '이미지 비율이 맞지 않습니다.', + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/nl.js b/form-validator/lang/nl.js index 6f35bdb..d9506f0 100644 --- a/form-validator/lang/nl.js +++ b/form-validator/lang/nl.js @@ -1,9 +1,82 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Dutch language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/nl"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={andSpaces:" en spaties ",badAlphaNumeric:"De ingevoerde waarde mag alleen alfabetische karakters bevatten",badAlphaNumericExtra:" en ",badCVV:"Het CVV nummer was onjuist",badCreditCard:"Het creditcardnummer is onjuist",badCustomVal:"De ingevoerde waarde is onjuist",badDate:"U heeft niet de juiste datum aangegeven",badDomain:"Incorrect domein",badEmail:"U heeft een onjuist e-mailadres ingevoerd ",badInt:"De ingevoerde waarde was een onjuist getal",badNumberOfSelectedOptionsEnd:" antwoorden",badNumberOfSelectedOptionsStart:"U moet tenminste ",badSecurityAnswer:"U heeft de beveilingsvraag onjuist beantwoord",badSecurityNumber:"Uw burgerservicenummer was incorrect",badStrength:"Het wachtwoord is niet veilig genoeg",badTelephone:"U heeft een onjuist telefoonnummer ingevoerd",badTime:"U heeft een incorrecte tijd aangegeven",badUrl:"De ingevoerde waarde is geen correcte URL",badreCaptcha:"Bevestig a.u.b. dat u geen robot bent",errorTitle:"Indienen van formulier mislukt!",groupCheckedEnd:" item(s)",groupCheckedRangeStart:"Kies a.u.b. tussen ",groupCheckedTooFewStart:"Kies a.u.b. ten minste ",groupCheckedTooManyStart:"Kies a.u.b. maximaal ",imageRatioNotAccepted:"De afbeeldingsverhouding wordt niet geaccepteerd",imageTooSmall:"de afbeelding was te klein",imageTooTall:"de afbeelding kan niet langer zijn dan",imageTooWide:"de afbeelding kan niet wijder zijn dan",lengthBadEnd:" karakters",lengthBadStart:"De ingevoerde waarde moet liggen tussen ",lengthTooLongStart:"De ingevoerde waarde is langer dan ",lengthTooShortStart:"De ingevoerde waarde is korter dan ",max:"max",min:"min",notConfirmed:"Invoerwaarden konden niet worden bevestigd",requiredField:"Dit is een verplicht veld",requiredFields:"U heeft niet alle verplichte velden ingevuld",wrongFileDim:"Incorrecte afbeeldingsafmetingen,",wrongFileSize:"Het bestand dat u probeert te uploaden is te groot (max %s)",wrongFileType:"Alleen type %s bestanden zijn toegestaan"}})}(a,window)}); \ No newline at end of file +(function ($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/nl'); + + $(window).bind('validatorsLoaded', function () { + + $.formUtils.LANG = { + andSpaces: ' en spaties ', + badAlphaNumeric: 'De ingevoerde waarde mag alleen alfabetische karakters bevatten', + badAlphaNumericExtra: ' en ', + badCVV: 'Het CVV nummer was onjuist', + badCreditCard: 'Het creditcardnummer is onjuist', + badCustomVal: 'De ingevoerde waarde is onjuist', + badDate: 'U heeft niet de juiste datum aangegeven', + badDomain: 'Incorrect domein', + badEmail: 'U heeft een onjuist e-mailadres ingevoerd ', + badInt: 'De ingevoerde waarde was een onjuist getal', + badNumberOfSelectedOptionsEnd: ' antwoorden', + badNumberOfSelectedOptionsStart: 'U moet tenminste ', + badSecurityAnswer: 'U heeft de beveilingsvraag onjuist beantwoord', + badSecurityNumber: 'Uw burgerservicenummer was incorrect', + badStrength: 'Het wachtwoord is niet veilig genoeg', + badTelephone: 'U heeft een onjuist telefoonnummer ingevoerd', + badTime: 'U heeft een incorrecte tijd aangegeven', + badUrl: 'De ingevoerde waarde is geen correcte URL', + badreCaptcha: 'Bevestig a.u.b. dat u geen robot bent', + errorTitle: 'Indienen van formulier mislukt!', + groupCheckedEnd: ' item(s)', + groupCheckedRangeStart: 'Kies a.u.b. tussen ', + groupCheckedTooFewStart: 'Kies a.u.b. ten minste ', + groupCheckedTooManyStart: 'Kies a.u.b. maximaal ', + imageRatioNotAccepted: 'De afbeeldingsverhouding wordt niet geaccepteerd', + imageTooSmall: 'de afbeelding was te klein', + imageTooTall: 'de afbeelding kan niet langer zijn dan', + imageTooWide: 'de afbeelding kan niet wijder zijn dan', + lengthBadEnd: ' karakters', + lengthBadStart: 'De ingevoerde waarde moet liggen tussen ', + lengthTooLongStart: 'De ingevoerde waarde is langer dan ', + lengthTooShortStart: 'De ingevoerde waarde is korter dan ', + max: 'max', + min: 'min', + notConfirmed: 'Invoerwaarden konden niet worden bevestigd', + requiredField: 'Dit is een verplicht veld', + requiredFields: 'U heeft niet alle verplichte velden ingevuld', + wrongFileDim: 'Incorrecte afbeeldingsafmetingen,', + wrongFileSize: 'Het bestand dat u probeert te uploaden is te groot (max %s)', + wrongFileType: 'Alleen type %s bestanden zijn toegestaan' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/no.js b/form-validator/lang/no.js index 01ef7f9..83882a3 100644 --- a/form-validator/lang/no.js +++ b/form-validator/lang/no.js @@ -1,9 +1,82 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Norwegian language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/no"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={andSpaces:" og mellomrom ",badAlphaNumeric:"Inntastningsverdien kan kun inneholde alfanumeriske tegn ",badAlphaNumericExtra:" og ",badCVV:"CVV-nummeret var ikke korrekt",badCreditCard:"Kredittkortnummeret er ikke korrekt",badCustomVal:"Inntastingsverdien er ikke korrekt",badDate:"Du har ikke oppgitt en korrekt dato",badDomain:"Ukorrekt domeneverdi",badEmail:"Du har ikke oppgitt en korrekt e-postadresse",badInt:"Inntastingsverdien er ikke et korrekt tall",badNumberOfSelectedOptionsEnd:" svar",badNumberOfSelectedOptionsStart:"Du må velge minst ",badSecurityAnswer:"Du har ikke oppgitt et korrekt svar på sikkerhetsspørsmålet",badSecurityNumber:"Ditt personnummer var ukorrekt",badStrength:"Passordet er ikke sterkt nok",badTelephone:"Du har ikke oppgitt et korrekt telefonnummer",badTime:"Du har ikke oppgitt en korrekt tid",badUrl:"Inntastingsverdien er ikke en korrekt URL",badreCaptcha:"Vennligst bekreft at du ikke er en robot",errorTitle:"Innsending av skjemaet feilet!",groupCheckedEnd:" ting",groupCheckedRangeStart:"Vennligst velg mellom ",groupCheckedTooFewStart:"Vennligst velg minst ",groupCheckedTooManyStart:"Vennligst velg maksimum ",imageRatioNotAccepted:"Bildestørrelse ikke akseptert",imageTooSmall:"bildet er for lite",imageTooTall:"bildet kan ikke være høyere enn",imageTooWide:"bildet kan ikke være bredere enn",lengthBadEnd:"tegn",lengthBadStart:"Inntastingsverdien må være mellom ",lengthTooLongStart:"Inntastingsverdien er lenger enn ",lengthTooShortStart:"Inntastingsverdien er kortere enn ",max:"maks",min:"min",notConfirmed:"Inntastingsverdier kunne ikke bekreftes",requiredField:"Dette er et obligatorisk felt",requiredFields:"Du har ikke besvart alle obligatoriske felt",wrongFileDim:"Ukorrekte bildedimensjoner,",wrongFileSize:"Bildet du prøver å laste opp er for stort (max %s)",wrongFileType:"Kun filer av type %s er tillatt"}})}(a,window)}); \ No newline at end of file +(function ($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/no'); + + $(window).bind('validatorsLoaded', function () { + + $.formUtils.LANG = { + andSpaces: ' og mellomrom ', + badAlphaNumeric: 'Inntastningsverdien kan kun inneholde alfanumeriske tegn ', + badAlphaNumericExtra: ' og ', + badCVV: 'CVV-nummeret var ikke korrekt', + badCreditCard: 'Kredittkortnummeret er ikke korrekt', + badCustomVal: 'Inntastingsverdien er ikke korrekt', + badDate: 'Du har ikke oppgitt en korrekt dato', + badDomain: 'Ukorrekt domeneverdi', + badEmail: 'Du har ikke oppgitt en korrekt e-postadresse', + badInt: 'Inntastingsverdien er ikke et korrekt tall', + badNumberOfSelectedOptionsEnd: ' svar', + badNumberOfSelectedOptionsStart: 'Du må velge minst ', + badSecurityAnswer: 'Du har ikke oppgitt et korrekt svar på sikkerhetsspørsmålet', + badSecurityNumber: 'Ditt personnummer var ukorrekt', + badStrength: 'Passordet er ikke sterkt nok', + badTelephone: 'Du har ikke oppgitt et korrekt telefonnummer', + badTime: 'Du har ikke oppgitt en korrekt tid', + badUrl: 'Inntastingsverdien er ikke en korrekt URL', + badreCaptcha: 'Vennligst bekreft at du ikke er en robot', + errorTitle: 'Innsending av skjemaet feilet!', + groupCheckedEnd: ' ting', + groupCheckedRangeStart: 'Vennligst velg mellom ', + groupCheckedTooFewStart: 'Vennligst velg minst ', + groupCheckedTooManyStart: 'Vennligst velg maksimum ', + imageRatioNotAccepted: 'Bildestørrelse ikke akseptert', + imageTooSmall: 'bildet er for lite', + imageTooTall: 'bildet kan ikke være høyere enn', + imageTooWide: 'bildet kan ikke være bredere enn', + lengthBadEnd: 'tegn', + lengthBadStart: 'Inntastingsverdien må være mellom ', + lengthTooLongStart: 'Inntastingsverdien er lenger enn ', + lengthTooShortStart: 'Inntastingsverdien er kortere enn ', + max: 'maks', + min: 'min', + notConfirmed: 'Inntastingsverdier kunne ikke bekreftes', + requiredField: 'Dette er et obligatorisk felt', + requiredFields: 'Du har ikke besvart alle obligatoriske felt', + wrongFileDim: 'Ukorrekte bildedimensjoner,', + wrongFileSize: 'Bildet du prøver å laste opp er for stort (max %s)', + wrongFileType: 'Kun filer av type %s er tillatt' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/pl.js b/form-validator/lang/pl.js index b3005cf..3ec17fe 100644 --- a/form-validator/lang/pl.js +++ b/form-validator/lang/pl.js @@ -1,9 +1,91 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Polish language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/pl"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Złożenie formularza nie powiodło się!",requiredField:"To pole jest wymagane",requiredfields:"Nie wszystkie wymagane pola zostały wypełnione",badTime:"Wprowadzono niepoprawny czas",badEmail:"Wprowadzono niepoprawny adres e-mail",badTelephone:"Wprowadzono niepoprawny numeru telefonu",badSecurityAnswer:"Nieprawidłowa odpowiedź na pytanie bezpieczeństwa",badDate:"Niepoprawna data",lengthBadStart:"Wprowadzona wartość musi być pomiędzy ",lengthBadEnd:" znaków",lengthTooLongStart:"Wprowadzona wartość jest większa niż ",lengthTooShortStart:"Wprowadzona wartość jest mniejsza niż ",notConfirmed:"Wprowadzone wartości nie zostały potwierdzone",badDomain:"Nieprawidłowa wartość domeny",badUrl:"Wprowadzono nieprawidłowy adres URL",badCustomVal:"Wprowadzona wartość jest niepoprawna",andSpaces:" i odstępy",badInt:"Wprowadzono nieprawidłowy numer",badSecurityNumber:"Wprowadzono niepoprawny numer ubezpieczenia społecznego",badUKVatAnswer:"Wprowadzono niepoprawny brytyjski numer VAT",badUKNin:"Wprowadzono niepoprawny brytyjski numer NIP",badUKUtr:"Wprowadzono niepoprawny brytyjski numer podatnika",badStrength:"Twoje hasło nie jest wystarczająco mocne",badNumberOfSelectedOptionsStart:"Musisz wybrać przynajmniej ",badNumberOfSelectedOptionsEnd:" odpowiedzi",badAlphaNumeric:"Wprowadzona wartość może zawierać tylko znaki alfanumeryczne ",badAlphaNumericExtra:" i ",wrongFileSize:"Wysyłany plik jest zbyt duży (max %s)",wrongFileType:"Dozwolone są tylko pliki typu %s",groupCheckedRangeStart:"Proszę wybrać pomiędzy ",groupCheckedTooFewStart:"Proszę wybrać przynajmniej ",groupCheckedTooManyStart:"Proszę wybrać maksymalnie ",groupCheckedEnd:" element(ów)",badCreditCard:"Podany numer karty kredytowej jest nieprawidłowy",badCVV:"Podany numer CVV jest nieprawidłowy",wrongFileDim:"Nieprawidłowe wymiary obrazu,",imageTooTall:"obraz nie może być wyższa niż",imageTooWide:"obraz nie może być szerszy niż",imageTooSmall:"obraz jest zbyt mały",min:"min",max:"max",imageRatioNotAccepted:"Proporcje obrazu są niepoprawne",badBrazilTelephoneAnswer:"Wprowadzono niepoprawny numer telefonu",badBrazilCEPAnswer:"Wprowadzono niepoprawny CEP",badBrazilCPFAnswer:"Wprowadzono niepoprawny CPF",badPlPesel:"Wprowadzono niepoprawny numer PESEL",badPlNip:"Wprowadzono niepoprawny numer NIP",badPlRegon:"Wprowadzono niepoprawny numer REGON",badreCaptcha:"Potwierdź że nie jesteś botem!"}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/pl'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'Złożenie formularza nie powiodło się!', + requiredField: 'To pole jest wymagane', + requiredfields: 'Nie wszystkie wymagane pola zostały wypełnione', + badTime: 'Wprowadzono niepoprawny czas', + badEmail: 'Wprowadzono niepoprawny adres e-mail', + badTelephone: 'Wprowadzono niepoprawny numeru telefonu', + badSecurityAnswer: 'Nieprawidłowa odpowiedź na pytanie bezpieczeństwa', + badDate: 'Niepoprawna data', + lengthBadStart: 'Wprowadzona wartość musi być pomiędzy ', + lengthBadEnd: ' znaków', + lengthTooLongStart: 'Wprowadzona wartość jest większa niż ', + lengthTooShortStart: 'Wprowadzona wartość jest mniejsza niż ', + notConfirmed: 'Wprowadzone wartości nie zostały potwierdzone', + badDomain: 'Nieprawidłowa wartość domeny', + badUrl: 'Wprowadzono nieprawidłowy adres URL', + badCustomVal: 'Wprowadzona wartość jest niepoprawna', + andSpaces: ' i odstępy', + badInt: 'Wprowadzono nieprawidłowy numer', + badSecurityNumber: 'Wprowadzono niepoprawny numer ubezpieczenia społecznego', + badUKVatAnswer: 'Wprowadzono niepoprawny brytyjski numer VAT', + badUKNin: 'Wprowadzono niepoprawny brytyjski numer NIP', + badUKUtr: 'Wprowadzono niepoprawny brytyjski numer podatnika', + badStrength: 'Twoje hasło nie jest wystarczająco mocne', + badNumberOfSelectedOptionsStart: 'Musisz wybrać przynajmniej ', + badNumberOfSelectedOptionsEnd: ' odpowiedzi', + badAlphaNumeric: 'Wprowadzona wartość może zawierać tylko znaki alfanumeryczne ', + badAlphaNumericExtra: ' i ', + wrongFileSize: 'Wysyłany plik jest zbyt duży (max %s)', + wrongFileType: 'Dozwolone są tylko pliki typu %s', + groupCheckedRangeStart: 'Proszę wybrać pomiędzy ', + groupCheckedTooFewStart: 'Proszę wybrać przynajmniej ', + groupCheckedTooManyStart: 'Proszę wybrać maksymalnie ', + groupCheckedEnd: ' element(ów)', + badCreditCard: 'Podany numer karty kredytowej jest nieprawidłowy', + badCVV: 'Podany numer CVV jest nieprawidłowy', + wrongFileDim: 'Nieprawidłowe wymiary obrazu,', + imageTooTall: 'obraz nie może być wyższa niż', + imageTooWide: 'obraz nie może być szerszy niż', + imageTooSmall: 'obraz jest zbyt mały', + min: 'min', + max: 'max', + imageRatioNotAccepted: 'Proporcje obrazu są niepoprawne', + badBrazilTelephoneAnswer: 'Wprowadzono niepoprawny numer telefonu', + badBrazilCEPAnswer: 'Wprowadzono niepoprawny CEP', + badBrazilCPFAnswer: 'Wprowadzono niepoprawny CPF', + badPlPesel: 'Wprowadzono niepoprawny numer PESEL', + badPlNip: 'Wprowadzono niepoprawny numer NIP', + badPlRegon: 'Wprowadzono niepoprawny numer REGON', + badreCaptcha: 'Potwierdź że nie jesteś botem!' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/pt.js b/form-validator/lang/pt.js index 22b6994..354058b 100644 --- a/form-validator/lang/pt.js +++ b/form-validator/lang/pt.js @@ -1,9 +1,85 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Portuguese language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/pt"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"O formulário não pode ser enviado!",requiredField:"Campo de preenchimento obrigatório",requiredFields:"Você ainda não preencheu todos os campos obrigatórios",badTime:"A hora digitada não é válida",badEmail:"O e-mail digitado não é válido",badTelephone:"O telefone digitado não é válido",badSecurityAnswer:"A pergunta de segurança não foi respondida corretamente",badDate:"A data digitada não é válida",lengthBadStart:"Sua resposta deve incluir entre ",lengthBadEnd:" caracteres",lengthTooLongStart:"Sua resposta tem mais que ",lengthTooShortStart:"Sua resposta tem menos que",notConfirmed:"As informações digitadas não puderam ser confirmadas",badDomain:"O domínio digitado não é válido",badUrl:"A URL digitada não é válida",badCustomVal:"Os dados digitados não são válidos",andSpaces:" e espaços",badInt:"O número digitado não é válido",badSecurityNumber:"O número de seguro social digitado não é válido",badUKVatAnswer:"O número do VAT digitado não é válido para o Reino Unido",badStrength:"Senha muito fraca",badNumberOfSelectedOptionsStart:"Selecione pelo menos",badNumberOfSelectedOptionsEnd:" alternativa(s)",badAlphaNumeric:"Use somente caracteres alfanuméricos (letras a-z e números)",badAlphaNumericExtra:" e",wrongFileSize:"O arquivo selecionado é maior que o tamanho máximo permitido (%s)",wrongFileType:"Somente arquivos %s são permitidos",groupCheckedRangeStart:"Por favor, escolha entre ",groupCheckedTooFewStart:"Por favor, escolha pelo menos ",groupCheckedTooManyStart:"Por favor, escolhe no máximo ",groupCheckedEnd:" alternativa(s)",badCreditCard:"O número de cartão de crédito digitado não é válido",badCVV:"O código de segurança do cartão de crédito não é válido",wrongFileDim:"As dimensões da imagem não são válidas",imageTooTall:"a imagem não pode ser mais alta que ",imageTooWide:"a imagem não pode ser mais larga que ",imageTooSmall:"a imagem é muito pequena",min:"min",max:"max",imageRatioNotAccepted:"A proporção da imagem (largura x altura) não é válida",badBrazilTelephoneAnswer:"O número de telefone digitado é inválido",badBrazilCEPAnswer:"O CEP digitado é inválido",badBrazilCPFAnswer:"O CPF digitado é inválido"}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/pt'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'O formulário não pode ser enviado!', + requiredField: 'Campo de preenchimento obrigatório', + requiredFields: 'Você ainda não preencheu todos os campos obrigatórios', + badTime: 'A hora digitada não é válida', + badEmail: 'O e-mail digitado não é válido', + badTelephone: 'O telefone digitado não é válido', + badSecurityAnswer: 'A pergunta de segurança não foi respondida corretamente', + badDate: 'A data digitada não é válida', + lengthBadStart: 'Sua resposta deve incluir entre ', + lengthBadEnd: ' caracteres', + lengthTooLongStart: 'Sua resposta tem mais que ', + lengthTooShortStart: 'Sua resposta tem menos que', + notConfirmed: 'As informações digitadas não puderam ser confirmadas', + badDomain: 'O domínio digitado não é válido', + badUrl: 'A URL digitada não é válida', + badCustomVal: 'Os dados digitados não são válidos', + andSpaces: ' e espaços', + badInt: 'O número digitado não é válido', + badSecurityNumber: 'O número de seguro social digitado não é válido', + badUKVatAnswer: 'O número do VAT digitado não é válido para o Reino Unido', + badStrength: 'Senha muito fraca', + badNumberOfSelectedOptionsStart: 'Selecione pelo menos', + badNumberOfSelectedOptionsEnd: ' alternativa(s)', + badAlphaNumeric: 'Use somente caracteres alfanuméricos (letras a-z e números)', + badAlphaNumericExtra: ' e', + wrongFileSize: 'O arquivo selecionado é maior que o tamanho máximo permitido (%s)', + wrongFileType: 'Somente arquivos %s são permitidos', + groupCheckedRangeStart: 'Por favor, escolha entre ', + groupCheckedTooFewStart: 'Por favor, escolha pelo menos ', + groupCheckedTooManyStart: 'Por favor, escolhe no máximo ', + groupCheckedEnd: ' alternativa(s)', + badCreditCard: 'O número de cartão de crédito digitado não é válido', + badCVV: 'O código de segurança do cartão de crédito não é válido', + wrongFileDim: 'As dimensões da imagem não são válidas', + imageTooTall: 'a imagem não pode ser mais alta que ', + imageTooWide: 'a imagem não pode ser mais larga que ', + imageTooSmall: 'a imagem é muito pequena', + min: 'min', + max: 'max', + imageRatioNotAccepted : 'A proporção da imagem (largura x altura) não é válida', + badBrazilTelephoneAnswer: 'O número de telefone digitado é inválido', + badBrazilCEPAnswer: 'O CEP digitado é inválido', + badBrazilCPFAnswer: 'O CPF digitado é inválido' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/ro.js b/form-validator/lang/ro.js index 562d90e..1df78c1 100644 --- a/form-validator/lang/ro.js +++ b/form-validator/lang/ro.js @@ -1,9 +1,85 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Romanian language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/ro"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Nu sa reusit lansarea formularului!",requiredField:"Acest câmp este obligatoriu",requiredfields:"Nu toate câmpurile obligatorii au fost completate",badTime:"Timpul introdus este incorect",badEmail:"Adresa de e-mail este incorectă",badTelephone:"Numărul de telefon este incorect",badSecurityAnswer:"Răspuns incorect la întrebarea de siguran?ă",badDate:"Dară incorectă",lengthBadStart:"Valoarea introdusă trebuie să fie interval ",lengthBadEnd:" caractere",lengthTooLongStart:"Valoarea introdusă este mai mare decât ",lengthTooShortStart:"Valoarea introdusă este mai mică decât ",notConfirmed:"Valorile introduse nu au fost confirmate",badDomain:"Domeniul este incorect",badUrl:"Adresa URL este incorectă",badCustomVal:"Valoarea introdusă este incorectă",andSpaces:" şi spaţierea",badInt:"Numărul introdus este incorect",badSecurityNumber:"Numărul de asigurare introdus este incorect",badUKVatAnswer:"Numărul CIF introdus este incorect",badStrength:"Parola Dvs nu este suficient de sigură",badNumberOfSelectedOptionsStart:"Trebuie să alegi măcar ",badNumberOfSelectedOptionsEnd:" răspunsuri",badAlphaNumeric:"Valoarea introdusă trebuie să con însă doar caractere alfanumerice ",badAlphaNumericExtra:" și ",wrongFileSize:"Fisierul trimis este prea mare (max %s)",wrongFileType:"Se acceptă doar fisiere tip %s",groupCheckedRangeStart:"Te rog alege între ",groupCheckedTooFewStart:"Te rog alege măcar ",groupCheckedTooManyStart:"Te rog alege maxim ",groupCheckedEnd:" elemnt(e)",badCreditCard:"Numărul de card introdus este incorect",badCVV:"Numărul CVV introdus este incorect",wrongFileDim:"Dimensiunea imaginii este incorectă,",imageTooTall:"imaginea nu poate fi mai înaltă decât",imageTooWide:"imaginea nu poate fi mai lată decât",imageTooSmall:"imaginea este prea mică",min:"min",max:"max",imageRatioNotAccepted:"Proportiile imaginii sunt incorecte",badBrazilTelephoneAnswer:"Numărul de telefon introdus este incorect.",badBrazilCEPAnswer:"CEP incorect",badBrazilCPFAnswer:"CPF incorect"}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/ro'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'Nu sa reusit lansarea formularului!', + requiredField: 'Acest câmp este obligatoriu', + requiredfields: 'Nu toate câmpurile obligatorii au fost completate', + badTime: 'Timpul introdus este incorect', + badEmail: 'Adresa de e-mail este incorectă', + badTelephone: 'Numărul de telefon este incorect', + badSecurityAnswer: 'Răspuns incorect la întrebarea de siguran?ă', + badDate: 'Dară incorectă', + lengthBadStart: 'Valoarea introdusă trebuie să fie interval ', + lengthBadEnd: ' caractere', + lengthTooLongStart: 'Valoarea introdusă este mai mare decât ', + lengthTooShortStart: 'Valoarea introdusă este mai mică decât ', + notConfirmed: 'Valorile introduse nu au fost confirmate', + badDomain: 'Domeniul este incorect', + badUrl: 'Adresa URL este incorectă', + badCustomVal: 'Valoarea introdusă este incorectă', + andSpaces: ' şi spaţierea', + badInt: 'Numărul introdus este incorect', + badSecurityNumber: 'Numărul de asigurare introdus este incorect', + badUKVatAnswer: 'Numărul CIF introdus este incorect', + badStrength: 'Parola Dvs nu este suficient de sigură', + badNumberOfSelectedOptionsStart: 'Trebuie să alegi măcar ', + badNumberOfSelectedOptionsEnd: ' răspunsuri', + badAlphaNumeric: 'Valoarea introdusă trebuie să con însă doar caractere alfanumerice ', + badAlphaNumericExtra: ' și ', + wrongFileSize: 'Fisierul trimis este prea mare (max %s)', + wrongFileType: 'Se acceptă doar fisiere tip %s', + groupCheckedRangeStart: 'Te rog alege între ', + groupCheckedTooFewStart: 'Te rog alege măcar ', + groupCheckedTooManyStart: 'Te rog alege maxim ', + groupCheckedEnd: ' elemnt(e)', + badCreditCard: 'Numărul de card introdus este incorect', + badCVV: 'Numărul CVV introdus este incorect', + wrongFileDim: 'Dimensiunea imaginii este incorectă,', + imageTooTall: 'imaginea nu poate fi mai înaltă decât', + imageTooWide: 'imaginea nu poate fi mai lată decât', + imageTooSmall: 'imaginea este prea mică', + min: 'min', + max: 'max', + imageRatioNotAccepted: 'Proportiile imaginii sunt incorecte', + badBrazilTelephoneAnswer: 'Numărul de telefon introdus este incorect.', + badBrazilCEPAnswer: 'CEP incorect', + badBrazilCPFAnswer: 'CPF incorect' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/ru.js b/form-validator/lang/ru.js index 3bdd43e..f21f857 100644 --- a/form-validator/lang/ru.js +++ b/form-validator/lang/ru.js @@ -1,9 +1,86 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Russian language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/ru"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Ошибка отправки формы!",requiredField:"Это обязательное поле",requiredFields:"Вы задали не все обязательные поля",badTime:"Вы задали некорректное время",badEmail:"Вы задали некорректный e-mail",badTelephone:"Вы задали некорректный номер телефона",badSecurityAnswer:"Вы задали некорректный ответ на секретный вопрос",badDate:"Вы задали некорректную дату",lengthBadStart:"Значение должно быть в диапазоне",lengthBadEnd:" символов",lengthTooLongStart:"Значение длинее, чем ",lengthTooShortStart:"Значение меньше, чем ",notConfirmed:"Введённые значения не могут быть подтверждены",badDomain:"Некорректное значение домена",badUrl:"Некорретный URL",badCustomVal:"Введённое значение неверно",andSpaces:" и пробелы ",badInt:"Значение - не число",badSecurityNumber:"Введённый защитный номер - неправильный",badUKVatAnswer:"Некорректный UK VAT номер",badStrength:"Пароль не достаточно надёжен",badNumberOfSelectedOptionsStart:"Вы должны выбрать как минимум ",badNumberOfSelectedOptionsEnd:" ответов",badAlphaNumeric:"Значение должно содержать только числа и буквы ",badAlphaNumericExtra:" и ",wrongFileSize:"Загружаемый файл слишком велик (максимальный размер %s)",wrongFileType:"Принимаются файлы следующих типов %s",groupCheckedRangeStart:"Выберите между ",groupCheckedTooFewStart:"Выберите как минимум ",groupCheckedTooManyStart:"Выберите максимум из ",groupCheckedEnd:" элемент(ов)",badCreditCard:"Номер кредитной карты некорректен",badCVV:"CVV номер некорректно",wrongFileDim:"Неверные размеры графического файла,",imageTooTall:"изображение не может быть уже чем",imageTooWide:"изображение не может быть шире чем",imageTooSmall:"изображение слишком мало",min:"минимум",max:"максимум",imageRatioNotAccepted:"Изображение с таким соотношением сторон не принимается",badBrazilTelephoneAnswer:"Введённый номер телефона неправильный",badBrazilCEPAnswer:"CEP неправильный",badBrazilCPFAnswer:"CPF неправильный"}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/ru'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + + errorTitle: 'Ошибка отправки формы!', + requiredField: 'Это обязательное поле', + requiredFields: 'Вы задали не все обязательные поля', + badTime: 'Вы задали некорректное время', + badEmail: 'Вы задали некорректный e-mail', + badTelephone: 'Вы задали некорректный номер телефона', + badSecurityAnswer: 'Вы задали некорректный ответ на секретный вопрос', + badDate: 'Вы задали некорректную дату', + lengthBadStart: 'Значение должно быть в диапазоне', + lengthBadEnd: ' символов', + lengthTooLongStart: 'Значение длинее, чем ', + lengthTooShortStart: 'Значение меньше, чем ', + notConfirmed: 'Введённые значения не могут быть подтверждены', + badDomain: 'Некорректное значение домена', + badUrl: 'Некорретный URL', + badCustomVal: 'Введённое значение неверно', + andSpaces: ' и пробелы ', + badInt: 'Значение - не число', + badSecurityNumber: 'Введённый защитный номер - неправильный', + badUKVatAnswer: 'Некорректный UK VAT номер', + badStrength: 'Пароль не достаточно надёжен', + badNumberOfSelectedOptionsStart: 'Вы должны выбрать как минимум ', + badNumberOfSelectedOptionsEnd: ' ответов', + badAlphaNumeric: 'Значение должно содержать только числа и буквы ', + badAlphaNumericExtra: ' и ', + wrongFileSize: 'Загружаемый файл слишком велик (максимальный размер %s)', + wrongFileType: 'Принимаются файлы следующих типов %s', + groupCheckedRangeStart: 'Выберите между ', + groupCheckedTooFewStart: 'Выберите как минимум ', + groupCheckedTooManyStart: 'Выберите максимум из ', + groupCheckedEnd: ' элемент(ов)', + badCreditCard: 'Номер кредитной карты некорректен', + badCVV: 'CVV номер некорректно', + wrongFileDim : 'Неверные размеры графического файла,', + imageTooTall : 'изображение не может быть уже чем', + imageTooWide : 'изображение не может быть шире чем', + imageTooSmall : 'изображение слишком мало', + min : 'минимум', + max : 'максимум', + imageRatioNotAccepted : 'Изображение с таким соотношением сторон не принимается', + badBrazilTelephoneAnswer: 'Введённый номер телефона неправильный', + badBrazilCEPAnswer: 'CEP неправильный', + badBrazilCPFAnswer: 'CPF неправильный' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/sv.js b/form-validator/lang/sv.js index a561f31..debea3a 100644 --- a/form-validator/lang/sv.js +++ b/form-validator/lang/sv.js @@ -1,9 +1,83 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Swedish language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/sv"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Formuläret kunde inte skickas!",requiredField:"Detta är ett obligtoriskt fält",requiredFields:"Du har inte besvarat alla frågor",badTime:"Du har inte angett en korrekt tidpunkt",badEmail:"Du har inte angett en korrekt e-postadress",badTelephone:"Du har inte angett ett korrekt telefonnummer",badSecurityAnswer:"Du har angett fel svar på säkerhetsfrågan",badDate:"Du har anget ett felaktigt datum",lengthBadStart:"Ditt svar måste innehålla mellan ",lengthBadEnd:" tecken",lengthTooLongStart:"Du har angett ett svar som är längre än ",lengthTooShortStart:"Du har angett ett svar som är kortare än ",notConfirmed:"Svaren kunde inte bekräfta varandra",badDomain:"Du har angett en inkorrekt domän",badUrl:"Du har inte angett en korrekt webbadress",badCustomVal:"Du har anget ett inkorrekt svar",andSpaces:" och mellanslag ",badInt:"Du har inte angett en siffra",badSecurityNumber:"Du har angett ett felaktigt personnummer",badUKVatAnswer:"Du har inte angett ett brittiskt moms-nummer",badStrength:"Du har angett ett lösenord som inte är nog säkert",badNumberOfSelectedOptionsStart:"Du måste åtminstone välja ",badNumberOfSelectedOptionsEnd:" svarsalternativ",badAlphaNumeric:"Du kan endast svara med alfanumersika tecken (a-z och siffror)",badAlphaNumericExtra:" och ",wrongFileSize:"Filen du försöker ladda upp är för stor (max %s)",wrongFileType:"Endast filer av typen %s är tillåtna",groupCheckedRangeStart:"Välj mellan ",groupCheckedTooFewStart:"Då måste göra minst ",groupCheckedTooManyStart:"Du får inte göra fler än ",groupCheckedEnd:" val",badCreditCard:"Du har angett ett felaktigt kreditkortsnummer",badCVV:"Du har angett ett felaktigt CVV-nummer",wrongFileDim:"Otillåten bildstorlek,",imageTooTall:"bilden får inte vara högre än",imageTooWide:"bilden får inte vara bredare än",imageTooSmall:"bilden är för liten",genericBadInputValue:"The input value can be accepted",min:"minst",max:"max",imageRatioNotAccepted:"Bildens dimensioner (förhållandet mellan höjd och längd) kan inte accepteras"}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/sv'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'Formuläret kunde inte skickas!', + requiredField: 'Detta är ett obligtoriskt fält', + requiredFields: 'Du har inte besvarat alla frågor', + badTime: 'Du har inte angett en korrekt tidpunkt', + badEmail: 'Du har inte angett en korrekt e-postadress', + badTelephone: 'Du har inte angett ett korrekt telefonnummer', + badSecurityAnswer: 'Du har angett fel svar på säkerhetsfrågan', + badDate: 'Du har anget ett felaktigt datum', + lengthBadStart: 'Ditt svar måste innehålla mellan ', + lengthBadEnd: ' tecken', + lengthTooLongStart: 'Du har angett ett svar som är längre än ', + lengthTooShortStart: 'Du har angett ett svar som är kortare än ', + notConfirmed: 'Svaren kunde inte bekräfta varandra', + badDomain: 'Du har angett en inkorrekt domän', + badUrl: 'Du har inte angett en korrekt webbadress', + badCustomVal: 'Du har anget ett inkorrekt svar', + andSpaces: ' och mellanslag ', + badInt: 'Du har inte angett en siffra', + badSecurityNumber: 'Du har angett ett felaktigt personnummer', + badUKVatAnswer: 'Du har inte angett ett brittiskt moms-nummer', + badStrength: 'Du har angett ett lösenord som inte är nog säkert', + badNumberOfSelectedOptionsStart: 'Du måste åtminstone välja ', + badNumberOfSelectedOptionsEnd: ' svarsalternativ', + badAlphaNumeric: 'Du kan endast svara med alfanumersika tecken (a-z och siffror)', + badAlphaNumericExtra: ' och ', + wrongFileSize: 'Filen du försöker ladda upp är för stor (max %s)', + wrongFileType: 'Endast filer av typen %s är tillåtna', + groupCheckedRangeStart: 'Välj mellan ', + groupCheckedTooFewStart: 'Då måste göra minst ', + groupCheckedTooManyStart: 'Du får inte göra fler än ', + groupCheckedEnd: ' val', + badCreditCard: 'Du har angett ett felaktigt kreditkortsnummer', + badCVV: 'Du har angett ett felaktigt CVV-nummer', + wrongFileDim : 'Otillåten bildstorlek,', + imageTooTall : 'bilden får inte vara högre än', + imageTooWide : 'bilden får inte vara bredare än', + imageTooSmall : 'bilden är för liten', + genericBadInputValue : 'The input value can be accepted', + min : 'minst', + max : 'max', + imageRatioNotAccepted : 'Bildens dimensioner (förhållandet mellan höjd och längd) kan inte accepteras' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/tr.js b/form-validator/lang/tr.js index 7ffef8e..0e57561 100644 --- a/form-validator/lang/tr.js +++ b/form-validator/lang/tr.js @@ -1,9 +1,98 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Turkish language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/tr"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Form gönderilemedi!",requiredField:"Boş bırakılamaz",requiredFields:"Gerekli tüm alanları cevaplamadınız",badTime:"Geçersiz zaman girdiniz",badEmail:"Geçersiz e-posta adresi girdiniz",badTelephone:"Geçersiz telefon numarası girdiniz",badSecurityAnswer:"Güvenlik sorusuna doğru cevap vermediniz",badDate:"Geçersiz tarih girdiniz",lengthBadStart:"Girilen değer ",lengthBadEnd:" karakter olmalıdır",lengthTooLongStart:"Girilen değer en fazla ",lengthTooShortStart:"Girilen değer en az ",notConfirmed:"Girilen değerler uyuşmuyor",badDomain:"Geçersiz alan adı girdiniz",badUrl:"Geçersiz bağlantı girdiniz",badCustomVal:"Geçersiz değer girdiniz",andSpaces:" ve boşluk ",badInt:"Girilen değer sayı olamlıdır",badSecurityNumber:"Geçersiz güvenlik kodu girdiniz",badUKVatAnswer:"Geçersiz İngiltere KDV numarası girdiniz",badUKNin:"Geçersiz İngiltere NIN numarası girdiniz",badUKUtr:"Geçersiz İngiltere UTR numarası girdiniz",badStrength:"Şifreniz yeterince güçlü değil",badNumberOfSelectedOptionsStart:"En az ",badNumberOfSelectedOptionsEnd:" cevap seçmeniz gerekiyor",badAlphaNumeric:"Kabul edilen değer sadece alfanümerik karakterler ",badAlphaNumericExtra:" ve ",wrongFileSize:"Yüklemeye çalıştığınız dosya (en fazla %s) çok büyük",wrongFileType:"Yalnızca %s türündeki dosyaları yükleyebilirsiniz",groupCheckedRangeStart:"Lütfen ",groupCheckedTooFewStart:"Lütfen en az ",groupCheckedTooManyStart:"Lütfen en fazla ",groupCheckedEnd:" adet seçiniz",badCreditCard:"Geçersiz kredi kartı numarası girdiniz",badCVV:"Geçersiz CVV numarası girdiniz",wrongFileDim:"Hatalı resim yüklediniz çünkü",imageTooTall:"resim daha uzun olamaz",imageTooWide:"resim daha geniş olamaz",imageTooSmall:"görüntü çok küçük",min:"min",max:"max",imageRatioNotAccepted:"Kabul edilmeye görüntü oranı",badBrazilTelephoneAnswer:"Geçersiz telefon numarası girdiniz",badBrazilCEPAnswer:"Geçersiz Brezilya posta kodu girdiniz",badBrazilCPFAnswer:"Geçersiz Brezilya mükellef kayıt kimliği girdiniz",badPlPesel:"Geçersiz Polonya kişisel kimlik numarası girdiniz",badPlNip:"Geçersiz DKV girdiniz",badPlRegon:"Geçersiz Polonya ticari kimlik numarası girdiniz",badreCaptcha:"Lütfen bot olmadığınızı doğrulayın",passwordComplexityStart:"Şifreniz en az ",passwordComplexitySeparator:", ",passwordComplexityUppercaseInfo:" büyük harf",passwordComplexityLowercaseInfo:" küçük harf",passwordComplexitySpecialCharsInfo:" özel karakter",passwordComplexityNumericCharsInfo:" sayısal karakter",passwordComplexityEnd:" içermelidir"}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/tr'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'Form gönderilemedi!', + requiredField: 'Boş bırakılamaz', + requiredFields: 'Gerekli tüm alanları cevaplamadınız', + badTime: 'Geçersiz zaman girdiniz', + badEmail: 'Geçersiz e-posta adresi girdiniz', + badTelephone: 'Geçersiz telefon numarası girdiniz', + badSecurityAnswer: 'Güvenlik sorusuna doğru cevap vermediniz', + badDate: 'Geçersiz tarih girdiniz', + lengthBadStart: 'Girilen değer ', + lengthBadEnd: ' karakter olmalıdır', + lengthTooLongStart: 'Girilen değer en fazla ', + lengthTooShortStart: 'Girilen değer en az ', + notConfirmed: 'Girilen değerler uyuşmuyor', + badDomain: 'Geçersiz alan adı girdiniz', + badUrl: 'Geçersiz bağlantı girdiniz', + badCustomVal: 'Geçersiz değer girdiniz', + andSpaces: ' ve boşluk ', + badInt: 'Girilen değer sayı olamlıdır', + badSecurityNumber: 'Geçersiz güvenlik kodu girdiniz', + badUKVatAnswer: 'Geçersiz İngiltere KDV numarası girdiniz', + badUKNin: 'Geçersiz İngiltere NIN numarası girdiniz', + badUKUtr: 'Geçersiz İngiltere UTR numarası girdiniz', + badStrength: 'Şifreniz yeterince güçlü değil', + badNumberOfSelectedOptionsStart: 'En az ', + badNumberOfSelectedOptionsEnd: ' cevap seçmeniz gerekiyor', + badAlphaNumeric: 'Kabul edilen değer sadece alfanümerik karakterler ', + badAlphaNumericExtra: ' ve ', + wrongFileSize: 'Yüklemeye çalıştığınız dosya (en fazla %s) çok büyük', + wrongFileType: 'Yalnızca %s türündeki dosyaları yükleyebilirsiniz', + groupCheckedRangeStart: 'Lütfen ', + groupCheckedTooFewStart: 'Lütfen en az ', + groupCheckedTooManyStart: 'Lütfen en fazla ', + groupCheckedEnd: ' adet seçiniz', + badCreditCard: 'Geçersiz kredi kartı numarası girdiniz', + badCVV: 'Geçersiz CVV numarası girdiniz', + wrongFileDim: 'Hatalı resim yüklediniz çünkü', + imageTooTall: 'resim daha uzun olamaz', + imageTooWide: 'resim daha geniş olamaz', + imageTooSmall: 'görüntü çok küçük', + min: 'min', + max: 'max', + imageRatioNotAccepted: 'Kabul edilmeye görüntü oranı', + badBrazilTelephoneAnswer: 'Geçersiz telefon numarası girdiniz', + badBrazilCEPAnswer: 'Geçersiz Brezilya posta kodu girdiniz', + badBrazilCPFAnswer: 'Geçersiz Brezilya mükellef kayıt kimliği girdiniz', + badPlPesel: 'Geçersiz Polonya kişisel kimlik numarası girdiniz', + badPlNip: 'Geçersiz DKV girdiniz', + badPlRegon: 'Geçersiz Polonya ticari kimlik numarası girdiniz', + badreCaptcha: 'Lütfen bot olmadığınızı doğrulayın', + passwordComplexityStart: 'Şifreniz en az ', + passwordComplexitySeparator: ', ', + passwordComplexityUppercaseInfo: ' büyük harf', + passwordComplexityLowercaseInfo: ' küçük harf', + passwordComplexitySpecialCharsInfo: ' özel karakter', + passwordComplexityNumericCharsInfo: ' sayısal karakter', + passwordComplexityEnd: ' içermelidir' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/lang/vi.js b/form-validator/lang/vi.js index 22993c6..3815167 100644 --- a/form-validator/lang/vi.js +++ b/form-validator/lang/vi.js @@ -1,9 +1,81 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator + * ------------------------------------------ * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * Vietnamese language package + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/vi"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Có lỗi trong qua trình gửi dữ liệu!",requiredFields:"Bạn chưa nhập đủ các thông tin bắt buộc",badTime:"Thời gian chưa chính xác",badEmail:"Địa chỉ email chưa chính xác",badTelephone:"Số điện thoại chưa chính xác",badSecurityAnswer:"Câu hỏi bảo mật chưa chính xác",badDate:"Ngày tháng chưa chính xác",lengthBadStart:"Yêu cầu nhập từ ",lengthBadEnd:" ký tự",lengthTooLongStart:"Dữ liệu quá dài, yêu cầu ít hơn ",lengthTooShortStart:"Dữ liệu quá ngắn, yêu cầu nhiều hơn ",notConfirmed:"Dữ liệu không được xác nhận",badDomain:"Tên miền chưa chính xác",badUrl:"Địa chỉ website chưa chính xác",badCustomVal:"Dữ liệu chưa chính xác",andSpaces:" và các khoảng cách ",badInt:"Yêu cầu chỉ nhập số",badSecurityNumber:"Mã bảo mật chưa chính xác",badUKVatAnswer:"UK VAT chưa chính xác",badStrength:"Mật khẩu chưa đủ độ phức tạp",badNumberOfSelectedOptionsStart:"Bạn cần tích chọn ít nhất ",badNumberOfSelectedOptionsEnd:" lựa chọn",badAlphaNumeric:"Yêu cầu chỉ nhập chữ hoặc số ",badAlphaNumericExtra:" và ",wrongFileSize:"File của bạn quá lớn (chỉ chấp nhận file không quá %s)",wrongFileType:"Chỉ cho phép các định dạng file sau: %s",groupCheckedRangeStart:"Vui lòng tích chọn từ ",groupCheckedTooFewStart:"Vui lòng tích chọn ít nhất ",groupCheckedTooManyStart:"Vui lòng tích chọn nhiều nhất ",groupCheckedEnd:" lựa chọn",badCreditCard:"Mã thẻ chưa chính xác",badCVV:"Mã bảo mật (CVV) chưa chính xác",wrongFileDim:"Kích thước ảnh chưa chính xác,",imageTooTall:"Chiều cao ảnh không được vượt quá",imageTooWide:"Chiều rộng ảnh không được vượt quá",imageTooSmall:"Kích thước ảnh quá nhỏ",min:"nhỏ nhất",max:"lớn nhất",imageRatioNotAccepted:"Tỷ lệ ảnh chưa chính xác"}})}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('lang/vi'); + + $(window).bind('validatorsLoaded', function() { + + $.formUtils.LANG = { + errorTitle: 'Có lỗi trong qua trình gửi dữ liệu!', + requiredFields: 'Bạn chưa nhập đủ các thông tin bắt buộc', + badTime: 'Thời gian chưa chính xác', + badEmail: 'Địa chỉ email chưa chính xác', + badTelephone: 'Số điện thoại chưa chính xác', + badSecurityAnswer: 'Câu hỏi bảo mật chưa chính xác', + badDate: 'Ngày tháng chưa chính xác', + lengthBadStart: 'Yêu cầu nhập từ ', + lengthBadEnd: ' ký tự', + lengthTooLongStart: 'Dữ liệu quá dài, yêu cầu ít hơn ', + lengthTooShortStart: 'Dữ liệu quá ngắn, yêu cầu nhiều hơn ', + notConfirmed: 'Dữ liệu không được xác nhận', + badDomain: 'Tên miền chưa chính xác', + badUrl: 'Địa chỉ website chưa chính xác', + badCustomVal: 'Dữ liệu chưa chính xác', + andSpaces: ' và các khoảng cách ', + badInt: 'Yêu cầu chỉ nhập số', + badSecurityNumber: 'Mã bảo mật chưa chính xác', + badUKVatAnswer: 'UK VAT chưa chính xác', + badStrength: 'Mật khẩu chưa đủ độ phức tạp', + badNumberOfSelectedOptionsStart: 'Bạn cần tích chọn ít nhất ', + badNumberOfSelectedOptionsEnd: ' lựa chọn', + badAlphaNumeric: 'Yêu cầu chỉ nhập chữ hoặc số ', + badAlphaNumericExtra: ' và ', + wrongFileSize: 'File của bạn quá lớn (chỉ chấp nhận file không quá %s)', + wrongFileType: 'Chỉ cho phép các định dạng file sau: %s', + groupCheckedRangeStart: 'Vui lòng tích chọn từ ', + groupCheckedTooFewStart: 'Vui lòng tích chọn ít nhất ', + groupCheckedTooManyStart: 'Vui lòng tích chọn nhiều nhất ', + groupCheckedEnd: ' lựa chọn', + badCreditCard: 'Mã thẻ chưa chính xác', + badCVV: 'Mã bảo mật (CVV) chưa chính xác', + wrongFileDim: 'Kích thước ảnh chưa chính xác,', + imageTooTall: 'Chiều cao ảnh không được vượt quá', + imageTooWide: 'Chiều rộng ảnh không được vượt quá', + imageTooSmall: 'Kích thước ảnh quá nhỏ', + min: 'nhỏ nhất', + max: 'lớn nhất', + imageRatioNotAccepted: 'Tỷ lệ ảnh chưa chính xác' + }; + + }); + +})(jQuery, window); + + +})); diff --git a/form-validator/location.js b/form-validator/location.js index 1c3f5e1..149d572 100644 --- a/form-validator/location.js +++ b/form-validator/location.js @@ -1,9 +1,101 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: Date + * ------------------------------------------ + * Created by Victor Jonsson * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * The following validators will be added by this module: + * - Country + * - US state + * - longitude and latitude + * + * @website http://formvalidator.net/#location-validators + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){a.formUtils.registerLoadedModule("location"),a.formUtils.addValidator({name:"country",validatorFunction:function(b){return a.inArray(b.toLowerCase(),this.countries)>-1},countries:["afghanistan","albania","algeria","american samoa","andorra","angola","anguilla","antarctica","antigua and barbuda","argentina","armenia","aruba","australia","austria","azerbaijan","bahamas","bahrain","bangladesh","barbados","belarus","belgium","belize","benin","bermuda","bhutan","bolivia","bonaire","bosnia and herzegovina","botswana","bouvet island","brazil","british indian ocean territory","brunei darussalam","bulgaria","burkina faso","burundi","cabo verde","cambodia","cameroon","canada","cayman islands","central african republic","chad","chile","china","christmas island","cocos islands","colombia","comoros","democratic republic of the congo","congo","cook islands","costa rica","côte d'ivoire","croatia","cuba","curaçao","cyprus","czechia","denmark","djibouti","dominica","dominican republic","ecuador","egypt","el salvador","equatorial guinea","eritrea","estonia","ethiopia","falkland islands","faroe islands","fiji","finland","france","french guiana","french polynesia","french southern territories","gabon","gambia","georgia","germany","ghana","gibraltar","greece","greenland","grenada","guadeloupe","guam","guatemala","guernsey","guinea","guinea-bissau","guyana","haiti","heard island and mcdonald islands","honduras","hong kong","hungary","iceland","india","indonesia","iran","iraq","ireland","isle of man","israel","italy","jamaica","japan","jersey","jordan","kazakhstan","kenya","kiribati","north korea","south korea","kuwait","kyrgyzstan","laos","latvia","lebanon","lesotho","liberia","libya","liechtenstein","lithuania","luxembourg","macao","macedonia","madagascar","malawi","malaysia","maldives","mali","malta","marshall islands","martinique","mauritania","mauritius","mayotte","mexico","micronesia","moldova","monaco","mongolia","montenegro","montserrat","morocco","mozambique","myanmar","namibia","nauru","nepal","netherlands","new caledonia","new zealand","nicaragua","niger","nigeria","niue","norfolk island","northern mariana islands","norway","oman","pakistan","palau","palestine","panama","papua new guinea","paraguay","peru","philippines","pitcairn","poland","portugal","puerto rico","qatar","réunion","romania","russia","rwanda","saint barthélemy","saint helena","ascension and tristan da cunha","Ascension and tristan da cunha","saint kitts and nevis","saint lucia","saint martin","saint pierre and miquelon","saint vincent and the grenadines","samoa","san marino","sao tome and principe","saudi arabia","senegal","serbia","seychelles","sierra leone","singapore","sint maarten","slovakia","slovenia","solomon islands","somalia","south africa","south georgia and the south sandwich islands","south sudan","spain","sri lanka","sudan","suriname","svalbard and jan mayen","swaziland","sweden","switzerland","syria","taiwan","tajikistan","tanzania","thailand","timor-leste","togo","tokelau","tonga","trinidad and tobago","tunisia","turkey","turkmenistan","turks and caicos islands","tuvalu","uganda","ukraine","united arab emirates","united kingdom","united states minor outlying islands","united states","uruguay","uzbekistan","vanuatu","venezuela","vatican city","vietnam","virgin islands (british)","virgin islands (us)","wallis and futuna","western sahara","yemen","zambia","zimbabwe","åland islands"],errorMessage:"",errorMessageKey:"badCustomVal"}),a.formUtils.addValidator({name:"federatestate",validatorFunction:function(b){return a.inArray(b.toLowerCase(),this.states)>-1},states:["alabama","alaska","arizona","arkansas","california","colorado","connecticut","delaware","florida","georgia","hawaii","idaho","illinois","indiana","iowa","kansas","kentucky","louisiana","maine","maryland","district of columbia","massachusetts","michigan","minnesota","mississippi","missouri","montana","nebraska","nevada","new hampshire","new jersey","new mexico","new york","north carolina","north dakota","ohio","oklahoma","oregon","pennsylvania","rhode island","south carolina","south dakota","tennessee","texas","utah","vermont","virginia","washington","west virginia","wisconsin","wyoming"],errorMessage:"",errorMessageKey:"badCustomVal"}),a.formUtils.addValidator({name:"longlat",validatorFunction:function(a){var b=/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/;return b.test(a)},errorMessage:"",errorMessageKey:"badCustomVal"});var b=function(b){var c=[];return a.each(b,function(a,b){c.push(b.substr(0,1).toUpperCase()+b.substr(1,b.length))}),c.sort(),c};a.fn.suggestCountry=function(c){var d=b(a.formUtils.validators.validate_country.countries),e=a.inArray(d,"Usa");return d[e]="USA",a.formUtils.suggest(this,d,c)},a.fn.suggestState=function(c){var d=b(a.formUtils.validators.validate_federatestate.states);return a.formUtils.suggest(this,d,c)}}(a)}); \ No newline at end of file +(function ($) { + + $.formUtils.registerLoadedModule('location'); + + /* + * Validate that country exists + */ + $.formUtils.addValidator({ + name: 'country', + validatorFunction: function (str) { + return $.inArray(str.toLowerCase(), this.countries) > -1; + }, + countries: ['afghanistan', 'albania', 'algeria', 'american samoa', 'andorra', 'angola', 'anguilla', 'antarctica', 'antigua and barbuda', 'argentina', 'armenia', 'aruba', 'australia', 'austria', 'azerbaijan', 'bahamas', 'bahrain', 'bangladesh', 'barbados', 'belarus', 'belgium', 'belize', 'benin', 'bermuda', 'bhutan', 'bolivia', 'bonaire', 'bosnia and herzegovina', 'botswana', 'bouvet island', 'brazil', 'british indian ocean territory', 'brunei darussalam', 'bulgaria', 'burkina faso', 'burundi', 'cabo verde', 'cambodia', 'cameroon', 'canada', 'cayman islands', 'central african republic', 'chad', 'chile', 'china', 'christmas island', 'cocos islands', 'colombia', 'comoros', 'democratic republic of the congo', 'congo', 'cook islands', 'costa rica', 'côte d\'ivoire', 'croatia', 'cuba', 'curaçao', 'cyprus', 'czechia', 'denmark', 'djibouti', 'dominica', 'dominican republic', 'ecuador', 'egypt', 'el salvador', 'equatorial guinea', 'eritrea', 'estonia', 'ethiopia', 'falkland islands', 'faroe islands', 'fiji', 'finland', 'france', 'french guiana', 'french polynesia', 'french southern territories', 'gabon', 'gambia', 'georgia', 'germany', 'ghana', 'gibraltar', 'greece', 'greenland', 'grenada', 'guadeloupe', 'guam', 'guatemala', 'guernsey', 'guinea', 'guinea-bissau', 'guyana', 'haiti', 'heard island and mcdonald islands', 'honduras', 'hong kong', 'hungary', 'iceland', 'india', 'indonesia', 'iran', 'iraq', 'ireland', 'isle of man', 'israel', 'italy', 'jamaica', 'japan', 'jersey', 'jordan', 'kazakhstan', 'kenya', 'kiribati', 'north korea', 'south korea', 'kuwait', 'kyrgyzstan', 'laos', 'latvia', 'lebanon', 'lesotho', 'liberia', 'libya', 'liechtenstein', 'lithuania', 'luxembourg', 'macao', 'macedonia', 'madagascar', 'malawi', 'malaysia', 'maldives', 'mali', 'malta', 'marshall islands', 'martinique', 'mauritania', 'mauritius', 'mayotte', 'mexico', 'micronesia', 'moldova', 'monaco', 'mongolia', 'montenegro', 'montserrat', 'morocco', 'mozambique', 'myanmar', 'namibia', 'nauru', 'nepal', 'netherlands', 'new caledonia', 'new zealand', 'nicaragua', 'niger', 'nigeria', 'niue', 'norfolk island', 'northern mariana islands', 'norway', 'oman', 'pakistan', 'palau', 'palestine', 'panama', 'papua new guinea', 'paraguay', 'peru', 'philippines', 'pitcairn', 'poland', 'portugal', 'puerto rico', 'qatar', 'réunion', 'romania', 'russia', 'rwanda', 'saint barthélemy', 'saint helena', 'ascension and tristan da cunha', 'Ascension and tristan da cunha', 'saint kitts and nevis', 'saint lucia', 'saint martin', 'saint pierre and miquelon', 'saint vincent and the grenadines', 'samoa', 'san marino', 'sao tome and principe', 'saudi arabia', 'senegal', 'serbia', 'seychelles', 'sierra leone', 'singapore', 'sint maarten', 'slovakia', 'slovenia', 'solomon islands', 'somalia', 'south africa', 'south georgia and the south sandwich islands', 'south sudan', 'spain', 'sri lanka', 'sudan', 'suriname', 'svalbard and jan mayen', 'swaziland', 'sweden', 'switzerland', 'syria', 'taiwan', 'tajikistan', 'tanzania', 'thailand', 'timor-leste', 'togo', 'tokelau', 'tonga', 'trinidad and tobago', 'tunisia', 'turkey', 'turkmenistan', 'turks and caicos islands', 'tuvalu', 'uganda', 'ukraine', 'united arab emirates', 'united kingdom', 'united states minor outlying islands', 'united states', 'uruguay', 'uzbekistan', 'vanuatu', 'venezuela', 'vatican city', 'vietnam', 'virgin islands (british)', 'virgin islands (us)', 'wallis and futuna', 'western sahara', 'yemen', 'zambia', 'zimbabwe', 'åland islands'], + errorMessage: '', + errorMessageKey: 'badCustomVal' + }); + + /* + * Is this a valid federate state in the US + */ + $.formUtils.addValidator({ + name: 'federatestate', + validatorFunction: function (str) { + return $.inArray(str.toLowerCase(), this.states) > -1; + }, + states: ['alabama', 'alaska', 'arizona', 'arkansas', 'california', 'colorado', 'connecticut', 'delaware', 'florida', 'georgia', 'hawaii', 'idaho', 'illinois', 'indiana', 'iowa', 'kansas', 'kentucky', 'louisiana', 'maine', 'maryland', 'district of columbia', 'massachusetts', 'michigan', 'minnesota', 'mississippi', 'missouri', 'montana', 'nebraska', 'nevada', 'new hampshire', 'new jersey', 'new mexico', 'new york', 'north carolina', 'north dakota', 'ohio', 'oklahoma', 'oregon', 'pennsylvania', 'rhode island', 'south carolina', 'south dakota', 'tennessee', 'texas', 'utah', 'vermont', 'virginia', 'washington', 'west virginia', 'wisconsin', 'wyoming'], + errorMessage: '', + errorMessageKey: 'badCustomVal' + }); + + + $.formUtils.addValidator({ + name: 'longlat', + validatorFunction: function (str) { + var regexp = /^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/; + return regexp.test(str); + }, + errorMessage: '', + errorMessageKey: 'badCustomVal' + }); + + /** + * @private + * @param {Array} listItems + * @return {Array} + */ + var _makeSortedList = function (listItems) { + var newList = []; + $.each(listItems, function (i, value) { + newList.push(value.substr(0, 1).toUpperCase() + value.substr(1, value.length)); + }); + newList.sort(); + return newList; + }; + + $.fn.suggestCountry = function (settings) { + var countries = _makeSortedList($.formUtils.validators.validate_country.countries), + usaIndex = $.inArray(countries, 'Usa'); + + countries[usaIndex] = 'USA'; + return $.formUtils.suggest(this, countries, settings); + }; + + $.fn.suggestState = function (settings) { + var states = _makeSortedList($.formUtils.validators.validate_federatestate.states); + return $.formUtils.suggest(this, states, settings); + }; + +})(jQuery); + + +})); diff --git a/form-validator/logic.js b/form-validator/logic.js index 427fd45..3d57539 100644 --- a/form-validator/logic.js +++ b/form-validator/logic.js @@ -1,9 +1,161 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: Logic + * ------------------------------------------ + * Created by Victor Jonsson * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * - data-validation-depends-on + * - data-validation-if-answered + * + * @website http://formvalidator.net/#logic + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){"use strict";a.formUtils.registerLoadedModule("logic");var b=function(b,c){var d=function(){var c=a(this),d=c.valAttr("depends-on")||c.valAttr("if-checked");if(d){var f=a.formUtils.getValue('[name="'+d+'"]',b),g=a.split(c.valAttr("depends-on-value"),!1,!1),h=!f||g.length&&!e(f,g);h&&c.valAttr("skipped","1")}},e=function(b,c){var d=!1,e=b.toLocaleLowerCase();return a.each(c,function(a,b){if(e===b.toLocaleLowerCase())return d=!0,!1}),d},f=function(){var b=a(this),d=a.formUtils.getValue(b),e=b.valAttr("depending-value");a.each(this.dependingInputs,function(b,f){var g=!!a.formUtils.getValue(f),h=!d||e&&e!==d;h&&!g&&a.formUtils.dialogs.removeInputStylingAndMessage(f,c)})};b.find("[data-validation-depends-on]").off("beforeValidation",d).on("beforeValidation",d).each(function(){var c=a(this);b.find('[name="'+c.valAttr("depends-on")+'"]').each(function(){a(this).off("change",f).on("change",f).valAttr("depending-value",c.valAttr("depends-on-value")),this.dependingInputs=this.dependingInputs||[],this.dependingInputs.push(c)})})},c=function(b,c){var d=function(){var c=a(this),d=c.valAttr("optional-if-answered"),e=!1,f=!!a.formUtils.getValue(c);f||(a.each(a.split(d),function(c,d){var f=b.find('[name="'+d+'"]');if(e=!!a.formUtils.getValue(f))return!1}),e&&c.valAttr("skipped",1))},e=function(){var d=a(this),e=d.valAttr("optional-if-answered");a.each(a.split(e),function(d,e){var f=b.find('[name="'+e+'"]'),g=!!a.formUtils.getValue(f);g||a.formUtils.dialogs.removeInputStylingAndMessage(f,c)})};b.find("[data-validation-optional-if-answered]").off("beforeValidation",d).on("beforeValidation",d).each(function(){a(this).off("change",e).on("change",e)})};a.formUtils.$win.bind("validatorsLoaded formValidationSetup",function(d,e,f){e||(e=a("form")),b(e,f),c(e,f)})}(a)}); \ No newline at end of file +(function($) { + + 'use strict'; + + $.formUtils.registerLoadedModule('logic'); + + var setupValidationDependsOn = function($form, conf) { + + var dependingOnBeforeValidation = function() { + + var $input = $(this), + nameOfDependingInput = $input.valAttr('depends-on') || $input.valAttr('if-checked'); + + // Whether or not this input should be validated depends on if another input has a value + if (nameOfDependingInput) { + + // Set the boolean telling us that the validation depends + // on another input being checked + var valueOfDependingInput = $.formUtils.getValue('[name="' + nameOfDependingInput + '"]', $form), + listWithRequiredValues = $.split($input.valAttr('depends-on-value'), false, false), + dependingInputIsMissingValueOrHasIncorrectValue = !valueOfDependingInput || ( + listWithRequiredValues.length && + !valueIsInList(valueOfDependingInput, listWithRequiredValues) + ); + + if (dependingInputIsMissingValueOrHasIncorrectValue) { + $input.valAttr('skipped', '1'); + } + } + }, + valueIsInList = function(value, valueList) { + var isInList = false, + lowerCaseValue = value.toLocaleLowerCase(); + + $.each(valueList, function(i, otherValue) { + if (lowerCaseValue === otherValue.toLocaleLowerCase()) { + isInList = true; + return false; + } + }); + return isInList; + }, + dependingOnValueChanged = function() { + var $input = $(this), + inputValue = $.formUtils.getValue($input), + requiredValueOfDependingInput = $input.valAttr('depending-value'); + $.each(this.dependingInputs, function (i, $otherInput) { + var otherInputHasValue = $.formUtils.getValue($otherInput) ? true:false, + dependingInputIsMissingValueOrHasIncorrectValue = !inputValue || ( + requiredValueOfDependingInput && + requiredValueOfDependingInput !== inputValue + ); + + if (dependingInputIsMissingValueOrHasIncorrectValue && !otherInputHasValue) { + $.formUtils.dialogs.removeInputStylingAndMessage($otherInput, conf); + } + }); + }; + + $form.find('[data-validation-depends-on]') + .off('beforeValidation', dependingOnBeforeValidation) + .on('beforeValidation', dependingOnBeforeValidation) + .each(function() { + // Remove validation when on depending input + var $dependingInput = $(this); + $form.find('[name="'+$dependingInput.valAttr('depends-on')+'"]').each(function() { + $(this) + .off('change', dependingOnValueChanged) + .on('change', dependingOnValueChanged) + .valAttr('depending-value', $dependingInput.valAttr('depends-on-value')); + + this.dependingInputs = this.dependingInputs || []; + this.dependingInputs.push($dependingInput); + }); + }); + + }, + setupValidationTogetherWith = function($form, conf) { + + var optionalBeforeValidation = function() { + var $input = $(this), + dependingInputs = $input.valAttr('optional-if-answered'), + dependingInputsHasValue = false, + thisInputHasAnswer = $.formUtils.getValue($input) ? true:false; + + if (!thisInputHasAnswer) { + $.each($.split(dependingInputs), function(i, inputName) { + var $dependingInput = $form.find('[name="'+inputName+'"]'); + dependingInputsHasValue = $.formUtils.getValue($dependingInput) ? true:false; + if (dependingInputsHasValue) { + return false; + } + }); + + if (dependingInputsHasValue) { + $input.valAttr('skipped', 1); + } + } + }, + optionalInputOnChange = function() { + var $input = $(this), + dependingInputs = $input.valAttr('optional-if-answered'); + + $.each($.split(dependingInputs), function(i, inputName) { + var $dependingInput = $form.find('[name="'+inputName+'"]'), + dependingInputsHasValue = $.formUtils.getValue($dependingInput) ? true:false; + if (!dependingInputsHasValue) { + $.formUtils.dialogs.removeInputStylingAndMessage($dependingInput, conf); + } + }); + }; + + $form.find('[data-validation-optional-if-answered]') + .off('beforeValidation', optionalBeforeValidation) + .on('beforeValidation', optionalBeforeValidation) + .each(function() { + $(this) + .off('change', optionalInputOnChange) + .on('change', optionalInputOnChange); + }); + }; + + $.formUtils.$win.bind('validatorsLoaded formValidationSetup', function(evt, $form, conf) { + if( !$form ) { + $form = $('form'); + } + setupValidationDependsOn($form, conf); + setupValidationTogetherWith($form, conf); + }); + +})(jQuery); + + +})); diff --git a/form-validator/poland.js b/form-validator/poland.js index 2c3dedd..95e44cb 100644 --- a/form-validator/poland.js +++ b/form-validator/poland.js @@ -1,9 +1,136 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: Poland + * ------------------------------------------ + * Created by simivar * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * This form validation module adds validators typically used on + * websites in Poland. This module adds the following validators: + * - plpesel + * + * @website http://formvalidator.net/#poland-validators + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){a.formUtils.registerLoadedModule("poland"),a.formUtils.addValidator({name:"plpesel",validatorFunction:function(a){var b=[1,3,7,9,1,3,7,9,1,3],c=0,d=0;if(/\d{11}/.test(a)&&11===a.length){for(var e=0;e<10;e++)c+=a[e]*b[e];if(c%10!==0&&(d=10-c%10),parseInt(a.charAt(10))===d)return!0}return!1},errorMessage:"",errorMessageKey:"badPlPesel"}),a.formUtils.addValidator({name:"plnip",validatorFunction:function(a){var b=[6,5,7,2,3,4,5,6,7],c=0;if(/\d{10}/.test(a)&&10===a.length){for(var d=0;d<9;d++)c+=a[d]*b[d];if(parseInt(a.charAt(9))===c%11)return!0}return!1},errorMessage:"",errorMessageKey:"badPlNip"}),a.formUtils.addValidator({name:"plregon",validatorFunction:function(a){var b=[8,9,2,3,4,5,6,7],c=[2,4,8,5,0,9,7,3,6,1,2,4,8],d=0,e=0;if(/(\d{14}|\d{9})/.test(a)&&(9===a.length||14===a.length)){for(var f=0;f<8;f++)d+=a[f]*b[f];if(d%11!==10&&(e=d%11),parseInt(a.charAt(8))===e){if(14!==a.length)return!0;for(d=0,f=0;f<13;f++)d+=a[f]*c[f];if(d%11!==10&&(e=d%11),parseInt(a.charAt(13))===e)return!0}}return!1},errorMessage:"",errorMessageKey:"badPlRegon"})}(a)}); \ No newline at end of file +(function($) { + + $.formUtils.registerLoadedModule('poland'); + + /** + * PL PESEL - polish personal identity number (in Polish identity cards) validator + */ + $.formUtils.addValidator({ + name: 'plpesel', + validatorFunction: function(pesel){ + var weights = [1, 3, 7, 9, 1, 3, 7, 9, 1, 3], + checkSum = 0, checkDigit = 0; + + if( /\d{11}/.test( pesel ) && pesel.length === 11 ){ + for (var i = 0; i < 10; i++) { + checkSum += pesel[ i ] * weights[ i ]; + } + + if( checkSum % 10 !== 0 ){ + checkDigit = 10 - (checkSum % 10); + } + + if( parseInt( pesel.charAt( 10 ) ) === checkDigit ){ + return true; + } + } + + return false; + }, + errorMessage: '', + errorMessageKey: 'badPlPesel' + }); + + /** + * PL NIP - polish VAT identification number validator + */ + $.formUtils.addValidator({ + name: 'plnip', + validatorFunction: function(nip){ + var weights = [6, 5, 7, 2, 3, 4, 5, 6, 7], + checkSum = 0; + + if( /\d{10}/.test( nip ) && nip.length === 10 ){ + for (var i = 0; i < 9; i++) { + checkSum += nip[ i ] * weights[ i ]; + } + + if( parseInt( nip.charAt( 9 ) ) === checkSum % 11 ){ + return true; + } + } + + return false; + }, + errorMessage: '', + errorMessageKey: 'badPlNip' + }); + + /** + * PL REGON - polish bussiness identity number validator + */ + $.formUtils.addValidator({ + name: 'plregon', + validatorFunction: function(regon){ + var weightsNine = [8, 9, 2, 3, 4, 5, 6, 7], + weightsFourteen = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8], + checkSum = 0, checkDigit = 0; + + if( /(\d{14}|\d{9})/.test( regon ) && ( regon.length === 9 || regon.length === 14 ) ){ + for (var i = 0; i < 8; i++) { + checkSum += regon[ i ] * weightsNine[ i ]; + } + + if( checkSum % 11 !== 10 ){ + checkDigit = checkSum % 11; + } + + if( parseInt( regon.charAt( 8 ) ) === checkDigit ){ + if( regon.length === 14 ){ + checkSum = 0; + + for (i = 0; i < 13; i++) { + checkSum += regon[ i ] * weightsFourteen[ i ]; + } + + if( checkSum % 11 !== 10 ){ + checkDigit = checkSum % 11; + } + + if( parseInt( regon.charAt( 13 ) ) === checkDigit ){ + return true; + } + } else { + return true; + } + } + } + + return false; + }, + errorMessage: '', + errorMessageKey: 'badPlRegon' + }); + +})(jQuery); + + +})); diff --git a/form-validator/sanitize.js b/form-validator/sanitize.js index be40224..e65f9b1 100644 --- a/form-validator/sanitize.js +++ b/form-validator/sanitize.js @@ -1,9 +1,242 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: sanitize + * ------------------------------------------ + * Created by Victor Jonsson * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * This module makes it possible to add sanitation functions to + * inputs. The functions is triggered on blur. Example: + * + * + * + * Available functions are: + * - uppercase + * - lowercase + * - capitalize + * - trim + * - trimLeft + * - trimRight + * - numberFormat + * - insertLeft + * - insertRight + * - strip + * - escape (replace <, >, &, ' and " with HTML entities) + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("sanitize");var c='[type="button"], [type="submit"], [type="radio"], [type="checkbox"], [type="reset"], [type="search"]',d={upper:function(a){return a.toLocaleUpperCase()},lower:function(a){return a.toLocaleLowerCase()},trim:function(b){return a.trim(b)},trimLeft:function(a){return a.replace(/^\s+/,"")},trimRight:function(a){return a.replace(/\s+$/,"")},capitalize:function(b){var c=b.split(" ");return a.each(c,function(a,b){c[a]=b.substr(0,1).toUpperCase()+b.substr(1,b.length)}),c.join(" ")},insert:function(a,b,c){var d=(b.attr("data-sanitize-insert-"+c)||"").replace(/\[SPACE\]/g," ");return"left"===c&&0===a.indexOf(d)||"right"===c&&a.substring(a.length-d.length)===d?a:("left"===c?d:"")+a+("right"===c?d:"")},insertRight:function(a,b){return this.insert(a,b,"right")},insertLeft:function(a,b){return this.insert(a,b,"left")},numberFormat:function(a,c){if(0===a.length)return a;if(!("numeral"in b))throw new ReferenceError('Using sanitation function "numberFormat" requires that you include numeral.js (http://numeraljs.com/)');return a=numeral().unformat(a),a=numeral(a).format(c.attr("data-sanitize-number-format"))},strip:function(b,c){var d=c.attr("data-sanitize-strip")||"";return a.split(d,function(c){var d=new RegExp(a.isNumeric(c)?c:"\\"+c,"g");b=b.replace(d,"")}),b},escape:function(b,c){var d=c.valAttr("is-escaped"),e={"<":"__%AMP%__lt;",">":"__%AMP%__gt;","&":"__%AMP%__amp;","'":"__%AMP%__#8217;",'"':"__%AMP%__quot;"};return"yes"===d?b:(c.valAttr("is-escaped","yes"),c.one("keyup",function(a){9!==a.keyCode&&c.valAttr("is-escaped","no")}),a.each(e,function(a,c){b=b.replace(new RegExp(a,"g"),c)}),b.replace(new RegExp("__%AMP%__","g"),"&"))}},e=function(b,e,f){e||(e=a("form")),e.each||(e=a(e));var g=function(){var b=a(this),c=b.val();a.split(b.attr("data-sanitize"),function(a){if(!(a in d))throw new Error('Use of unknown sanitize command "'+a+'"');c=d[a](c,b,f)}),b.val(c).trigger("keyup.validation")};e.each(function(){var b=a(this);f.sanitizeAll&&b.find("input,textarea").not(c).each(function(){var b=a(this),c=b.attr("data-sanitize")||"";b.attr("data-sanitize",f.sanitizeAll+" "+c)}),b.find("[data-sanitize]").unbind("blur.sanitation",g).bind("blur.sanitation",g),a(function(){b.trigger("blur.sanitation")})})};a(b).on("validatorsLoaded formValidationSetup",e),a.formUtils.setupSanitation=e}(a,window)}); \ No newline at end of file +(function($, window) { + + 'use strict'; + + $.formUtils.addSanitizer({ + name : 'upper', + sanitizerFunction : function(val) { + return val.toLocaleUpperCase(); + } + }); + + $.formUtils.addSanitizer({ + name : 'lower', + sanitizerFunction : function(val) { + return val.toLocaleLowerCase(); + } + }); + + $.formUtils.addSanitizer({ + name : 'trim', + sanitizerFunction : function(val) { + return $.trim(val); + } + }); + + $.formUtils.addSanitizer({ + name : 'trimLeft', + sanitizerFunction : function(val) { + return val.replace(/^\s+/,''); + } + }); + + $.formUtils.addSanitizer({ + name : 'trimRight', + sanitizerFunction : function(val) { + return val.replace(/\s+$/,''); + } + }); + + $.formUtils.addSanitizer({ + name : 'capitalize', + sanitizerFunction : function(val) { + var words = val.split(' '); + $.each(words, function(i, word) { + words[i] = word.substr(0,1).toUpperCase() + word.substr(1, word.length); + }); + return words.join(' '); + } + }); + + $.formUtils.addSanitizer({ + name : 'insert', + sanitizerFunction : function(val, $input, pos) { + var extra = ($input.attr('data-sanitize-insert-'+pos) || '').replace(/\[SPACE\]/g, ' '); + if ( (pos === 'left' && val.indexOf(extra) === 0) || (pos === 'right' && val.substring(val.length - extra.length) === extra)) { + return val; + } + return (pos === 'left' ? extra:'') + val + (pos === 'right' ? extra : ''); + } + }); + + $.formUtils.addSanitizer({ + name : 'insertRight', + sanitizerFunction : function(val, $input) { + return $.formUtils.sanitizers.insert.sanitizerFunction(val, $input, 'right'); + } + }); + + $.formUtils.addSanitizer({ + name : 'insertLeft', + sanitizerFunction : function(val, $input) { + return $.formUtils.sanitizers.insert.sanitizerFunction(val, $input, 'left'); + } + }); + + $.formUtils.addSanitizer({ + name : 'numberFormat', + sanitizerFunction : function(val, $input) { + if (val.length === 0) { + return val; + } + if ( 'numeral' in window ) { + //If this has been previously formatted, it needs to be unformatted first before being reformatted. + //Else numeral will fail + val = numeral().unformat(val); + val = numeral(val).format( $input.attr('data-sanitize-number-format') ); + } + else { + throw new ReferenceError('Using sanitation function "numberFormat" requires that you include numeral.js ' + + '(http://numeraljs.com/)'); + } + return val; + } + }); + + $.formUtils.addSanitizer({ + name : 'strip', + sanitizerFunction : function(val, $input) { + var toRemove = $input.attr('data-sanitize-strip') || ''; + $.split(toRemove, function(char) { + var regex = new RegExp($.isNumeric(char) ? char : '\\'+char, 'g'); + val = val.replace(regex, ''); + }); + return val; + } + }); + + $.formUtils.addSanitizer({ + name : 'escape', + sanitizerFunction : function(val, $input) { + var isEscaped = $input.valAttr('is-escaped'), + entities = { + '<' : '__%AMP%__lt;', + '>' : '__%AMP%__gt;', + '&' : '__%AMP%__amp;', + '\'': '__%AMP%__#8217;', + '"' : '__%AMP%__quot;' + }; + + if (isEscaped === 'yes') { + return val; + } + + $input.valAttr('is-escaped', 'yes'); + $input.one('keyup', function(evt) { + if(evt.keyCode !== 9) { + $input.valAttr('is-escaped', 'no'); + } + }); + + $.each(entities, function(symbol, replacement) { + val = val.replace(new RegExp(symbol, 'g'), replacement); + }); + + return val.replace(new RegExp('__\%AMP\%__', 'g'), '&'); + } + }); + + $.formUtils.registerLoadedModule('sanitize'); + + var inputsThatCantBeSanitized = '[type="button"], [type="submit"], [type="radio"], [type="checkbox"], [type="reset"], [type="search"]', + setupSanitation = function(evt, $forms, config) { + + if ( !$forms ) { + $forms = $('form'); + } + if ( !$forms.each ) { + $forms = $($forms); + } + + var execSanitationCommands = function() { + + var $input = $(this), + value = $input.val(); + $.split($input.attr('data-sanitize'), function(command) { + + var sanitizer = $.formUtils.sanitizers[command]; + + if (sanitizer) { + value = sanitizer.sanitizerFunction(value, $input, config); + } else { + throw new Error('Use of unknown sanitize command "'+command+'"'); + } + + }); + $input + .val(value) + .trigger('keyup.validation'); // we need to re-validate in case it gets validated on blur + }; + + $forms.each(function() { + var $form = $(this); + if( config.sanitizeAll ) { + $form.find('input,textarea').not(inputsThatCantBeSanitized).each(function() { + var $input = $(this), + sanitation = $input.attr('data-sanitize') || ''; + $input.attr('data-sanitize', config.sanitizeAll +' '+ sanitation); + }); + } + + $form.find('[data-sanitize]') + .unbind('blur.sanitation', execSanitationCommands) + .bind('blur.sanitation', execSanitationCommands); + + $(function() { + $form.trigger('blur.sanitation'); + }); + + }); + }; + + $(window).on('validatorsLoaded formValidationSetup', setupSanitation); + + // Only for unit testing + $.formUtils.setupSanitation = setupSanitation; + +})(jQuery, window); + + +})); diff --git a/form-validator/security.js b/form-validator/security.js index e56f88d..f16d729 100644 --- a/form-validator/security.js +++ b/form-validator/security.js @@ -1,9 +1,625 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: Security + * ------------------------------------------ + * Created by Victor Jonsson * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * This module adds validators typically used in registration forms. + * This module adds the following validators: + * - spamcheck + * - confirmation + * - strength + * - backend + * - credit card + * - cvv + * + * @website http://formvalidator.net/#security-validators + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("security"),a.formUtils.addValidator({name:"spamcheck",validatorFunction:function(a,b){var c=b.valAttr("captcha");return c===a},errorMessage:"",errorMessageKey:"badSecurityAnswer"}),a.formUtils.addValidator({name:"confirmation",validatorFunction:function(b,c,d,e,f){var g,h=c.valAttr("confirm")||c.attr("name")+"_confirmation",i=f.find('[name="'+h+'"]');if(!i.length)return a.formUtils.warn('Password confirmation validator: could not find an input with name "'+h+'"',!0),!1;if(g=i.val(),d.validateOnBlur&&!i[0].hasValidationCallback){i[0].hasValidationCallback=!0;var j=function(){c.validate()};i.on("keyup",j),f.one("formValidationSetup",function(){i[0].hasValidationCallback=!1,i.off("keyup",j)})}return b===g},errorMessage:"",errorMessageKey:"notConfirmed"});var c={amex:[15,15],diners_club:[14,14],cjb:[16,16],laser:[16,19],visa:[16,16],mastercard:[16,16],maestro:[12,19],discover:[16,16]},d=!1,e=!1;a.formUtils.addValidator({name:"creditcard",validatorFunction:function(b,f){var g=a.split(f.valAttr("allowing")||"");if(e=a.inArray("amex",g)>-1,d=e&&1===g.length,g.length>0){var h=!1;if(a.each(g,function(d,e){if(e in c){if(b.length>=c[e][0]&&b.length<=c[e][1])return h=!0,!1}else a.formUtils.warn('Use of unknown credit card "'+e+'"',!0)}),!h)return!1}if(""!==b.replace(new RegExp("[0-9]","g"),""))return!1;var i=0;return a.each(b.split("").reverse(),function(a,b){b=parseInt(b,10),a%2===0?i+=b:(b*=2,i+=b<10?b:b-9)}),i%10===0},errorMessage:"",errorMessageKey:"badCreditCard"}),a.formUtils.addValidator({name:"cvv",validatorFunction:function(a){return""===a.replace(/[0-9]/g,"")&&(a+="",d?4===a.length:e?3===a.length||4===a.length:3===a.length)},errorMessage:"",errorMessageKey:"badCVV"}),a.formUtils.addValidator({name:"strength",validatorFunction:function(b,c){var d=c.valAttr("strength")||2;return d&&d>3&&(d=3),a.formUtils.validators.validate_strength.calculatePasswordStrength(b)>=d},errorMessage:"",errorMessageKey:"badStrength",calculatePasswordStrength:function(a){if(a.length<4)return 0;var b=0,c=function(a,b){for(var c="",d=0;d100&&(b=100),b<20?0:b<40?1:b<=60?2:3},strengthDisplay:function(b,c){var d={fontSize:"12pt",padding:"4px",bad:"Very bad",weak:"Weak",good:"Good",strong:"Strong"};c&&a.extend(d,c),b.bind("keyup",function(){var b=a(this).val(),c="undefined"==typeof d.parent?a(this).parent():a(d.parent),e=c.find(".strength-meter"),f=a.formUtils.validators.validate_strength.calculatePasswordStrength(b),g={background:"pink",color:"#FF0000",fontWeight:"bold",border:"red solid 1px",borderWidth:"0px 0px 4px",display:"inline-block",fontSize:d.fontSize,padding:d.padding},h=d.bad;0===e.length&&(e=a(""),e.addClass("strength-meter").appendTo(c)),b?e.show():e.hide(),1===f?h=d.weak:2===f?(g.background="lightyellow",g.borderColor="yellow",g.color="goldenrod",h=d.good):f>=3&&(g.background="lightgreen",g.borderColor="darkgreen",g.color="darkgreen",h=d.strong),e.css(g).text(h)})}});var f=function(b,c,d,e,f){var g=c.valAttr("req-params")||c.data("validation-req-params")||{},h=c.valAttr("param-name")||c.attr("name"),i=function(a,b){b(a)};if(!h)throw new Error("Missing input name used for http requests made by server validator");g||(g={}),"string"==typeof g&&(g=a.parseJSON(g)),g[h]=d,a.ajax({url:b,type:"POST",cache:!1,data:g,dataType:"json",error:function(a){return i({valid:!1,message:"Connection failed with status: "+a.statusText},f),!1},success:function(a){i(a,f)}})};a.formUtils.addAsyncValidator({name:"server",validatorFunction:function(a,b,c,d,e,g){var h=c.valAttr("url")||d.backendUrl||document.location.href;g.addClass("validating-server-side"),c.addClass("validating-server-side"),f(h,c,b,d,function(b){g.removeClass("validating-server-side"),c.removeClass("validating-server-side"),b.message&&c.attr(d.validationErrorMsgAttribute,b.message),a(b.valid)})},errorMessage:"",errorMessageKey:"badBackend"}),a.formUtils.addValidator({name:"letternumeric",validatorFunction:function(b,c,d,e){var f="^([a-zA-Z0-9ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",g="]+)$",h=c.valAttr("allowing"),i="";if(h){i=f+h+g;var j=h.replace(/\\/g,"");j.indexOf(" ")>-1&&(j=j.replace(" ",""),j+=e.andSpaces||a.formUtils.LANG.andSpaces),this.errorMessage=e.badAlphaNumeric+e.badAlphaNumericExtra+j}else i=f+g,this.errorMessage=e.badAlphaNumeric;return new RegExp(i).test(b)},errorMessage:"",errorMessageKey:"requiredFields"}),a.formUtils.addValidator({name:"complexity",validatorFunction:function(b,c,d,e){var f=c.valAttr("require-uc-letter")||"0",g=c.valAttr("require-lc-letter")||"0",h=c.valAttr("require-special-char")||"0",i=c.valAttr("require-numeral")||"0",j=c.valAttr("require-length")||"0",k={"uc-letter":{pattern:"^(?=(?:.*[A-Z]){"+f+",}).+",numRequired:f,dialogEnd:e.passwordComplexityUppercaseInfo},"lc-letter":{pattern:"^(?=(?:.*[a-z]){"+g+",}).+",numRequired:g,dialogEnd:e.passwordComplexityLowercaseInfo},"special-char":{pattern:"^(?=(?:.*(_|[!\"#$%&'()*+\\\\,-./:;<=>?@[\\]^_`{|}~])){"+h+",}).+",numRequired:h,dialogEnd:e.passwordComplexitySpecialCharsInfo},numeral:{pattern:"^(?=(?:.*\\d){"+i+",}).+",numRequired:i,dialogEnd:e.passwordComplexityNumericCharsInfo},length:{callback:function(a){return a.length>=j},numRequired:j,dialogEnd:e.lengthBadEnd}},l="";return a.each(k,function(a,d){var f=parseInt(d.numRequired,10);if(f){var g=new RegExp(d.pattern),h=!1;h=d.callback?d.callback(b):g.test(b),h?c.trigger("complexityRequirementValidation",[!0,a]):(""===l&&(l=e.passwordComplexityStart),l+=e.passwordComplexitySeparator+f+d.dialogEnd,c.trigger("complexityRequirementValidation",[!1,a]))}}),!l||(this.errorMessage=l+e.passwordComplexityEnd,!1)},errorMessage:"",errorMessageKey:""}),a.formUtils.addValidator({name:"recaptcha",validatorFunction:function(a,b){return""!==grecaptcha.getResponse(b.valAttr("recaptcha-widget-id"))},errorMessage:"",errorMessageKey:"badreCaptcha"}),a.fn.displayPasswordStrength=function(b){return new a.formUtils.validators.validate_strength.strengthDisplay(this,b),this};var g=function(b,c,d){if(c||(c=a("form")),"undefined"!=typeof grecaptcha&&!a.formUtils.hasLoadedGrecaptcha)throw new Error("reCaptcha API can not be loaded by hand, delete reCaptcha API snippet.");if(!a.formUtils.hasLoadedGrecaptcha&&a('[data-validation~="recaptcha"]',c).length){a.formUtils.hasLoadedGrecaptcha=!0;var e="//www.google.com/recaptcha/api.js?onload=reCaptchaLoaded&render=explicit"+(d.lang?"&hl="+d.lang:""),f=document.createElement("script");f.type="text/javascript",f.async=!0,f.defer=!0,f.src=e,document.getElementsByTagName("body")[0].appendChild(f)}};b.reCaptchaLoaded=function(b){b&&"object"==typeof b&&b.length||(b=a("form")),b.each(function(){var b=a(this),c=b.get(0).validationConfig||b.context.validationConfig||!1;c&&a('[data-validation~="recaptcha"]',b).each(function(){var d=a(this),e=document.createElement("DIV"),f=c.reCaptchaSiteKey||d.valAttr("recaptcha-sitekey"),g=c.reCaptchaTheme||d.valAttr("recaptcha-theme")||"light",h=c.reCaptchaSize||d.valAttr("recaptcha-size")||"normal",i=c.reCaptchaType||d.valAttr("recaptcha-type")||"image";if(!f)throw new Error("Google reCaptcha site key is required.");var j=grecaptcha.render(e,{sitekey:f,theme:g,size:h,type:i,callback:function(a){b.find('[data-validation~="recaptcha"]').trigger("validation",a&&""!==a)},"expired-callback":function(){b.find('[data-validation~="recaptcha"]').trigger("validation",!1)}});d.valAttr("recaptcha-widget-id",j).hide().on("beforeValidation",function(a){a.stopImmediatePropagation()}).parent().append(e)})})},a(b).on("validatorsLoaded formValidationSetup",g)}(a,window)}); \ No newline at end of file +(function ($, window) { + + 'use strict'; + + $.formUtils.registerLoadedModule('security'); + + /* + * Simple spam check + */ + $.formUtils.addValidator({ + name: 'spamcheck', + validatorFunction: function (val, $el) { + var attr = $el.valAttr('captcha'); + return attr === val; + }, + errorMessage: '', + errorMessageKey: 'badSecurityAnswer' + }); + + /* + * Validate confirmation (tests that two inputs are identical; usually used for + * passwords) + */ + $.formUtils.addValidator({ + name: 'confirmation', + validatorFunction: function (value, $el, config, language, $form) { + var password, + passwordInputName = $el.valAttr('confirm') || + ($el.attr('name') + '_confirmation'), + $passwordInput = $form.find('[name="' + passwordInputName + '"]'); + if (!$passwordInput.length) { + $.formUtils.warn('Password confirmation validator: could not find an input ' + + 'with name "' + passwordInputName + '"', true); + return false; + } + + password = $passwordInput.val(); + if (config.validateOnBlur && !$passwordInput[0].hasValidationCallback) { + $passwordInput[0].hasValidationCallback = true; + var keyUpCallback = function () { + $el.validate(); + }; + $passwordInput.on('keyup', keyUpCallback); + $form.one('formValidationSetup', function () { + $passwordInput[0].hasValidationCallback = false; + $passwordInput.off('keyup', keyUpCallback); + }); + } + + return value === password; + }, + errorMessage: '', + errorMessageKey: 'notConfirmed' + }); + + var creditCards = { + 'amex': [15, 15], + 'diners_club': [14, 14], + 'cjb': [16, 16], + 'laser': [16, 19], + 'visa': [16, 16], + 'mastercard': [16, 16], + 'maestro': [12, 19], + 'discover': [16, 16] + }, + checkOnlyAmex = false, + allowsAmex = false; + + /* + * Credit card + */ + $.formUtils.addValidator({ + name: 'creditcard', + validatorFunction: function (value, $el) { + var allowing = $.split($el.valAttr('allowing') || ''); + + // Setup for cvv validation + allowsAmex = $.inArray('amex', allowing) > -1; + checkOnlyAmex = allowsAmex && allowing.length === 1; + + // Correct length + if (allowing.length > 0) { + var hasValidLength = false; + $.each(allowing, function (i, cardName) { + if (cardName in creditCards) { + if (value.length >= creditCards[cardName][0] && value.length <= creditCards[cardName][1]) { + hasValidLength = true; + return false; + } + } else { + $.formUtils.warn('Use of unknown credit card "' + cardName + '"', true); + } + }); + + if (!hasValidLength) { + return false; + } + } + + // only numbers + if (value.replace(new RegExp('[0-9]', 'g'), '') !== '') { + return false; + } + + // http://en.wikipedia.org/wiki/Luhn_algorithm + // http://www.brainjar.com/js/validation/default2.asp + var checkSum = 0; + $.each(value.split('').reverse(), function (i, digit) { + digit = parseInt(digit, 10); + if (i % 2 === 0) { + checkSum += digit; + } else { + digit *= 2; + if (digit < 10) { + checkSum += digit; + } else { + checkSum += digit - 9; + } + } + }); + return checkSum % 10 === 0; + }, + errorMessage: '', + errorMessageKey: 'badCreditCard' + }); + + /* + * Credit card number + */ + $.formUtils.addValidator({ + name: 'cvv', + validatorFunction: function (val) { + if (val.replace(/[0-9]/g, '') === '') { + val = val + ''; + if (checkOnlyAmex) { + return val.length === 4; + } else if (allowsAmex) { + return val.length === 3 || val.length === 4; + } else { + return val.length === 3; + } + } + return false; + }, + errorMessage: '', + errorMessageKey: 'badCVV' + }); + + /* + * Validate password strength + */ + $.formUtils.addValidator({ + name: 'strength', + validatorFunction: function (val, $el) { + var requiredStrength = $el.valAttr('strength') || 2; + if (requiredStrength && requiredStrength > 3) { + requiredStrength = 3; + } + + return $.formUtils.validators.validate_strength.calculatePasswordStrength(val) >= requiredStrength; + }, + errorMessage: '', + errorMessageKey: 'badStrength', + + /** + * Code more or less borrowed from jQuery plugin "Password Strength Meter" + * written by Darren Mason (djmason9@gmail.com), myPocket technologies (www.mypocket-technologies.com) + * @param {String} password + * @return {Number} + */ + calculatePasswordStrength: function (password) { + + if (password.length < 4) { + return 0; + } + + var score = 0; + + var checkRepetition = function (pLen, str) { + var res = ''; + for (var i = 0; i < str.length; i++) { + var repeated = true; + + for (var j = 0; j < pLen && (j + i + pLen) < str.length; j++) { + repeated = repeated && (str.charAt(j + i) === str.charAt(j + i + pLen)); + } + if (j < pLen) { + repeated = false; + } + if (repeated) { + i += pLen - 1; + repeated = false; + } + else { + res += str.charAt(i); + } + } + return res; + }; + + //password length + score += password.length * 4; + score += ( checkRepetition(1, password).length - password.length ) * 1; + score += ( checkRepetition(2, password).length - password.length ) * 1; + score += ( checkRepetition(3, password).length - password.length ) * 1; + score += ( checkRepetition(4, password).length - password.length ) * 1; + + //password has 3 numbers + if (password.match(/(.*[0-9].*[0-9].*[0-9])/)) { + score += 5; + } + + //password has 2 symbols + if (password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) { + score += 5; + } + + //password has Upper and Lower chars + if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) { + score += 10; + } + + //password has number and chars + if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) { + score += 15; + } + // + //password has number and symbol + if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([0-9])/)) { + score += 15; + } + + //password has char and symbol + if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([a-zA-Z])/)) { + score += 15; + } + + //password is just a numbers or chars + if (password.match(/^\w+$/) || password.match(/^\d+$/)) { + score -= 10; + } + + //verifying 0 < score < 100 + if (score < 0) { + score = 0; + } + if (score > 100) { + score = 100; + } + + if (score < 20) { + return 0; + } + else if (score < 40) { + return 1; + } + else if (score <= 60) { + return 2; + } + else { + return 3; + } + }, + + strengthDisplay: function ($el, options) { + var config = { + fontSize: '12pt', + padding: '4px', + bad: 'Very bad', + weak: 'Weak', + good: 'Good', + strong: 'Strong' + }; + + if (options) { + $.extend(config, options); + } + + $el.bind('keyup', function () { + var val = $(this).val(), + $parent = typeof config.parent === 'undefined' ? $(this).parent() : $(config.parent), + $displayContainer = $parent.find('.strength-meter'), + strength = $.formUtils.validators.validate_strength.calculatePasswordStrength(val), + css = { + background: 'pink', + color: '#FF0000', + fontWeight: 'bold', + border: 'red solid 1px', + borderWidth: '0px 0px 4px', + display: 'inline-block', + fontSize: config.fontSize, + padding: config.padding + }, + text = config.bad; + + if ($displayContainer.length === 0) { + $displayContainer = $(''); + $displayContainer + .addClass('strength-meter') + .appendTo($parent); + } + + if (!val) { + $displayContainer.hide(); + } else { + $displayContainer.show(); + } + + if (strength === 1) { + text = config.weak; + } + else if (strength === 2) { + css.background = 'lightyellow'; + css.borderColor = 'yellow'; + css.color = 'goldenrod'; + text = config.good; + } + else if (strength >= 3) { + css.background = 'lightgreen'; + css.borderColor = 'darkgreen'; + css.color = 'darkgreen'; + text = config.strong; + } + + $displayContainer + .css(css) + .text(text); + }); + } + }); + + var requestServer = function (serverURL, $element, val, conf, callback) { + var reqParams = $element.valAttr('req-params') || $element.data('validation-req-params') || {}, + inputName = $element.valAttr('param-name') || $element.attr('name'), + handleResponse = function (response, callback) { + callback(response); + }; + + if (!inputName) { + throw new Error('Missing input name used for http requests made by server validator'); + } + if (!reqParams) { + reqParams = {}; + } + if (typeof reqParams === 'string') { + reqParams = $.parseJSON(reqParams); + } + reqParams[inputName] = val; + + $.ajax({ + url: serverURL, + type: 'POST', + cache: false, + data: reqParams, + dataType: 'json', + error: function (error) { + handleResponse({valid: false, message: 'Connection failed with status: ' + error.statusText}, callback); + return false; + }, + success: function (response) { + handleResponse(response, callback); + } + }); + }; + + /* + * Server validation + */ + $.formUtils.addAsyncValidator({ + name: 'server', + validatorFunction: function (done, val, $input, conf, lang, $form) { + var serverURL = $input.valAttr('url') || conf.backendUrl || document.location.href; + // @todo: deprecated class names that should be removed when moving up to 3.0 + $form.addClass('validating-server-side'); + $input.addClass('validating-server-side'); + requestServer(serverURL, $input, val, conf, function (response) { + $form.removeClass('validating-server-side'); + $input.removeClass('validating-server-side'); + if (response.message) { + $input.attr(conf.validationErrorMsgAttribute, response.message); + } + done(response.valid); + }); + }, + errorMessage: '', + errorMessageKey: 'badBackend' + }); + + /* + * Check for only letters and numbers + * + * http://www.slovo.info/testuni.htm + */ + $.formUtils.addValidator({ + name: 'letternumeric', + validatorFunction: function (val, $el, config, language) { + var patternStart = '^([a-zA-Z0-9\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + patternEnd = ']+)$', + additionalChars = $el.valAttr('allowing'), + pattern = ''; + + if (additionalChars) { + pattern = patternStart + additionalChars + patternEnd; + var extra = additionalChars.replace(/\\/g, ''); + if (extra.indexOf(' ') > -1) { + extra = extra.replace(' ', ''); + extra += language.andSpaces || $.formUtils.LANG.andSpaces; + } + this.errorMessage = language.badAlphaNumeric + language.badAlphaNumericExtra + extra; + } else { + pattern = patternStart + patternEnd; + this.errorMessage = language.badAlphaNumeric; + } + + return new RegExp(pattern).test(val); + }, + errorMessage: '', + errorMessageKey: 'requiredFields' + }); + + /* + * Check password content depending on following parameters: + * data-validation-require-uc-letter, + * data-validation-require-lc-letter, + * data-validation-require-special-char, + * data-validation-require-numeral + */ + $.formUtils.addValidator({ + name : 'complexity', + validatorFunction : function(value, $input, config, language) { + var numRequiredUppercaseChars = $input.valAttr('require-uc-letter') || '0', + numRequiredLowercaseChars = $input.valAttr('require-lc-letter') || '0', + numRequiredSpecialChars = $input.valAttr('require-special-char') || '0', + numRequiredNumericChars = $input.valAttr('require-numeral') || '0', + numRequiredCharsTotal = $input.valAttr('require-length') || '0', + subValidators = { + 'uc-letter': { + pattern: '^(?=(?:.*[A-Z]){'+numRequiredUppercaseChars+',}).+', + numRequired: numRequiredUppercaseChars, + dialogEnd: language.passwordComplexityUppercaseInfo + }, + 'lc-letter': { + pattern: '^(?=(?:.*[a-z]){'+numRequiredLowercaseChars+',}).+', + numRequired: numRequiredLowercaseChars, + dialogEnd: language.passwordComplexityLowercaseInfo + }, + 'special-char': { + pattern: '^(?=(?:.*(_|[!"#$%&\'()*+\\\\,-./:;<=>?@[\\]^_`{|}~])){'+numRequiredSpecialChars+',}).+', + numRequired: numRequiredSpecialChars, + dialogEnd: language.passwordComplexitySpecialCharsInfo + }, + 'numeral': { + pattern: '^(?=(?:.*\\d){'+numRequiredNumericChars+',}).+', + numRequired: numRequiredNumericChars, + dialogEnd: language.passwordComplexityNumericCharsInfo + }, + 'length': { + callback: function(val) { + return val.length >= numRequiredCharsTotal; + }, + numRequired: numRequiredCharsTotal, + dialogEnd: language.lengthBadEnd + } + }, + errorMessage = ''; + + $.each(subValidators, function(name, subValidator) { + var numRequired = parseInt(subValidator.numRequired, 10); + if (numRequired) { + var regexp = new RegExp(subValidator.pattern), + valid = false; + + if (subValidator.callback) { + valid = subValidator.callback(value); + } else { + valid = regexp.test(value); + } + + if (!valid) { + if (errorMessage === '') { + errorMessage = language.passwordComplexityStart; + } + errorMessage += language.passwordComplexitySeparator + numRequired + subValidator.dialogEnd; + $input.trigger('complexityRequirementValidation', [false, name]); + } else { + $input.trigger('complexityRequirementValidation', [true, name]); + } + } + }); + if (errorMessage) { + this.errorMessage = errorMessage + language.passwordComplexityEnd; + return false; + } else { + return true; + } + }, + errorMessage : '', + errorMessageKey: '' + }); + + /* + * Google reCaptcha 2 + */ + $.formUtils.addValidator({ + name: 'recaptcha', + validatorFunction: function (val, $el) { + return grecaptcha.getResponse($el.valAttr('recaptcha-widget-id')) !== ''; + }, + errorMessage: '', + errorMessageKey: 'badreCaptcha' + }); + + $.fn.displayPasswordStrength = function (conf) { + new $.formUtils.validators.validate_strength.strengthDisplay(this, conf); + return this; + }; + + var setupGooglereCaptcha = function (evt, $forms, config) { + if (!$forms) { + $forms = $('form'); + } + if (typeof grecaptcha !== 'undefined' && !$.formUtils.hasLoadedGrecaptcha) { + throw new Error('reCaptcha API can not be loaded by hand, delete reCaptcha API snippet.'); + } else if (!$.formUtils.hasLoadedGrecaptcha && $('[data-validation~="recaptcha"]', $forms).length) { + $.formUtils.hasLoadedGrecaptcha = true; + + var src = '//www.google.com/recaptcha/api.js?onload=reCaptchaLoaded&render=explicit' + (config.lang ? '&hl=' + config.lang : ''); + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.async = true; + script.defer = true; + script.src = src; + document.getElementsByTagName('body')[0].appendChild(script); + } + }; + + window.reCaptchaLoaded = function ($forms) { + if (!$forms || typeof $forms !== 'object' || !$forms.length) { + $forms = $('form'); + } + + $forms.each(function () { + var $form = $(this), + config = $form.get(0).validationConfig || $form.context.validationConfig || false; + + if (config) { + $('[data-validation~="recaptcha"]', $form).each(function () { + var $input = $(this), + div = document.createElement('DIV'), + siteKey = config.reCaptchaSiteKey || $input.valAttr('recaptcha-sitekey'), + theme = config.reCaptchaTheme || $input.valAttr('recaptcha-theme') || 'light', + size = config.reCaptchaSize || $input.valAttr('recaptcha-size') || 'normal', + type = config.reCaptchaType || $input.valAttr('recaptcha-type') || 'image'; + + if (!siteKey) { + throw new Error('Google reCaptcha site key is required.'); + } + + var widgetId = grecaptcha.render(div, { + sitekey: siteKey, + theme: theme, + size: size, + type: type, + callback: function (result) { + $form.find('[data-validation~="recaptcha"]') + .trigger('validation', (result && result !== '')); + + }, + 'expired-callback': function() { + $form.find('[data-validation~="recaptcha"]').trigger('validation', false); + } + }); + $input + .valAttr('recaptcha-widget-id', widgetId) + .hide() + .on('beforeValidation', function (evt) { + // prevent validator from skipping this input because its hidden + evt.stopImmediatePropagation(); + }) + .parent() + .append(div); + }); + } + }); + }; + + $(window).on('validatorsLoaded formValidationSetup', setupGooglereCaptcha); + +})(jQuery, window); + + +})); diff --git a/form-validator/sepa.js b/form-validator/sepa.js index 97b569c..567dcb9 100644 --- a/form-validator/sepa.js +++ b/form-validator/sepa.js @@ -1,9 +1,218 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR - * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT - */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){"use strict";a.formUtils.registerLoadedModule("sepa");var b=[["AD",24,"F04F04A12"],["AE",23,"F03F16"],["AL",28,"F08A16"],["AT",20,"F05F11"],["AZ",28,"U04A20"],["BA",20,"F03F03F08F02"],["BE",16,"F03F07F02"],["BG",22,"U04F04F02A08"],["BH",22,"U04A14"],["BR",29,"F08F05F10U01A01"],["CH",21,"F05A12"],["CR",21,"F03F14"],["CY",28,"F03F05A16"],["CZ",24,"F04F06F10"],["DE",22,"F08F10"],["DK",18,"F04F09F01"],["DO",28,"U04F20"],["EE",20,"F02F02F11F01"],["ES",24,"F04F04F01F01F10"],["FI",18,"F06F07F01"],["FO",18,"F04F09F01"],["FR",27,"F05F05A11F02"],["GB",22,"U04F06F08"],["GE",22,"U02F16"],["GI",23,"U04A15"],["GL",18,"F04F09F01"],["GR",27,"F03F04A16"],["GT",28,"A04A20"],["HR",21,"F07F10"],["HU",28,"F03F04F01F15F01"],["IE",22,"U04F06F08"],["IL",23,"F03F03F13"],["IS",26,"F04F02F06F10"],["IT",27,"U01F05F05A12"],["KW",30,"U04A22"],["KZ",20,"F03A13"],["LB",28,"F04A20"],["LC",32,"U04F24"],["LI",21,"F05A12"],["LT",20,"F05F11"],["LU",20,"F03A13"],["LV",21,"U04A13"],["MC",27,"F05F05A11F02"],["MD",24,"U02A18"],["ME",22,"F03F13F02"],["MK",19,"F03A10F02"],["MR",27,"F05F05F11F02"],["MT",31,"U04F05A18"],["MU",30,"U04F02F02F12F03U03"],["NL",18,"U04F10"],["NO",15,"F04F06F01"],["PK",24,"U04A16"],["PL",28,"F08F16"],["PS",29,"U04A21"],["PT",25,"F04F04F11F02"],["RO",24,"U04A16"],["RS",22,"F03F13F02"],["SA",24,"F02A18"],["SE",24,"F03F16F01"],["SI",19,"F05F08F02"],["SK",24,"F04F06F10"],["SM",27,"U01F05F05A12"],["ST",25,"F08F11F02"],["TL",23,"F03F14F02"],["TN",24,"F02F03F13F02"],["TR",26,"F05F01A16"],["VG",24,"U04F16"],["XK",20,"F04F10F02"],["AO",25,"F21"],["BF",27,"F23"],["BI",16,"F12"],["BJ",28,"F24"],["CI",28,"U01F23"],["CM",27,"F23"],["CV",25,"F21"],["DZ",24,"F20"],["IR",26,"F22"],["JO",30,"A04F22"],["MG",27,"F23"],["ML",28,"U01F23"],["MZ",25,"F21"],["QA",29,"U04A21"],["SN",28,"U01F23"],["UA",29,"F25"]],c=function(a){a=a.replace(/\s+/g,""),a=a.substr(4)+a.substr(0,4),a=a.split("").map(function(a){var b=a.charCodeAt(0);return b>="A".charCodeAt(0)&&b<="Z".charCodeAt(0)?b-"A".charCodeAt(0)+10:a}).join("");for(var b,c=a;c.length>2;)b=c.slice(0,9),c=(parseInt(b,10)%97).toString()+c.slice(b.length);return parseInt(c,10)%97===1},d=function(a){a=a.toUpperCase(),a=a.replace(/\s+/g,"");var c=a.slice(0,2),d=0,e="";for(d=0;d= 'A'.charCodeAt(0) && code <= 'Z'.charCodeAt(0)){ + //A = 10, B = 11, ... Z = 35 + return code - 'A'.charCodeAt(0) + 10; + } else { + return n; + } + }).join(''); + + var remainder = sepa; + var block; + + while (remainder.length > 2) { + block = remainder.slice(0, 9); + remainder = (parseInt(block, 10) % 97).toString() + remainder.slice(block.length); + } + + if (parseInt(remainder, 10) % 97 === 1){ + return true; + } else { + return false; + } + }; + + var countryIBAN = function(sepa) { + sepa = sepa.toUpperCase(); + sepa = sepa.replace(/\s+/g, ''); + + var countryCode = sepa.slice(0,2); + var i = 0; + var structure = ''; + + for (i = 0; i < ibanCountryList.length; ++i){ + if (ibanCountryList[i][0] === countryCode){ + structure = ibanCountryList[i][2]; + break; + } + } + + if (structure === ''){ + return false; + } + + var regex = structure.match(/(.{3})/g).map(function(block){ + + // parse each structure block (1-char + 2-digits) + var format; + var pattern = block.slice(0, 1); + var repeats = parseInt(block.slice(1), 10); + + switch (pattern){ + case 'A': format = '0-9A-Za-z'; break; + case 'B': format = '0-9A-Z'; break; + case 'C': format = 'A-Za-z'; break; + case 'F': format = '0-9'; break; + case 'L': format = 'a-z'; break; + case 'U': format = 'A-Z'; break; + case 'W': format = '0-9a-z'; break; + } + + return '([' + format + ']{' + repeats + '})'; + }); + + var regextest = new RegExp('^' + regex.join('') + '$'); + + return sepa.length === ibanCountryList[i][1] && regextest.test(sepa.slice(4)); + }; + + + $.formUtils.addValidator({ + name: 'sepa', + validatorFunction: generalValidatorFunction, + errorMessage: '', + errorMessageKey:'badSepa' + }); + + $.formUtils.addValidator({ + name: 'iban', + validatorFunction: function(sepa) { + return countryIBAN(sepa) && generalValidatorFunction(sepa); + }, + errorMessage: '', + errorMessageKey:'badIban' + }); + + $.formUtils.addValidator({ + name: 'bic', + validatorFunction: function(bic) { + var regextest = new RegExp('^[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}$'); + return regextest.test(bic); + }, + errorMessage: '', + errorMessageKey:'badBic' + }); + +})(jQuery); + + +})); diff --git a/form-validator/sweden.js b/form-validator/sweden.js index a27ff4d..d38e50e 100644 --- a/form-validator/sweden.js +++ b/form-validator/sweden.js @@ -1,9 +1,238 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: Security + * ------------------------------------------ + * Created by Victor Jonsson * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * This form validation module adds validators typically used on swedish + * websites. This module adds the following validators: + * - validate_swesec (Social security number) + * - validate_swemobile + * - validate_validate_municipality + * - validate_county + * - validate_swephone + * + * @website http://formvalidator.net/#swedish-validators + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){a.formUtils.registerLoadedModule("sweden"),a.formUtils.addValidator({name:"swesec",validatorFunction:function(c,d){var e,f,g,h;if(d.valAttr("use-hyphen")){if(h=c.split("-"),2!==h.length)return!1;c=h.join("")}if(!c.match(/^(\d{4})(\d{2})(\d{2})(\d{4})$/))return!1;e=RegExp.$1,f=a.formUtils.parseDateInt(RegExp.$2),g=a.formUtils.parseDateInt(RegExp.$3);var i=parseInt(RegExp.$4.substring(2,3))%2===0?"female":"male";d.trigger("genderDerived",[i]),b.ssnGender=i;var j=[31,28,31,30,31,30,31,31,30,31,30,31];if((e%400===0||e%4===0&&e%100!==0)&&(j[1]=29),f<1||f>12||g<1||g>j[f-1])return!1;c=c.substring(2,c.length);for(var k="",l=0;l-1},errorMessage:"",errorMessageKey:"badCustomVal",counties:["stockholms län","uppsala län","södermanlands län","östergötlands län","jönköpings län","kronobergs län","kalmar län","gotlands län","blekinge län","skåne län","hallands län","västra götalands län","värmlands län","örebro län","västmanlands län","dalarnas län","gävleborgs län","västernorrlands län","jämtlands län","västerbottens län","norrbottens län"]}),a.formUtils.addValidator({name:"swemunicipality",validatorFunction:function(b){return b=b.toLowerCase(),a.inArray(b,this.municipalities)!==-1||("s kommun"===b.substr(-8)&&a.inArray(b.substr(0,b.length-8),this.municipalities)>-1||" kommun"===b.substr(-7)&&a.inArray(b.substr(0,b.length-7),this.municipalities)>-1)},errorMessage:"",errorMessageKey:"badCustomVal",municipalities:["ale","alingsås","alvesta","aneby","arboga","arjeplog","arvidsjaur","arvika","askersund","avesta","bengtsfors","berg","bjurholm","bjuv","boden","bollebygd","bollnäs","borgholm","borlänge","borås","botkyrka","boxholm","bromölla","bräcke","burlöv","båstad","dals-ed","danderyd","degerfors","dorotea","eda","ekerö","eksjö","emmaboda","enköpings","eskilstuna","eslövs","essunga","fagersta","falkenberg","falköping","falu","filipstad","finspång","flen","forshaga","färgelanda","gagnef","gislaved","gnesta","gnosjö","gotland","grum","grästorp","gullspång","gällivare","gävle","göteborg","götene","habo","hagfor","hallsberg","hallstahammar","halmstad","hammarö","haninge","haparanda","heby","hedemora","helsingborg","herrljunga","hjo","hofor","huddinge","hudiksvall","hultsfred","hylte","håbo","hällefor","härjedalen","härnösand","härryda","hässleholm","höganäs","högsby","hörby","höör","jokkmokk","järfälla","jönköping","kalix","kalmar","karlsborg","karlshamn","karlskoga","karlskrona","karlstad","katrineholm","kil","kinda","kiruna","klippan","knivsta","kramfors","kristianstad","kristinehamn","krokoms","kumla","kungsbacka","kungsör","kungälv","kävlinge","köping","laholm","landskrona","laxå","lekeberg","leksand","lerum","lessebo","lidingö","lidköping","lilla edets","lindesbergs","linköpings","ljungby","ljusdals","ljusnarsbergs","lomma","ludvika","luleå","lunds","lycksele","lysekil","malmö","malung-sälen","malå","mariestad","marks","markaryd","mellerud","mjölby","mora","motala","mullsjö","munkedal","munkfors","mölndal","mönsterås","mörbylånga","nacka","nora","norberg","nordanstig","nordmaling","norrköping","norrtälje","norsjö","nybro","nykvarn","nyköping","nynäshamn","nässjö","ockelbo","olofström","orsa","orust","osby","oskarshamn","ovanåker","oxelösund","pajala","partille","perstorp","piteå","ragunda","robertsfors","ronneby","rättvik","sala","salem","sandviken","sigtuna","simrishamn","sjöbo","skara","skellefteå","skinnskatteberg","skurup","skövde","smedjebacken","sollefteå","sollentuna","solna","sorsele","sotenäs","staffanstorp","stenungsund","stockholm","storfors","storuman","strängnäs","strömstad","strömsund","sundbyberg","sundsvall","sunne","surahammar","svalöv","svedala","svenljunga","säffle","säter","sävsjö","söderhamns","söderköping","södertälje","sölvesborg","tanum","tibro","tidaholm","tierp","timrå","tingsryd","tjörn","tomelilla","torsby","torså","tranemo","tranå","trelleborg","trollhättan","trosa","tyresö","täby","töreboda","uddevalla","ulricehamns","umeå","upplands väsby","upplands-bro","uppsala","uppvidinge","vadstena","vaggeryd","valdemarsvik","vallentuna","vansbro","vara","varberg","vaxholm","vellinge","vetlanda","vilhelmina","vimmerby","vindeln","vingåker","vårgårda","vänersborg","vännäs","värmdö","värnamo","västervik","västerås","växjö","ydre","ystad","åmål","ånge","åre","årjäng","åsele","åstorp","åtvidaberg","älmhult","älvdalen","älvkarleby","älvsbyn","ängelholm","öckerö","ödeshög","örebro","örkelljunga","örnsköldsvik","östersund","österåker","östhammar","östra göinge","överkalix","övertorneå"]}),a.formUtils.addValidator({name:"swephone",validatorFunction:function(a){var b=a.match(/\+/g),c=a.match(/-/g);return!(null!==b&&b.length>1||null!==c&&c.length>1)&&((null===b||0===a.indexOf("+"))&&(a=a.replace(/([-|\+])/g,""),a.length>8&&null===a.match(/[^0-9]/g)))},errorMessage:"",errorMessageKey:"badTelephone"}),a.formUtils.addValidator({name:"swemobile",validatorFunction:function(b){if(!a.formUtils.validators.validate_swephone.validatorFunction(b))return!1;b=b.replace(/[^0-9]/g,"");var c=b.substring(0,3);return(10===b.length||"467"===c)&&((11===b.length||"467"!==c)&&(/07[0-9{1}]/.test(c)||"467"===c))},errorMessage:"",errorMessageKey:"badTelephone"});var c=function(b){var c=[];return a.each(b,function(a,b){c.push(b.substr(0,1).toUpperCase()+b.substr(1,b.length))}),c.sort(),c};a.fn.suggestSwedishCounty=function(b){var d=c(a.formUtils.validators.validate_swecounty.counties);return a.formUtils.suggest(this,d,b)},a.fn.suggestSwedishMunicipality=function(b){var d=c(a.formUtils.validators.validate_swemunicipality.municipalities);return a.formUtils.suggest(this,d,b)}}(a,window)}); \ No newline at end of file +(function ($, window) { + + $.formUtils.registerLoadedModule('sweden'); + + + /* + * Validate swedish social security number yyyymmddXXXX + */ + $.formUtils.addValidator({ + name: 'swesec', + validatorFunction: function (securityNumber, $input) { + + var year, month, day, ssnParts; + + if ($input.valAttr('use-hyphen')) { + ssnParts = securityNumber.split('-'); + if (ssnParts.length !== 2) { + return false; + } + securityNumber = ssnParts.join(''); + } + + if (!securityNumber.match(/^(\d{4})(\d{2})(\d{2})(\d{4})$/)) { + return false; + } + + year = RegExp.$1; + month = $.formUtils.parseDateInt(RegExp.$2); + day = $.formUtils.parseDateInt(RegExp.$3); + + var ssnGender = ( parseInt((RegExp.$4).substring(2, 3)) % 2 ) === 0 ? 'female' : 'male'; + $input.trigger('genderDerived', [ssnGender]); + + // todo: remove when moving to version 3.0 + window.ssnGender = ssnGender; + + var months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + if (year % 400 === 0 || year % 4 === 0 && year % 100 !== 0) { + months[1] = 29; + } + if (month < 1 || month > 12 || day < 1 || day > months[month - 1]) { + return false; + } + + securityNumber = securityNumber.substring(2, securityNumber.length); + var check = ''; + for (var i = 0; i < securityNumber.length; i++) { + check += ((((i + 1) % 2) + 1) * securityNumber.substring(i, i + 1)); + } + var checksum = 0; + for (i = 0; i < check.length; i++) { + checksum += parseInt(check.substring(i, i + 1), 10); + } + + return checksum % 10 === 0; + }, + errorMessage: '', + errorMessageKey: 'badSecurityNumber' + }); + + $.formUtils.addValidator({ + name: 'swecounty', + validatorFunction: function (str) { + str = str.toLowerCase(); + if ($.inArray(str, this.counties) === -1) { + if (str.substr(-3).toLocaleLowerCase() !== 'län') { + return $.inArray(str + 's län', this.counties) > -1; + } + + return false; + } + else { + return true; + } + }, + errorMessage: '', + errorMessageKey: 'badCustomVal', + counties: ['stockholms län', + 'uppsala län', + 'södermanlands län', + 'östergötlands län', + 'jönköpings län', + 'kronobergs län', + 'kalmar län', + 'gotlands län', + 'blekinge län', + 'skåne län', + 'hallands län', + 'västra götalands län', + 'värmlands län', + 'örebro län', + 'västmanlands län', + 'dalarnas län', + 'gävleborgs län', + 'västernorrlands län', + 'jämtlands län', + 'västerbottens län', + 'norrbottens län'] + }); + + $.formUtils.addValidator({ + name: 'swemunicipality', + validatorFunction: function (str) { + str = str.toLowerCase(); + if ($.inArray(str, this.municipalities) === -1) { + + // First check (dont return) + if (str.substr(-8) === 's kommun') { + if ($.inArray(str.substr(0, str.length - 8), this.municipalities) > -1) { + return true; + } + } + + // Second check + if (str.substr(-7) === ' kommun') { + return $.inArray(str.substr(0, str.length - 7), this.municipalities) > -1; + } + + return false; + } + else { + return true; + } + }, + errorMessage: '', + errorMessageKey: 'badCustomVal', + municipalities: ['ale', 'alingsås', 'alvesta', 'aneby', 'arboga', 'arjeplog', 'arvidsjaur', 'arvika', 'askersund', 'avesta', 'bengtsfors', 'berg', 'bjurholm', 'bjuv', 'boden', 'bollebygd', 'bollnäs', 'borgholm', 'borlänge', 'borås', 'botkyrka', 'boxholm', 'bromölla', 'bräcke', 'burlöv', 'båstad', 'dals-ed', 'danderyd', 'degerfors', 'dorotea', 'eda', 'ekerö', 'eksjö', 'emmaboda', 'enköpings', 'eskilstuna', 'eslövs', 'essunga', 'fagersta', 'falkenberg', 'falköping', 'falu', 'filipstad', 'finspång', 'flen', 'forshaga', 'färgelanda', 'gagnef', 'gislaved', 'gnesta', 'gnosjö', 'gotland', 'grum', 'grästorp', 'gullspång', 'gällivare', 'gävle', 'göteborg', 'götene', 'habo', 'hagfor', 'hallsberg', 'hallstahammar', 'halmstad', 'hammarö', 'haninge', 'haparanda', 'heby', 'hedemora', 'helsingborg', 'herrljunga', 'hjo', 'hofor', 'huddinge', 'hudiksvall', 'hultsfred', 'hylte', 'håbo', 'hällefor', 'härjedalen', 'härnösand', 'härryda', 'hässleholm', 'höganäs', 'högsby', 'hörby', 'höör', 'jokkmokk', 'järfälla', 'jönköping', 'kalix', 'kalmar', 'karlsborg', 'karlshamn', 'karlskoga', 'karlskrona', 'karlstad', 'katrineholm', 'kil', 'kinda', 'kiruna', 'klippan', 'knivsta', 'kramfors', 'kristianstad', 'kristinehamn', 'krokoms', 'kumla', 'kungsbacka', 'kungsör', 'kungälv', 'kävlinge', 'köping', 'laholm', 'landskrona', 'laxå', 'lekeberg', 'leksand', 'lerum', 'lessebo', 'lidingö', 'lidköping', 'lilla edets', 'lindesbergs', 'linköpings', 'ljungby', 'ljusdals', 'ljusnarsbergs', 'lomma', 'ludvika', 'luleå', 'lunds', 'lycksele', 'lysekil', 'malmö', 'malung-sälen', 'malå', 'mariestad', 'marks', 'markaryd', 'mellerud', 'mjölby', 'mora', 'motala', 'mullsjö', 'munkedal', 'munkfors', 'mölndal', 'mönsterås', 'mörbylånga', 'nacka', 'nora', 'norberg', 'nordanstig', 'nordmaling', 'norrköping', 'norrtälje', 'norsjö', 'nybro', 'nykvarn', 'nyköping', 'nynäshamn', 'nässjö', 'ockelbo', 'olofström', 'orsa', 'orust', 'osby', 'oskarshamn', 'ovanåker', 'oxelösund', 'pajala', 'partille', 'perstorp', 'piteå', 'ragunda', 'robertsfors', 'ronneby', 'rättvik', 'sala', 'salem', 'sandviken', 'sigtuna', 'simrishamn', 'sjöbo', 'skara', 'skellefteå', 'skinnskatteberg', 'skurup', 'skövde', 'smedjebacken', 'sollefteå', 'sollentuna', 'solna', 'sorsele', 'sotenäs', 'staffanstorp', 'stenungsund', 'stockholm', 'storfors', 'storuman', 'strängnäs', 'strömstad', 'strömsund', 'sundbyberg', 'sundsvall', 'sunne', 'surahammar', 'svalöv', 'svedala', 'svenljunga', 'säffle', 'säter', 'sävsjö', 'söderhamns', 'söderköping', 'södertälje', 'sölvesborg', 'tanum', 'tibro', 'tidaholm', 'tierp', 'timrå', 'tingsryd', 'tjörn', 'tomelilla', 'torsby', 'torså', 'tranemo', 'tranå', 'trelleborg', 'trollhättan', 'trosa', 'tyresö', 'täby', 'töreboda', 'uddevalla', 'ulricehamns', 'umeå', 'upplands väsby', 'upplands-bro', 'uppsala', 'uppvidinge', 'vadstena', 'vaggeryd', 'valdemarsvik', 'vallentuna', 'vansbro', 'vara', 'varberg', 'vaxholm', 'vellinge', 'vetlanda', 'vilhelmina', 'vimmerby', 'vindeln', 'vingåker', 'vårgårda', 'vänersborg', 'vännäs', 'värmdö', 'värnamo', 'västervik', 'västerås', 'växjö', 'ydre', 'ystad', 'åmål', 'ånge', 'åre', 'årjäng', 'åsele', 'åstorp', 'åtvidaberg', 'älmhult', 'älvdalen', 'älvkarleby', 'älvsbyn', 'ängelholm', 'öckerö', 'ödeshög', 'örebro', 'örkelljunga', 'örnsköldsvik', 'östersund', 'österåker', 'östhammar', 'östra göinge', 'överkalix', 'övertorneå'] + }); + + + /* + * Validate phone number, at least 7 digits only one hyphen and plus allowed + */ + $.formUtils.addValidator({ + name: 'swephone', + validatorFunction: function (tele) { + var numPlus = tele.match(/\+/g); + var numHifen = tele.match(/-/g); + + if ((numPlus !== null && numPlus.length > 1) || (numHifen !== null && numHifen.length > 1)) { + return false; + } + if (numPlus !== null && tele.indexOf('+') !== 0) { + return false; + } + + tele = tele.replace(/([-|\+])/g, ''); + return tele.length > 8 && tele.match(/[^0-9]/g) === null; + }, + errorMessage: '', + errorMessageKey: 'badTelephone' + }); + + + /* + * Validate that string is a swedish telephone number + */ + $.formUtils.addValidator({ + name: 'swemobile', + validatorFunction: function (number) { + if (!$.formUtils.validators.validate_swephone.validatorFunction(number)) { + return false; + } + + number = number.replace(/[^0-9]/g, ''); + var begin = number.substring(0, 3); + + if (number.length !== 10 && begin !== '467') { + return false; + } else if (number.length !== 11 && begin === '467') { + return false; + } + return (/07[0-9{1}]/).test(begin) || begin === '467'; + }, + errorMessage: '', + errorMessageKey: 'badTelephone' + }); + + /** + * @private + * @param {Array} listItems + * @return {Array} + */ + var _makeSortedList = function (listItems) { + var newList = []; + $.each(listItems, function (i, v) { + newList.push(v.substr(0, 1).toUpperCase() + v.substr(1, v.length)); + }); + newList.sort(); + return newList; + }; + + $.fn.suggestSwedishCounty = function (settings) { + var counties = _makeSortedList($.formUtils.validators.validate_swecounty.counties); + return $.formUtils.suggest(this, counties, settings); + }; + + $.fn.suggestSwedishMunicipality = function (settings) { + var municipalities = _makeSortedList($.formUtils.validators.validate_swemunicipality.municipalities); + return $.formUtils.suggest(this, municipalities, settings); + }; + +})(jQuery, window); + + +})); diff --git a/form-validator/toggleDisabled.js b/form-validator/toggleDisabled.js index b496653..ed777f0 100644 --- a/form-validator/toggleDisabled.js +++ b/form-validator/toggleDisabled.js @@ -1,9 +1,138 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: Toggle Disabled + * ------------------------------------------ + * Created by Victor Jonsson * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * This module will take care of disabling/enabling submit buttons + * in forms, depending on if the inputs of the form is valid or not. + * + * @website http://formvalidator.net/ + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b,c){"use strict";function d(b,c,d){var e=!0;return b.find("[data-validation]").each(function(){if(this!==c){var b=a(this),f=b.hasClass(d.successElementClass),g="true"===b.valAttr("optional"),h=b.hasClass(d.errorElementClass);if(h||!f&&!g)return e=!1,!1}}),e}a.formUtils.registerLoadedModule("toggleDisabled");var e=function(a,b){"disabled"===b?a.find('*[type="submit"]').addClass("disabled").attr("disabled","disabled"):a.find('*[type="submit"]').removeClass("disabled").removeAttr("disabled")},f=!1;a.formUtils.$win.bind("validatorsLoaded formValidationSetup",function(b,g,h){var i=h.disabledFormFilter?g.filter(h.disabledFormFilter):g,j=h.showErrorDialogs===c||h.showErrorDialogs,k=function(b,c,d){var e=a(this);d&&d.indexOf("blur")>-1?e.unbind("afterValidation",k):c.isValid?e.unbind("afterValidation",k):e.valAttr("have-been-blurred")||(c.shouldChangeDisplay=!1)};i.addClass(j?"disabled-with-errors":"disabled-without-errors").on("reset",function(){e(a(this),"disabled")}).find("*[data-validation]").valAttr("event","keyup change").on("validation",function(b,c){if(!f){f=!0;var g=a(this).closest("form");c&&d(g,this,h)?e(g,"enabled"):e(g,"disabled"),f=!1}}).on("afterValidation",k).on("blur",function(){a(this).valAttr("have-been-blurred",1)}).each(function(){var b=a(this),c=b.attr("data-validation");c.indexOf("checkbox_group")>-1&&b.closest("form").find('input[name="'+b.attr("name")+'"]').each(function(){a(this).on("change",function(){b.validate()})})}),i.find("[data-validation-async]").valAttr("event","change"),e(i,"disabled"),i.validateOnEvent(h.language,h)}).on("validationErrorDisplay",function(a,b,c){b.closest("form").hasClass("disabled-without-errors")&&c.hide()})}(a,window)}); \ No newline at end of file +(function($, window, undefined) { + + 'use strict'; + + $.formUtils.registerLoadedModule('toggleDisabled'); + + // Function that can enable/disable form + var toggleFormState = function($form, state) { + if( state === 'disabled' ) { + $form.find('*[type="submit"]') + .addClass('disabled') + .attr('disabled', 'disabled'); + } else { + $form.find('*[type="submit"]') + .removeClass('disabled') + .removeAttr('disabled'); + } + }, + isCheckingIfFormValid = false; + + $.formUtils.$win.bind('validatorsLoaded formValidationSetup', function(evt, $forms, conf) { + + var $formsToDisable = conf.disabledFormFilter ? $forms.filter(conf.disabledFormFilter) : $forms, + showErrorDialogs = conf.showErrorDialogs === undefined || conf.showErrorDialogs, + afterValidationCallback = function(evt, result, evtContext) { + var $this = $(this); + if (evtContext && evtContext.indexOf('blur') > -1) { + $this.unbind('afterValidation', afterValidationCallback); + } else { + if (result.isValid) { + $this.unbind('afterValidation', afterValidationCallback); + } else if (!$this.valAttr('have-been-blurred')) { + result.shouldChangeDisplay = false; + } + } + }; + + // Toggle form state depending on if it has only valid inputs or not. + $formsToDisable + .addClass(showErrorDialogs ? 'disabled-with-errors' : 'disabled-without-errors') + .on('reset', function() { + toggleFormState($(this), 'disabled'); + }) + .find('*[data-validation]') + .valAttr('event','keyup change') + .on('validation', function(evt, valid) { + if (!isCheckingIfFormValid) { + isCheckingIfFormValid = true; + var $form = $(this).closest('form'); + if(valid && peekIfFormIsSuccessfullyValidated($form, this, conf)) { + toggleFormState($form, 'enabled'); + } else { + toggleFormState($form, 'disabled'); + } + isCheckingIfFormValid = false; + } + }) + .on('afterValidation', afterValidationCallback) + .on('blur', function() { + $(this).valAttr('have-been-blurred', 1); + }) + .each(function() { + var $input = $(this), + validationRules = $input.attr('data-validation'); + if (validationRules.indexOf('checkbox_group') > -1) { + $input.closest('form').find('input[name="'+$input.attr('name')+'"]').each(function() { + $(this).on('change', function() { + $input.validate(); + }); + }); + } + }); + + // Notice! Async validator can't be validated onkeyup + $formsToDisable.find('[data-validation-async]').valAttr('event', 'change'); + + // Make all inputs validated on keyup, require validateOnEvent in validation config + toggleFormState($formsToDisable, 'disabled'); + + $formsToDisable.validateOnEvent(conf.language, conf); + + }) + .on('validationErrorDisplay', function(evt, $input, $elem) { + if ( $input.closest('form').hasClass('disabled-without-errors') ) { + $elem.hide(); + } + }); + + // We want to peek at the form to check if all is valid, we don't want to trigger + // the validators since that seems to cause unwanted side effects, that's hard to foresee + function peekIfFormIsSuccessfullyValidated($form, excludeInputElement, config) { + var allValid = true; + $form.find('[data-validation]').each(function() { + if (this !== excludeInputElement) { + var $elem = $(this), + hasSuccessfullyValidated = $elem.hasClass(config.successElementClass), + isOptional = $elem.valAttr('optional') === 'true', + isInvalid = $elem.hasClass(config.errorElementClass); + if (isInvalid || (!hasSuccessfullyValidated && !isOptional)) { + allValid = false; + return false; + } + } + }); + return allValid; + } + +})(jQuery, window); + + +})); diff --git a/form-validator/uk.js b/form-validator/uk.js index 7188bcc..2b3b8e7 100644 --- a/form-validator/uk.js +++ b/form-validator/uk.js @@ -1,9 +1,162 @@ -/** File generated by Grunt -- do not modify - * JQUERY-FORM-VALIDATOR +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(["jquery"], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +}(this, function (jQuery) { + +/** + * jQuery Form Validator Module: UK + * ------------------------------------------ + * Created by Victor Jonsson * - * @version 2.3.77 - * @website http://formvalidator.net/ - * @author Victor Jonsson, http://victorjonsson.se - * @license MIT + * This form validation module adds validators typically used on + * websites in the UK. This module adds the following validators: + * - ukvatnumber + * - ukutr + * - uknin + * + * @website http://formvalidator.net/#uk-validators + * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){"use strict";a.formUtils.registerLoadedModule("uk"),a.formUtils.addValidator({name:"ukvatnumber",validatorFunction:function(a){if(a=a.replace(/[^0-9]/g,""),a.length<9)return!1;var b=!1,c=[];c=a.split("");var d=Number(c[7]+c[8]),e=c[0],f=c[1];if(0===e&&f>0)return!1;for(var g=0,h=0;h<7;h++)g+=c[h]*(8-h);for(var i=0,j=0,k=8;k>=2;k--)i+=c[j]*k,j++;for(;g>0;)g-=97;return g=Math.abs(g),d===g&&(b=!0),b||(g%=97,g>=55?g-=55:g+=42,g===d&&(b=!0)),b},errorMessage:"",errorMessageKey:"badUKVatAnswer"}),a.formUtils.addValidator({name:"ukutr",validatorFunction:function(a){var b=[0,6,7,8,9,10,5,4,3,2],c=[2,1,9,8,7,6,5,4,3,2,1],d=0;if(/\d{10}/.test(a)&&10===a.length){for(var e=0;e<10;e++)d+=a[e]*b[e];if(parseInt(a.charAt(0))===c[d%11])return!0}return!1},errorMessage:"",errorMessageKey:"badUkUtr"}),a.formUtils.addValidator({name:"uknin",validatorFunction:function(a){return!!/^(?!BG)(?!GB)(?!NK)(?!KN)(?!TN)(?!NT)(?!ZZ)(?:[A-CEGHJ-PR-TW-Z][A-CEGHJ-NPR-TW-Z])(?:\s*\d\s*){6}([A-D]|\s)$/i.test(a)},errorMessage:"",errorMessageKey:"badUkNin"})}(a)}); \ No newline at end of file +(function($) { + + 'use strict'; + + + $.formUtils.registerLoadedModule('uk'); + + /** + * UK VAT Validator + */ + $.formUtils.addValidator({ + name : 'ukvatnumber', + validatorFunction : function(number) { + + // Code Adapted from http://www.codingforums.com/showthread.php?t=211967 + // TODO: Extra Checking for other VAT Numbers (Other countries and UK Government/Health Authorities) + + number = number.replace(/[^0-9]/g, ''); + + //Check Length + if(number.length < 9) { + return false; + } + + var valid = false; + + var VATsplit = []; + VATsplit = number.split(''); + + var checkDigits = Number(VATsplit[7] + VATsplit[8]); // two final digits as a number + + var firstDigit = VATsplit[0]; + var secondDigit = VATsplit[1]; + if ((firstDigit === 0) && (secondDigit > 0)) { + return false; + } + + var total = 0; + for (var i = 0; i < 7; i++) { // first 7 digits + total += VATsplit[i]* (8-i); // sum weighted cumulative total + } + + var c = 0; + var j = 0; + + for (var m = 8; m >= 2; m--) { + c += VATsplit[j] * m; + j++; + } + + // Traditional Algorithm for VAT numbers issued before 2010 + + while (total > 0) { + total -= 97; // deduct 97 repeatedly until total is negative + } + total = Math.abs(total); // make positive + + if (checkDigits === total) { + valid = true; + } + + // If not valid try the new method (introduced November 2009) by subtracting 55 from the mod 97 check digit if we can - else add 42 + + if (!valid) { + total = total%97; // modulus 97 + + if (total >= 55) { + total = total - 55; + } else { + total = total + 42; + } + + if (total === checkDigits) { + valid = true; + } + } + + return valid; + }, + errorMessage : '', + errorMessageKey: 'badUKVatAnswer' +}); + + /** + * UK Unique Taxpayer Reference Validator + */ + $.formUtils.addValidator({ + name: 'ukutr', + validatorFunction: function (utr) + { + var weights = [0, 6, 7, 8, 9, 10, 5, 4, 3, 2], + checkDigits = [2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1], + checkSum = 0; + + if (/\d{10}/.test(utr) && utr.length === 10) + { + for (var i = 0; i < 10; i++) { + checkSum += utr[ i ] * weights[ i ]; + } + + if (parseInt(utr.charAt(0)) === checkDigits[checkSum % 11]) + { + return true; + } + } + + return false; + }, + errorMessage: '', + errorMessageKey: 'badUkUtr' + }); + + /** + * UK National Insurance number Validator + */ + $.formUtils.addValidator({ + name: 'uknin', + validatorFunction: function(val){ + if( /^(?!BG)(?!GB)(?!NK)(?!KN)(?!TN)(?!NT)(?!ZZ)(?:[A-CEGHJ-PR-TW-Z][A-CEGHJ-NPR-TW-Z])(?:\s*\d\s*){6}([A-D]|\s)$/i.test( val ) ){ + return true; + } + + return false; + }, + errorMessage: '', + errorMessageKey: 'badUkNin' + }); + +})(jQuery); + + +})); diff --git a/package.json b/package.json index 58714af..cb5e379 100644 --- a/package.json +++ b/package.json @@ -37,10 +37,10 @@ "grunt-umd": "~2.4.0", "numeral": "~1.5.3", "qunitjs": "^1.20.0", - "jquery": ">1.8.0" + "jquery": "2.2.4" }, "dependencies": { - "jquery": ">1.8.0" + "jquery": "2.2.4" }, "scripts": { "prepublish": "grunt prepublish", From 9a258d6e7b0d707b1d4c1d30366317ee96e3edc3 Mon Sep 17 00:00:00 2001 From: Victor Jonsson Date: Mon, 13 Aug 2018 23:59:08 +0200 Subject: [PATCH 08/15] ... --- formvalidator.jquery.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/formvalidator.jquery.json b/formvalidator.jquery.json index 1fa9abf..1f277cc 100644 --- a/formvalidator.jquery.json +++ b/formvalidator.jquery.json @@ -7,7 +7,7 @@ "validation", "validator" ], - "version": "2.3.77", + "version": "2.3.78", "author": { "name": "Victor Jonsson", "url": "http://victorjonsson.se", diff --git a/package.json b/package.json index cb5e379..e732e6b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jquery-form-validator", "description": "With this feature rich jQuery plugin it becomes easy to validate user input while keeping your HTML markup clean from javascript code. Even though this plugin has a wide range of validation functions it's designed to require as little bandwidth as possible. This is achieved by grouping together validation functions in \"modules\", making it possible for the programmer to load only those functions that's needed to validate a particular form.", - "version": "2.3.77", + "version": "2.3.78", "main": "./form-validator/jquery.form-validator.min.js", "keywords": [ "form", From d6e3c5a75e702c93ea3e9ad35eb6e9225c71152b Mon Sep 17 00:00:00 2001 From: Victor Jonsson Date: Tue, 14 Aug 2018 00:08:44 +0200 Subject: [PATCH 09/15] Update README.md --- README.md | 213 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 210 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 077c75d..e02a533 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ *Validation framework that let's you configure, rather than code, your validation logic.* -I started writing this plugin back in 2009 and it has given me much joy over the year. But all good things must come to an end and now it's time for this plugin to pull in its oars and go down with history. +I started writing this plugin back in 2009 and it has given me much joy over the years. But all good things must come to an end and now it's time for this plugin to pull in its oars and go down with history. **NOTICE!** This plugin is no longer being developed! It supports jQuery v. 1.8 >= 2.2.4. No pull requests will become merged in but feel free to fork and do whatever you like! @@ -41,7 +41,7 @@ I started writing this plugin back in 2009 and it has given me much joy over the ### Support for HTML5 -This plugin can serve as a fallback solution for the validation attributes in the HTML5 spec. With the [html5](http://www.formvalidator.net/#configuration_html5) module you can use the following native features: +This plugin can serve as a fallback solution for the validation attributes in the HTML5 spec. With the html5 module you can use the following native features: **Attributes**: require, pattern, maxlength, min, max, placeholder @@ -70,7 +70,7 @@ This plugin can serve as a fallback solution for the validation attributes in th * Create input suggestions with ease, no jquery-ui needed * to apply multiple validators to an input element, separate the validator names using a space (ex: required email) -Read the documentation for the default features at [http://formvalidator.net/#default-validators](http://formvalidator.net/#default-validators) +Read the documentation for the default features at [#default-validators](#default-validators) ### Module: security * **spamcheck** @@ -280,6 +280,213 @@ This plugin comes with translations for English, Polish, Portuguese. You can also choose to override the error dialogs yourself. Here you can read more about [localization](http://formvalidator.net/#localization) +# Default validators + +### Answer length (required) + +``` + + + + + + + + + + + + + + + + +``` +This plugin also supports the attributes "required" and "maxlength" by using the Html5 module. + +### Numbers +``` + + + + + + + + + + + + + + + + + + + + +You can also define the decimal separator when initializing the validation. + +

    + Average points
    + +

    + .... + + +``` +Inputs of type "number" will also become validated by loading the html5 module. + +### E-mail +``` + +``` +Inputs of type "email" will also become validated by loading the html5 module. + +### URL:s + +``` + +``` +Inputs of type "url" will also become validated by loading the html5 module. + +### Date + +``` + + + + + + + + +``` + +See the date module for further validators. + +### Alphanumeric + +``` + + + + + +``` +If you want to allow any kind of letters (not only A-Z) you're looking for the letternumeric validator. + +### Checkboxes Group +Validate qty of checkboxes in a group (same name) have been checked, using min, max or range. Only the first checkbox element in the group needs to have the validation attributes added. +``` + + + + + + +If your checkboxes group is generated by a server-side script and you don't want to add the validation attributes to each input element, you can use this javascript snippet before calling the validatorLoad() function + + + +Regexp + + +``` + +This plugin also supports the attribute "pattern" by using the Html5 module. + +### Character count down +``` +

    + History (50 characters left) + +

    + +``` +### Make validation optional +``` + + +``` +You can also use the logic module if you want the validation of an input depend on another input having a value. + +### Display help text +It is possible to display help information beside each input. The text will fade in when the input gets focus on and fade out when the input looses focus. The container for the help text will have the class form-help. If you don't want this feature you can read the setup guide on how to disable it. + +``` +
    +

    + Why not? + +

    + ... +
    + ``` +### Validate inputs when blurred + +By default each input will become validated immediately when the input looses focus. If you don't want this feature you can read the setup guide on how to disable it. + +### Input suggestions +There are two ways you can give suggestions to the user while the user types. + +1) Using attribute data-suggestions + +``` +

    + What's your favorite color? + +

    + ... + +``` +2) Using $.formUtils.suggest() +``` + +``` +This plugin also supports the data-list element by using the Html5 module. + +Ignoring characters +You can tell any validator to ignore certain characters by using the attribute data-validation-ignore (comma separated list). +``` +

    + How much do you want to donate? + + +

    +``` + ## Changelog #### 2.3.19 From 819a89758adcbf4f63db5d021f00e95179ea5ddf Mon Sep 17 00:00:00 2001 From: Victor Jonsson Date: Wed, 22 Aug 2018 07:53:41 +0200 Subject: [PATCH 10/15] version bump --- form-validator/brazil.js | 143 +- form-validator/color.js | 278 +-- form-validator/date.js | 126 +- form-validator/file.js | 367 +-- form-validator/html5.js | 199 +- form-validator/jquery.form-validator.js | 2 +- form-validator/jquery.form-validator.min.js | 2383 +------------------ form-validator/jsconf.js | 80 +- form-validator/lang/ar.js | 103 +- form-validator/lang/ca.js | 87 +- form-validator/lang/cs.js | 90 +- form-validator/lang/da.js | 90 +- form-validator/lang/de.js | 90 +- form-validator/lang/es.js | 94 +- form-validator/lang/fa.js | 89 +- form-validator/lang/fr.js | 87 +- form-validator/lang/it.js | 87 +- form-validator/lang/ka.js | 93 +- form-validator/lang/ko.js | 94 +- form-validator/lang/nl.js | 87 +- form-validator/lang/no.js | 87 +- form-validator/lang/pl.js | 96 +- form-validator/lang/pt.js | 90 +- form-validator/lang/ro.js | 90 +- form-validator/lang/ru.js | 91 +- form-validator/lang/sv.js | 88 +- form-validator/lang/tr.js | 103 +- form-validator/lang/vi.js | 86 +- form-validator/location.js | 106 +- form-validator/logic.js | 166 +- form-validator/poland.js | 141 +- form-validator/sanitize.js | 247 +- form-validator/security.js | 630 +---- form-validator/sepa.js | 227 +- form-validator/sweden.js | 243 +- form-validator/toggleDisabled.js | 143 +- form-validator/uk.js | 167 +- package.json | 2 +- 38 files changed, 252 insertions(+), 7220 deletions(-) diff --git a/form-validator/brazil.js b/form-validator/brazil.js index dcaea0b..12d9e1b 100644 --- a/form-validator/brazil.js +++ b/form-validator/brazil.js @@ -1,138 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator Module: Brazil - * ------------------------------------------ - * Created by Eduardo Cuducos +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * This form validation module adds validators typically used on - * websites in the Brazil. This module adds the following validators: - * - cpf - * - cep - * - brphone - * - * @website http://formvalidator.net/#brazil-validators - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($) { - - $.formUtils.registerLoadedModule('brazil'); - - $.formUtils.addValidator({ - name : 'cpf', - validatorFunction : function(string) { - - // Based on this post from DevMedia: - // http://www.devmedia.com.br/validar-cpf-com-javascript/23916 - - // clean up the input (digits only) and set some support vars - var cpf = string.replace(/\D/g,''); - var sum1 = 0; - var sum2 = 0; - var remainder1 = 0; - var remainder2 = 0; - - // skip special cases - if (cpf.length !== 11 || cpf === '00000000000') { - return false; - } - - // check 1st verification digit - for (i = 1; i<= 9; i++) { - sum1 += parseInt(cpf.substring(i - 1, i)) * (11 - i); - } - remainder1 = (sum1 * 10) % 11; - if (remainder1 >= 10) { - remainder1 = 0; - } - if (remainder1 !== parseInt(cpf.substring(9, 10))) { - return false; - } - - // check 2nd verification digit - for (i = 1; i <= 10; i++) { - sum2 += parseInt(cpf.substring(i - 1, i)) * (12 - i); - } - remainder2 = (sum2 * 10) % 11; - if (remainder2 >= 10) { - remainder2 = 0; - } - if (remainder2 !== parseInt(cpf.substring(10, 11))) { - return false; - } - - return true; - - }, - errorMessage : '', - errorMessageKey: 'badBrazilCPFAnswer' - - }); - - $.formUtils.addValidator({ - name : 'brphone', - validatorFunction : function(string) { - - // validates telefones such as (having X as numbers): - // (XX) XXXX-XXXX - // (XX) XXXXX-XXXX - // XX XXXXXXXX - // XX XXXXXXXXX - // XXXXXXXXXX - // XXXXXXXXXXX - // +XX XX XXXXX-XXXX - // +X XX XXXX-XXXX - // And so on… - - if (string.match(/^(\+[\d]{1,3}[\s]{0,1}){0,1}(\(){0,1}(\d){2}(\)){0,1}(\s){0,1}(\d){4,5}([-. ]){0,1}(\d){4}$/g)) { - return true; - } - - return false; - - }, - errorMessage : '', - errorMessageKey: 'badBrazilTelephoneAnswer' - - }); - - $.formUtils.addValidator({ - name : 'cep', - validatorFunction : function(string) { - - // validates CEP such as (having X as numbers): - // XXXXX-XXX - // XXXXX.XXX - // XXXXX XXX - // XXXXXXXX - - if (string.match(/^(\d){5}([-. ]){0,1}(\d){3}$/g)) { - return true; - } - - return false; - - }, - errorMessage : '', - errorMessageKey: 'badBrazilCEPAnswer' - - }); - -})(jQuery); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){a.formUtils.registerLoadedModule("brazil"),a.formUtils.addValidator({name:"cpf",validatorFunction:function(a){var b=a.replace(/\D/g,""),c=0,d=0,e=0,f=0;if(11!==b.length||"00000000000"===b)return!1;for(i=1;i<=9;i++)c+=parseInt(b.substring(i-1,i))*(11-i);if(e=10*c%11,e>=10&&(e=0),e!==parseInt(b.substring(9,10)))return!1;for(i=1;i<=10;i++)d+=parseInt(b.substring(i-1,i))*(12-i);return f=10*d%11,f>=10&&(f=0),f===parseInt(b.substring(10,11))},errorMessage:"",errorMessageKey:"badBrazilCPFAnswer"}),a.formUtils.addValidator({name:"brphone",validatorFunction:function(a){return!!a.match(/^(\+[\d]{1,3}[\s]{0,1}){0,1}(\(){0,1}(\d){2}(\)){0,1}(\s){0,1}(\d){4,5}([-. ]){0,1}(\d){4}$/g)},errorMessage:"",errorMessageKey:"badBrazilTelephoneAnswer"}),a.formUtils.addValidator({name:"cep",validatorFunction:function(a){return!!a.match(/^(\d){5}([-. ]){0,1}(\d){3}$/g)},errorMessage:"",errorMessageKey:"badBrazilCEPAnswer"})}(a)}); \ No newline at end of file diff --git a/form-validator/color.js b/form-validator/color.js index 644c464..b7f8a17 100644 --- a/form-validator/color.js +++ b/form-validator/color.js @@ -1,273 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator Module: Color - * ------------------------------------------ - * Created by dszymczuk +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * - * This form validation module adds validators for some color formats like: hex, rgb, rgba, hsl, hsla. - * Also it allow to use transparent as color - * This module adds the following validators: - * - color - * - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($) { - - $.formUtils.registerLoadedModule('color'); - - /* - HELPER FUNCTIONS - */ - var filterFloat = function(value) { - if (/^(\-|\+)?([0-9]+(\.[0-9]+)?|Infinity)$/ - .test(value)) { - return Number(value); - } - - return NaN; - }; - - var isBetween0and1 = function(value) { - return value > 0 && value < 1; - }; - - // workaround for PhantomJS - // https://github.com/ariya/phantomjs/issues/14014 - // can't use Number.isInteger - var isInteger = function(value) { - return Math.floor(value) === value && $.isNumeric(value); - }; - - /** - * Check HEX format - */ - $.formUtils.addValidator({ - name: 'hex', - validatorFunction: function(val, $el) { - if ($el.valAttr('allow-transparent') === 'true' && val === 'transparent') { - return true; - } - - var startWithHex = val[0] === '#'; - if (!startWithHex) { - return false; - } - - var isCorrectLength = val.length === 4 || val.length === 7; - - if (isCorrectLength) { - var regex = /[0-9a-f]/i; - var valueSliced = val.slice(1).split(''); - var isValid = true; - valueSliced.forEach(function(i) { - if (i.match(regex) === null) { - isValid = false; - } - }); - return isValid; - } - - return false; - }, - errorMessage: '', - errorMessageKey: 'badHex' - }); - - /** - * Check RGB format - */ - $.formUtils.addValidator({ - name: 'rgb', - validatorFunction: function(val, $el) { - if ($el.valAttr('allow-transparent') === 'true' && val === 'transparent') { - return true; - } - - var removedSpace = val.replace(/ /g, ''); - var regex = /rgb\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3}\)/i; - - if (removedSpace.match(regex)) { - var removeRgbCall = removedSpace.replace(/rgb/g, ''); - var removeBrackets = removeRgbCall.replace(/\(/g, '').replace(/\)/g, ''); - var valueSliced = removeBrackets.split(','); - var isValid = true; - - valueSliced.forEach(function(i) { - var parsedInt = parseInt(i, 10); - if ((isInteger(parsedInt) && 0 <= parsedInt && parsedInt <= 255) === false) { - isValid = false; - } - }); - return isValid; - } - - return false; - }, - errorMessage: '', - errorMessageKey: 'badRgb' - }); - - /** - * Check RGBA format - */ - $.formUtils.addValidator({ - name: 'rgba', - validatorFunction: function(val, $el) { - if ($el.valAttr('allow-transparent') === 'true' && val === 'transparent') { - return true; - } - - var removedSpace = val.replace(/ /g, ''); - var regex = /rgba\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0,1]?.?[0-9]*\)/i; - - if (removedSpace.match(regex)) { - var removeRgbaCall = removedSpace.replace(/rgba/g, ''); - var removeBrackets = removeRgbaCall.replace(/\(/g, '').replace(/\)/g, ''); - var valueSliced = removeBrackets.split(','); - var isValid = true; - - valueSliced.forEach(function(i, index) { - var value = filterFloat(i); - if (isInteger(value)) { - var isInRange = value >= 0 && value <= 255; - if (!isInRange) { - isValid = false; - } - - if (isValid && index === 3) { - isValid = value >= 0 && value < 2; - } - } else if (!isBetween0and1(i)) { - isValid = false; - } - }); - return isValid; - } - - return false; - }, - errorMessage: '', - errorMessageKey: 'badRgba' - }); - - /** - * Check HSL format - */ - $.formUtils.addValidator({ - name: 'hsl', - validatorFunction: function(val, $el) { - if ($el.valAttr('allow-transparent') === 'true' && val === 'transparent') { - return true; - } - - var removedSpace = val.replace(/ /g, ''); - var regex = /hsl\(-?[0-9]{1,3},[0-9]{1,3}%,[0-9]{1,3}%\)/i; - - if (removedSpace.match(regex)) { - var removeHslCall = removedSpace.replace(/hsl/g, ''); - var removeBrackets = removeHslCall.replace(/\(/g, '').replace(/\)/g, ''); - var valueSliced = removeBrackets.split(','); - var isValid = true; - - valueSliced.forEach(function(i, index) { - var parsedInt = parseInt(i, 10); - - if (isInteger(parsedInt)) { - if (index !== 0) { - var isInRange = parsedInt >= 0 && parsedInt <= 100; - if (!isInRange) { - isValid = false; - } - } - } else { - isValid = false; - } - }); - return isValid; - } - - return false; - }, - errorMessage: '', - errorMessageKey: 'badHsl' - }); - - /** - * Check HSLA format - */ - $.formUtils.addValidator({ - name: 'hsla', - validatorFunction: function(val, $el) { - if ($el.valAttr('allow-transparent') === 'true' && val === 'transparent') { - return true; - } - - var isInRange; - var removedSpace = val.replace(/ /g, ''); - var regex = /hsla\(-?[0-9]{1,3},[0-9]{1,3}%,[0-9]{1,3}%,[0,1]?.?[0-9]*\)/i; - - if (removedSpace.match(regex)) { - var removeHslaCall = removedSpace.replace(/hsla/g, ''); - var removeBrackets = removeHslaCall.replace(/\(/g, '').replace(/\)/g, ''); - var valueSliced = removeBrackets.split(','); - var isValid = true; - - valueSliced.forEach(function(i, index) { - var value = filterFloat(i); - var parsedInt = parseInt(i, 10); - - if (isInteger(value)) { - if (index !== 0 && index !== 3) { - isInRange = value >= 0 && value <= 100; - if (!isInRange) { - isValid = false; - } - } - - if (isValid && index === 3) { - isValid = value >= 0 && value < 2; - } - } else if (isNaN(value) && isInteger(parsedInt)) { - isInRange = parsedInt >= 0 && parsedInt <= 100; - if (!isInRange) { - isValid = false; - } - } else { - value = filterFloat(Number(i).toFixed(20)); - - isInRange = value >= 0 && value <= 1; - if (!isInRange) { - isValid = false; - } - } - }); - - return isValid; - } - - return false; - }, - errorMessage: '', - errorMessageKey: 'badHsla' - }); - -})(jQuery); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){a.formUtils.registerLoadedModule("color");var b=function(a){return/^(\-|\+)?([0-9]+(\.[0-9]+)?|Infinity)$/.test(a)?Number(a):NaN},c=function(a){return a>0&&a<1},d=function(b){return Math.floor(b)===b&&a.isNumeric(b)};a.formUtils.addValidator({name:"hex",validatorFunction:function(a,b){if("true"===b.valAttr("allow-transparent")&&"transparent"===a)return!0;var c="#"===a[0];if(!c)return!1;var d=4===a.length||7===a.length;if(d){var e=/[0-9a-f]/i,f=a.slice(1).split(""),g=!0;return f.forEach(function(a){null===a.match(e)&&(g=!1)}),g}return!1},errorMessage:"",errorMessageKey:"badHex"}),a.formUtils.addValidator({name:"rgb",validatorFunction:function(a,b){if("true"===b.valAttr("allow-transparent")&&"transparent"===a)return!0;var c=a.replace(/ /g,""),e=/rgb\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3}\)/i;if(c.match(e)){var f=c.replace(/rgb/g,""),g=f.replace(/\(/g,"").replace(/\)/g,""),h=g.split(","),i=!0;return h.forEach(function(a){var b=parseInt(a,10);(d(b)&&0<=b&&b<=255)===!1&&(i=!1)}),i}return!1},errorMessage:"",errorMessageKey:"badRgb"}),a.formUtils.addValidator({name:"rgba",validatorFunction:function(a,e){if("true"===e.valAttr("allow-transparent")&&"transparent"===a)return!0;var f=a.replace(/ /g,""),g=/rgba\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0,1]?.?[0-9]*\)/i;if(f.match(g)){var h=f.replace(/rgba/g,""),i=h.replace(/\(/g,"").replace(/\)/g,""),j=i.split(","),k=!0;return j.forEach(function(a,e){var f=b(a);if(d(f)){var g=f>=0&&f<=255;g||(k=!1),k&&3===e&&(k=f>=0&&f<2)}else c(a)||(k=!1)}),k}return!1},errorMessage:"",errorMessageKey:"badRgba"}),a.formUtils.addValidator({name:"hsl",validatorFunction:function(a,b){if("true"===b.valAttr("allow-transparent")&&"transparent"===a)return!0;var c=a.replace(/ /g,""),e=/hsl\(-?[0-9]{1,3},[0-9]{1,3}%,[0-9]{1,3}%\)/i;if(c.match(e)){var f=c.replace(/hsl/g,""),g=f.replace(/\(/g,"").replace(/\)/g,""),h=g.split(","),i=!0;return h.forEach(function(a,b){var c=parseInt(a,10);if(d(c)){if(0!==b){var e=c>=0&&c<=100;e||(i=!1)}}else i=!1}),i}return!1},errorMessage:"",errorMessageKey:"badHsl"}),a.formUtils.addValidator({name:"hsla",validatorFunction:function(a,c){if("true"===c.valAttr("allow-transparent")&&"transparent"===a)return!0;var e,f=a.replace(/ /g,""),g=/hsla\(-?[0-9]{1,3},[0-9]{1,3}%,[0-9]{1,3}%,[0,1]?.?[0-9]*\)/i;if(f.match(g)){var h=f.replace(/hsla/g,""),i=h.replace(/\(/g,"").replace(/\)/g,""),j=i.split(","),k=!0;return j.forEach(function(a,c){var f=b(a),g=parseInt(a,10);d(f)?(0!==c&&3!==c&&(e=f>=0&&f<=100,e||(k=!1)),k&&3===c&&(k=f>=0&&f<2)):isNaN(f)&&d(g)?(e=g>=0&&g<=100,e||(k=!1)):(f=b(Number(a).toFixed(20)),e=f>=0&&f<=1,e||(k=!1))}),k}return!1},errorMessage:"",errorMessageKey:"badHsla"})}(a)}); \ No newline at end of file diff --git a/form-validator/date.js b/form-validator/date.js index 8f57021..ad744d3 100644 --- a/form-validator/date.js +++ b/form-validator/date.js @@ -1,121 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator Module: Date - * ------------------------------------------ - * Created by Victor Jonsson - * Documentation and issue tracking on Github +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * The following validators will be added by this module: - * - Time (HH:mmm) - * - Birth date - * - * @website http://formvalidator.net/#location-validators - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function ($) { - - $.formUtils.registerLoadedModule('date'); - - /* - * Validate time hh:mm - */ - $.formUtils.addValidator({ - name: 'time', - validatorFunction: function (time) { - if (time.match(/^(\d{2}):(\d{2})$/) === null) { - return false; - } else { - var hours = parseInt(time.split(':')[0], 10); - var minutes = parseInt(time.split(':')[1], 10); - if (hours > 23 || minutes > 59) { - return false; - } - } - return true; - }, - errorMessage: '', - errorMessageKey: 'badTime' - }); - - /* - * Is this a valid birth date - */ - $.formUtils.addValidator({ - name: 'birthdate', - validatorFunction: function (val, $el, conf) { - var dateFormat = 'yyyy-mm-dd'; - if ($el.valAttr('format')) { - dateFormat = $el.valAttr('format'); - } - else if (typeof conf.dateFormat !== 'undefined') { - dateFormat = conf.dateFormat; - } - - var inputDate = $.formUtils.parseDate(val, dateFormat); - if (!inputDate) { - return false; - } - - var year = inputDate[0], - month = inputDate[1], - day = inputDate[2], - age = getAge(year, month, day), - allowedAgeRange = ($el.valAttr('age-range') || '0-124').split('-'); - - $el.trigger('ageCalculated', [age]); - - if (allowedAgeRange.length !== 2 || !$.isNumeric(allowedAgeRange[0]) || !$.isNumeric(allowedAgeRange[1])) { - throw new Error('Date range format invalid'); - } - - return age >= allowedAgeRange[0] && age <= allowedAgeRange[1]; - }, - errorMessage: '', - errorMessageKey: 'badDate' - }); - - function getAge(otherDateYear, otherDateMonth, otherDateDay) { - var birthDate = new Date(otherDateYear, otherDateMonth, otherDateDay), now = new Date(), - years = now.getFullYear() - birthDate.getFullYear(); - birthDate.setFullYear(birthDate.getFullYear() + years); - if (birthDate > now) { - years--; - birthDate.setFullYear(birthDate.getFullYear() - 1); - } - var days = Math.floor((now.getTime() - birthDate.getTime()) / (3600 * 24 * 1000)), - yearsOld = years + days / (isLeapYear(now.getFullYear()) ? 366 : 365), - decimals = ((yearsOld + '').split('.')[1] || '').substr(0, 3); - - if (yearsOld >= 0) { - return Math.floor(yearsOld) + (decimals >= 915 ? 1:0); - } else { - decimals *= 10; - return Math.floor(yearsOld) + (decimals <= 840 ? 1:0); - } - } - - function isLeapYear(year) { - var d = new Date(year, 1, 28); - d.setDate(d.getDate() + 1); - return d.getMonth() === 1; - } - -})(jQuery); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){function b(a,b,d){var e=new Date(a,b,d),f=new Date,g=f.getFullYear()-e.getFullYear();e.setFullYear(e.getFullYear()+g),e>f&&(g--,e.setFullYear(e.getFullYear()-1));var h=Math.floor((f.getTime()-e.getTime())/864e5),i=g+h/(c(f.getFullYear())?366:365),j=((i+"").split(".")[1]||"").substr(0,3);return i>=0?Math.floor(i)+(j>=915?1:0):(j*=10,Math.floor(i)+(j<=840?1:0))}function c(a){var b=new Date(a,1,28);return b.setDate(b.getDate()+1),1===b.getMonth()}a.formUtils.registerLoadedModule("date"),a.formUtils.addValidator({name:"time",validatorFunction:function(a){if(null===a.match(/^(\d{2}):(\d{2})$/))return!1;var b=parseInt(a.split(":")[0],10),c=parseInt(a.split(":")[1],10);return!(b>23||c>59)},errorMessage:"",errorMessageKey:"badTime"}),a.formUtils.addValidator({name:"birthdate",validatorFunction:function(c,d,e){var f="yyyy-mm-dd";d.valAttr("format")?f=d.valAttr("format"):"undefined"!=typeof e.dateFormat&&(f=e.dateFormat);var g=a.formUtils.parseDate(c,f);if(!g)return!1;var h=g[0],i=g[1],j=g[2],k=b(h,i,j),l=(d.valAttr("age-range")||"0-124").split("-");if(d.trigger("ageCalculated",[k]),2!==l.length||!a.isNumeric(l[0])||!a.isNumeric(l[1]))throw new Error("Date range format invalid");return k>=l[0]&&k<=l[1]},errorMessage:"",errorMessageKey:"badDate"})}(a)}); \ No newline at end of file diff --git a/form-validator/file.js b/form-validator/file.js index 40a2145..0e887a6 100644 --- a/form-validator/file.js +++ b/form-validator/file.js @@ -1,362 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator Module: File - * ------------------------------------------ - * Created by Victor Jonsson +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * The following validators will be added by this module: - * - mime type - * - file size - * - file extension - * - * @todo, Use $.formUtils.asyncValidation in "dimension" validator - * - * @website http://formvalidator.net/#file-validators - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - $.formUtils.registerLoadedModule('file'); - - 'use strict'; - - var SUPPORTS_FILE_READER = typeof window.FileReader !== 'undefined', - - /** - * @return {Array} - */ - _getTypes = function($input) { - var allowedTypes = ($input.valAttr('allowing') || '').toLowerCase().split(/,\s*/); - if ($.inArray('jpg', allowedTypes) > -1 && $.inArray('jpeg', allowedTypes) === -1) { - allowedTypes.push('jpeg'); - } - else if ($.inArray('jpeg', allowedTypes) > -1 && $.inArray('jpg', allowedTypes) === -1) { - allowedTypes.push('jpg'); - } - return allowedTypes; - }, - - /** - * @param {Object} obj - * @param {String} key - * @param {String} insert - * @param {Object} lang - */ - _generateErrorMsg = function(obj, key, insert, lang) { - var msg = lang[key] || ''; - obj.errorMessageKey = ''; // only use message attached to this object - obj.errorMessage = msg.replace('\%s', insert); - }, - - /** - * @param {String} imgPath - * @param {Function} successCallback - * @param {Function} errCallback - * @private - */ - _loadImage = function(imgPath, successCallback, errCallback) { - var reader = new FileReader(), - image = new Image(); - - reader.readAsDataURL(imgPath); - - reader.onload = function(fileObj) { - image.onload = function() { - $(window).trigger('imageValidation', [this]); - successCallback(this); - }; - - image.onerror= function() { - errCallback(); - }; - - image.src = fileObj.target.result; - }; - }; - - /* - * Validate mime type (falls back on validate_extension in older browsers) - */ - $.formUtils.addValidator({ - name : 'mime', - validatorFunction : function(str, $input, conf, language) { - if( SUPPORTS_FILE_READER ) { - var valid = true, - files = $input.get(0).files || [], - mime = '', - allowedTypes = _getTypes($input); - - if( files.length ) { - $.each(files, function(i, file) { - valid = false; - mime = file.type || file.name.substring(file.name.lastIndexOf('.') + 1); - $.each(allowedTypes, function(j, type) { - valid = mime.indexOf(type) > -1; - if( valid ) { - return false; - } - }); - return valid; - }); - - if (!valid) { - $.formUtils.warn('Trying to upload a file with mime type '+mime+' which is not allowed'); - _generateErrorMsg(this, 'wrongFileType', allowedTypes.join(', '), language); - } - } - - return valid; - - } else { - $.formUtils.warn('FileReader not supported by browser, will check file extension'); - return $.formUtils.validators.validate_extension.validatorFunction(str, $input, conf, language); - } - }, - errorMessage : '', - errorMessageKey: 'wrongFileType' - }); - - /** - * Validate file extension - */ - $.formUtils.addValidator({ - name : 'extension', - validatorFunction : function(value, $input, conf, language) { - var valid = true, - _this = this, - allowedTypes = _getTypes($input); - - $.each($input.get(0).files || [value], function(i, file) { - var val = typeof file === 'string' ? file : (file.value || file.fileName || file.name), - ext = val.substr( val.lastIndexOf('.')+1 ); - - if( $.inArray(ext.toLowerCase(), allowedTypes) === -1 ) { - valid = false; - _generateErrorMsg(_this, 'wrongFileType', allowedTypes.join(', '), language); - return false; - } - }); - - return valid; - }, - errorMessage : '', - errorMessageKey: 'wrongFileType' - }); - - /** - * Validate file size - */ - $.formUtils.addValidator({ - name : 'size', - validatorFunction : function(val, $input, conf, language) { - var maxSize = $input.valAttr('max-size'); - if( !maxSize ) { - $.formUtils.warn('Input "'+$input.attr('name')+'" is missing data-validation-max-size attribute', true); - return true; - } else if( !SUPPORTS_FILE_READER ) { - return true; // no fallback available - } - - var maxBytes = $.formUtils.convertSizeNameToBytes(maxSize), - valid = true; - - $.each($input.get(0).files || [], function(i, file) { - valid = file.size <= maxBytes; - return valid; - }); - - if( !valid ) { - _generateErrorMsg(this, 'wrongFileSize', maxSize, language); - } - return valid; - }, - errorMessage : '', - errorMessageKey: 'wrongFileSize' - }); - - /** - * Make this function accessible via formUtils for unit tests - * @param {String} sizeName - * @return {Number} - */ - $.formUtils.convertSizeNameToBytes = function(sizeName) { - sizeName = sizeName.toUpperCase(); - if( sizeName.substr(sizeName.length-1, 1) === 'M' ) { - return parseInt(sizeName.substr(0, sizeName.length-1), 10) * 1024 * 1024; - } else if( sizeName.substr(sizeName.length-2, 2) === 'MB' ) { - return parseInt(sizeName.substr(0, sizeName.length-2), 10) * 1024 * 1024; - } else if( sizeName.substr(sizeName.length-2, 2) === 'KB' ) { - return parseInt(sizeName.substr(0, sizeName.length-2), 10) * 1024; - } else if( sizeName.substr(sizeName.length-1, 1) === 'B' ) { - return parseInt(sizeName.substr(0, sizeName.length-1), 10); - } else { - return parseInt(sizeName, 10); - } - }; - - /** - * Attach dimension check onto formUtils only for unit testing purpose - * @param {HTMLImageElement} img - * @param {String} dimDeclaration - * @param {Boolean|String} Returns error message if image was invalid, false otherwise - */ - $.formUtils.checkImageDimension = function(img, dimDeclaration, language) { - var error = false, - restrictedDim = {width:0, height:0}, - getDimRestriction = function(dimDeclaration) { - dimDeclaration = dimDeclaration.replace('min', '').replace('max', ''); - var chunks = dimDeclaration.split('x'); - restrictedDim.width = chunks[0]; - restrictedDim.height = chunks[1] ? chunks[1] : chunks[0]; - }, - minDeclaration = false, - maxDeclaration = false, - declarationParts = dimDeclaration.split('-'); - - if( declarationParts.length === 1 ) { - if( declarationParts[0].indexOf('min') === 0 ) { - minDeclaration = declarationParts[0]; - } else { - maxDeclaration = declarationParts[0]; - } - } else { - minDeclaration = declarationParts[0]; - maxDeclaration = declarationParts[1]; - } - - if( minDeclaration ) { - // check min - getDimRestriction(minDeclaration); - if( img.width < restrictedDim.width || img.height < restrictedDim.height ) { - error = language.imageTooSmall + ' ('+language.min+' '+restrictedDim.width+'x'+restrictedDim.height+'px)'; - } - } - - if( !error && maxDeclaration ) { - // Check max - getDimRestriction(maxDeclaration); - if( img.width > restrictedDim.width || img.height > restrictedDim.height ) { - if( img.width > restrictedDim.width ) { - error = language.imageTooWide +' '+restrictedDim.width+'px'; - } else { - error = language.imageTooTall +' '+restrictedDim.height+'px'; - } - error += ' ('+language.max+' '+restrictedDim.width+'x'+restrictedDim.height+'px)'; - } - } - - return error; - }; - - /** - * Attach ratio validation onto formUtils only for unit testing purpose - * @param {HTMLImageElement} img - * @param {String} dimDeclaration - * @param {Boolean|String} Returns error message if image was invalid, false otherwise - */ - $.formUtils.checkImageRatio = function(img, ratioDeclaration, language) { - var ratio = img.width / img.height, - calculateRatio = function(declaration) { - var dims = declaration.replace('max', '').replace('min', '').split(':'); - return dims[0] / dims[1]; - }, - declarationParts = ratioDeclaration.split('-'), - isWithin = function(val, min, max) { - return val >= min && val <= max; - }; - - if ( declarationParts.length === 1 ) { - if ( ratio !== calculateRatio(declarationParts[0]) ) { - return language.imageRatioNotAccepted; - } - } - else if( declarationParts.length === 2 && !isWithin(ratio, calculateRatio(declarationParts[0]), calculateRatio(declarationParts[1])) ) { - return language.imageRatioNotAccepted; - } - return false; - }; - - /** - * Validate image dimension - */ - $.formUtils.addAsyncValidator({ - name : 'dimension', - validatorFunction : function(done, val, $input, conf, language) { - if (!SUPPORTS_FILE_READER) { - // Unable to do the validation, lacking FileReader support - done(true); - } else { - var file = $input.get(0).files || [], - thisValidator = this; - if ($input.attr('data-validation').indexOf('mime') === -1) { - alert('You should validate file type being jpg, gif or png on input ' + $input[0].name); - done(false); - } else if (file.length > 1) { - alert('Validating image dimensions does not support inputs allowing multiple files'); - done(false); - } else if (file.length === 0) { - done(true); - } else { - _loadImage(file[0], function (img) { - var error = false; - - if ($input.valAttr('dimension')) { - error = $.formUtils.checkImageDimension(img, $input.valAttr('dimension'), language); - } - - if (!error && $input.valAttr('ratio')) { - error = $.formUtils.checkImageRatio(img, $input.valAttr('ratio'), language); - } - - // Set validation result flag on input - if (error) { - thisValidator.errorMessage = language.wrongFileDim + ' ' + $input.valAttr('has-not-valid-dim'); - done(false); - } else { - done(true); - } - - }, function (err) { - throw err; - }); - } - } - }, - errorMessage : '', - errorMessageKey: '' // error message created dynamically - // errorMessageKey: 'wrongFileDim' - }); - - /* - * This event listener will remove error messages for file - * inputs when file changes - */ - $(window).one('validatorsLoaded formValidationSetup', function(evt, $form, conf) { - var $inputs; - if( $form ) { - $inputs = $form.find('input[type="file"]'); - } else { - $inputs = $('input[type="file"]'); - } - $.formUtils.dialogs.removeInputStylingAndMessage($inputs, conf); - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){a.formUtils.registerLoadedModule("file");var c="undefined"!=typeof b.FileReader,d=function(b){var c=(b.valAttr("allowing")||"").toLowerCase().split(/,\s*/);return a.inArray("jpg",c)>-1&&a.inArray("jpeg",c)===-1?c.push("jpeg"):a.inArray("jpeg",c)>-1&&a.inArray("jpg",c)===-1&&c.push("jpg"),c},e=function(a,b,c,d){var e=d[b]||"";a.errorMessageKey="",a.errorMessage=e.replace("%s",c)},f=function(c,d,e){var f=new FileReader,g=new Image;f.readAsDataURL(c),f.onload=function(c){g.onload=function(){a(b).trigger("imageValidation",[this]),d(this)},g.onerror=function(){e()},g.src=c.target.result}};a.formUtils.addValidator({name:"mime",validatorFunction:function(b,f,g,h){if(c){var i=!0,j=f.get(0).files||[],k="",l=d(f);return j.length&&(a.each(j,function(b,c){return i=!1,k=c.type||c.name.substring(c.name.lastIndexOf(".")+1),a.each(l,function(a,b){if(i=k.indexOf(b)>-1)return!1}),i}),i||(a.formUtils.warn("Trying to upload a file with mime type "+k+" which is not allowed"),e(this,"wrongFileType",l.join(", "),h))),i}return a.formUtils.warn("FileReader not supported by browser, will check file extension"),a.formUtils.validators.validate_extension.validatorFunction(b,f,g,h)},errorMessage:"",errorMessageKey:"wrongFileType"}),a.formUtils.addValidator({name:"extension",validatorFunction:function(b,c,f,g){var h=!0,i=this,j=d(c);return a.each(c.get(0).files||[b],function(b,c){var d="string"==typeof c?c:c.value||c.fileName||c.name,f=d.substr(d.lastIndexOf(".")+1);if(a.inArray(f.toLowerCase(),j)===-1)return h=!1,e(i,"wrongFileType",j.join(", "),g),!1}),h},errorMessage:"",errorMessageKey:"wrongFileType"}),a.formUtils.addValidator({name:"size",validatorFunction:function(b,d,f,g){var h=d.valAttr("max-size");if(!h)return a.formUtils.warn('Input "'+d.attr("name")+'" is missing data-validation-max-size attribute',!0),!0;if(!c)return!0;var i=a.formUtils.convertSizeNameToBytes(h),j=!0;return a.each(d.get(0).files||[],function(a,b){return j=b.size<=i}),j||e(this,"wrongFileSize",h,g),j},errorMessage:"",errorMessageKey:"wrongFileSize"}),a.formUtils.convertSizeNameToBytes=function(a){return a=a.toUpperCase(),"M"===a.substr(a.length-1,1)?1024*parseInt(a.substr(0,a.length-1),10)*1024:"MB"===a.substr(a.length-2,2)?1024*parseInt(a.substr(0,a.length-2),10)*1024:"KB"===a.substr(a.length-2,2)?1024*parseInt(a.substr(0,a.length-2),10):"B"===a.substr(a.length-1,1)?parseInt(a.substr(0,a.length-1),10):parseInt(a,10)},a.formUtils.checkImageDimension=function(a,b,c){var d=!1,e={width:0,height:0},f=function(a){a=a.replace("min","").replace("max","");var b=a.split("x");e.width=b[0],e.height=b[1]?b[1]:b[0]},g=!1,h=!1,i=b.split("-");return 1===i.length?0===i[0].indexOf("min")?g=i[0]:h=i[0]:(g=i[0],h=i[1]),g&&(f(g),(a.widthe.width||a.height>e.height)&&(d=a.width>e.width?c.imageTooWide+" "+e.width+"px":c.imageTooTall+" "+e.height+"px",d+=" ("+c.max+" "+e.width+"x"+e.height+"px)")),d},a.formUtils.checkImageRatio=function(a,b,c){var d=a.width/a.height,e=function(a){var b=a.replace("max","").replace("min","").split(":");return b[0]/b[1]},f=b.split("-"),g=function(a,b,c){return a>=b&&a<=c};if(1===f.length){if(d!==e(f[0]))return c.imageRatioNotAccepted}else if(2===f.length&&!g(d,e(f[0]),e(f[1])))return c.imageRatioNotAccepted;return!1},a.formUtils.addAsyncValidator({name:"dimension",validatorFunction:function(b,d,e,g,h){if(c){var i=e.get(0).files||[],j=this;e.attr("data-validation").indexOf("mime")===-1?(alert("You should validate file type being jpg, gif or png on input "+e[0].name),b(!1)):i.length>1?(alert("Validating image dimensions does not support inputs allowing multiple files"),b(!1)):0===i.length?b(!0):f(i[0],function(c){var d=!1;e.valAttr("dimension")&&(d=a.formUtils.checkImageDimension(c,e.valAttr("dimension"),h)),!d&&e.valAttr("ratio")&&(d=a.formUtils.checkImageRatio(c,e.valAttr("ratio"),h)),d?(j.errorMessage=h.wrongFileDim+" "+e.valAttr("has-not-valid-dim"),b(!1)):b(!0)},function(a){throw a})}else b(!0)},errorMessage:"",errorMessageKey:""}),a(b).one("validatorsLoaded formValidationSetup",function(b,c,d){var e;e=c?c.find('input[type="file"]'):a('input[type="file"]'),a.formUtils.dialogs.removeInputStylingAndMessage(e,d)})}(a,window)}); \ No newline at end of file diff --git a/form-validator/html5.js b/form-validator/html5.js index f5876d9..498d3bc 100644 --- a/form-validator/html5.js +++ b/form-validator/html5.js @@ -1,194 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator Module: html5 - * ------------------------------------------ - * Created by Victor Jonsson +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * The following module will make this jQuery plugin serve as a - * html5 fallback. It makes older browsers support the following - * - validation when type="email" - * - validation when type="url" - * - validation when type="time" - * - validation when type="date" - * - validation when type="number" and max="" min="" - * - validation when pattern="REGEXP" - * - validation when using maxlength - * - Using datalist element for creating suggestions - * - placeholders - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function ($) { - - 'use strict'; - - $.formUtils.registerLoadedModule('html5'); - - var SUPPORTS_PLACEHOLDER = 'placeholder' in document.createElement('INPUT'), - SUPPORTS_DATALIST = 'options' in document.createElement('DATALIST'), - hasLoadedDateModule = false, - setupValidationUsingHTML5Attr = function ($form) { - - $form.each(function () { - var $f = $(this), - $formInputs = $f.find('input,textarea,select'), - foundHtml5Rule = false; - - $formInputs.each(function () { - var validation = [], - $input = $(this), - isRequired = $input.attr('required'), - attrs = {}; - - if (isRequired) { - validation.push('required'); - } - - switch (($input.attr('type') || '').toLowerCase()) { - case 'time': - validation.push('time'); - if (!$.formUtils.validators.validate_date && !hasLoadedDateModule) { - hasLoadedDateModule = true; - $.formUtils.loadModules('date'); - } - break; - case 'url': - validation.push('url'); - break; - case 'email': - validation.push('email'); - break; - case 'date': - validation.push('date'); - break; - case 'number': - validation.push('number'); - var max = $input.attr('max'), - min = $input.attr('min'), - step = $input.attr('step'); - if (min || max) { - if (!min) { - min = '0'; - } - if (!max) { - max = '9007199254740992'; // js max int - } - if (!step) { - step = '1'; // default value - } - - attrs['data-validation-allowing'] = 'range[' + min + ';' + max + ']'; - if (min.indexOf('-') === 0 || max.indexOf('-') === 0) { - attrs['data-validation-allowing'] += ',negative'; - } - if (min.indexOf('.') > -1 || max.indexOf('.') > -1 || step.indexOf('.') > -1) { - attrs['data-validation-allowing'] += ',float'; - } - } else { - attrs['data-validation-allowing'] += ',float,negative'; - } - break; - } - - if ($input.attr('pattern')) { - validation.push('custom'); - attrs['data-validation-regexp'] = $input.attr('pattern'); - } - if ($input.attr('maxlength')) { - validation.push('length'); - attrs['data-validation-length'] = 'max' + $input.attr('maxlength'); - } - - if (!SUPPORTS_DATALIST && $input.attr('list')) { - var suggestions = [], - $list = $('#' + $input.attr('list')); - - $list.find('option').each(function () { - suggestions.push($(this).text()); - }); - - if (suggestions.length === 0) { - // IE fix - var opts = $.trim($('#' + $input.attr('list')).text()).split('\n'); - $.each(opts, function (i, option) { - suggestions.push($.trim(option)); - }); - } - - $list.remove(); - - $.formUtils.suggest($input, suggestions); - } - - if (validation.length) { - if (!isRequired) { - attrs['data-validation-optional'] = 'true'; - } - - foundHtml5Rule = true; - - var validationRules = ($input.attr('data-validation') || '') + ' ' + validation.join(' '); - $input.attr('data-validation', $.trim(validationRules)); - - $.each(attrs, function (attrName, attrVal) { - $input.attr(attrName, attrVal); - }); - } - }); - - if (foundHtml5Rule) { - $f.trigger('html5ValidationAttrsFound'); - } - - if (!SUPPORTS_PLACEHOLDER) { - $formInputs.filter('input[placeholder]').each(function () { - this.__defaultValue = this.getAttribute('placeholder'); - $(this) - .bind('focus', function () { - if (this.value === this.__defaultValue) { - this.value = ''; - $(this).removeClass('showing-placeholder'); - } - }) - .bind('blur', function () { - if ($.trim(this.value) === '') { - this.value = this.__defaultValue; - $(this).addClass('showing-placeholder'); - } - }); - }); - } - - }); - }; - - $.formUtils.$win.bind('validatorsLoaded formValidationSetup', function (evt, $form) { - if (!$form) { - $form = $('form'); - } - setupValidationUsingHTML5Attr($form); - }); - - // Make this method available outside the module - $.formUtils.setupValidationUsingHTML5Attr = setupValidationUsingHTML5Attr; - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){"use strict";a.formUtils.registerLoadedModule("html5");var b="placeholder"in document.createElement("INPUT"),c="options"in document.createElement("DATALIST"),d=!1,e=function(e){e.each(function(){var e=a(this),f=e.find("input,textarea,select"),g=!1;f.each(function(){var b=[],e=a(this),f=e.attr("required"),h={};switch(f&&b.push("required"),(e.attr("type")||"").toLowerCase()){case"time":b.push("time"),a.formUtils.validators.validate_date||d||(d=!0,a.formUtils.loadModules("date"));break;case"url":b.push("url");break;case"email":b.push("email");break;case"date":b.push("date");break;case"number":b.push("number");var i=e.attr("max"),j=e.attr("min"),k=e.attr("step");j||i?(j||(j="0"),i||(i="9007199254740992"),k||(k="1"),h["data-validation-allowing"]="range["+j+";"+i+"]",0!==j.indexOf("-")&&0!==i.indexOf("-")||(h["data-validation-allowing"]+=",negative"),(j.indexOf(".")>-1||i.indexOf(".")>-1||k.indexOf(".")>-1)&&(h["data-validation-allowing"]+=",float")):h["data-validation-allowing"]+=",float,negative"}if(e.attr("pattern")&&(b.push("custom"),h["data-validation-regexp"]=e.attr("pattern")),e.attr("maxlength")&&(b.push("length"),h["data-validation-length"]="max"+e.attr("maxlength")),!c&&e.attr("list")){var l=[],m=a("#"+e.attr("list"));if(m.find("option").each(function(){l.push(a(this).text())}),0===l.length){var n=a.trim(a("#"+e.attr("list")).text()).split("\n");a.each(n,function(b,c){l.push(a.trim(c))})}m.remove(),a.formUtils.suggest(e,l)}if(b.length){f||(h["data-validation-optional"]="true"),g=!0;var o=(e.attr("data-validation")||"")+" "+b.join(" ");e.attr("data-validation",a.trim(o)),a.each(h,function(a,b){e.attr(a,b)})}}),g&&e.trigger("html5ValidationAttrsFound"),b||f.filter("input[placeholder]").each(function(){this.__defaultValue=this.getAttribute("placeholder"),a(this).bind("focus",function(){this.value===this.__defaultValue&&(this.value="",a(this).removeClass("showing-placeholder"))}).bind("blur",function(){""===a.trim(this.value)&&(this.value=this.__defaultValue,a(this).addClass("showing-placeholder"))})})})};a.formUtils.$win.bind("validatorsLoaded formValidationSetup",function(b,c){c||(c=a("form")),e(c)}),a.formUtils.setupValidationUsingHTML5Attr=e}(a,window)}); \ No newline at end of file diff --git a/form-validator/jquery.form-validator.js b/form-validator/jquery.form-validator.js index bbd6f71..b8dee25 100644 --- a/form-validator/jquery.form-validator.js +++ b/form-validator/jquery.form-validator.js @@ -17,7 +17,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.77 + * @version 2.3.79 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/jquery.form-validator.min.js b/form-validator/jquery.form-validator.min.js index bbd6f71..c950eef 100644 --- a/form-validator/jquery.form-validator.min.js +++ b/form-validator/jquery.form-validator.min.js @@ -1,2387 +1,10 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.77 + * @version 2.3.79 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT */ -/** - */ -(function ($, window, undefined) { - - var disableFormSubmit = function () { - return false; - }, - lastFormEvent = null, - HaltManager = { - numHalted: 0, - haltValidation: function($form) { - this.numHalted++; - $.formUtils.haltValidation = true; - $form - .unbind('submit', disableFormSubmit) - .bind('submit', disableFormSubmit) - .find('*[type="submit"]') - .addClass('disabled') - .attr('disabled', 'disabled'); - }, - unHaltValidation: function($form) { - this.numHalted--; - if (this.numHalted === 0) { - $.formUtils.haltValidation = false; - $form - .unbind('submit', disableFormSubmit) - .find('*[type="submit"]') - .removeClass('disabled') - .removeAttr('disabled', 'disabled'); - } - } - }; - - function AsyncValidation($form, $input) { - this.$form = $form; - this.$input = $input; - this.reset(); - $input.on('change paste', this.reset.bind(this)); - } - - AsyncValidation.prototype.reset = function() { - this.haltedFormValidation = false; - this.hasRun = false; - this.isRunning = false; - this.result = undefined; - }; - - AsyncValidation.prototype.run = function(eventContext, callback) { - if (eventContext === 'keyup') { - return null; - } else if (this.isRunning) { - lastFormEvent = eventContext; - if (!this.haltedFormValidation) { - HaltManager.haltValidation(); - this.haltedFormValidation = true; - } - return null; // Waiting for result - } else if(this.hasRun) { - //this.$input.one('keyup change paste', this.reset.bind(this)); - return this.result; - } else { - lastFormEvent = eventContext; - HaltManager.haltValidation(this.$form); - this.haltedFormValidation = true; - this.isRunning = true; - this.$input - .attr('disabled', 'disabled') - .addClass('async-validation'); - this.$form.addClass('async-validation'); - - callback(function(result) { - this.done(result); - }.bind(this)); - - return null; - } - }; - - AsyncValidation.prototype.done = function(result) { - this.result = result; - this.hasRun = true; - this.isRunning = false; - this.$input - .removeAttr('disabled') - .removeClass('async-validation'); - this.$form.removeClass('async-validation'); - if (this.haltedFormValidation) { - HaltManager.unHaltValidation(this.$form); - if (lastFormEvent === 'submit') { - this.$form.trigger('submit'); - } else { - this.$input.trigger('validation.revalidate'); - } - } - }; - - AsyncValidation.loadInstance = function(validatorName, $input, $form) { - // Return async validator attached to this input element - // or create a new async validator and attach it to the input - var asyncValidation, - input = $input.get(0); - - if (!input.asyncValidators) { - input.asyncValidators = {}; - } - - if (input.asyncValidators[validatorName]) { - asyncValidation = input.asyncValidators[validatorName]; - } else { - asyncValidation = new AsyncValidation($form, $input); - input.asyncValidators[validatorName] = asyncValidation; - } - - return asyncValidation; - }; - - $.formUtils = $.extend($.formUtils || {}, { - - /** - * @deprecated - * @param validatorName - * @param $input - * @param $form - */ - asyncValidation: function(validatorName, $input, $form) { - // @todo: Remove when moving up to version 3.0 - this.warn('Use of deprecated function $.formUtils.asyncValidation, use $.formUtils.addAsyncValidator() instead'); - return AsyncValidation.loadInstance(validatorName, $input, $form); - }, - - /** - * @param {Object} asyncValidator - */ - addAsyncValidator: function (asyncValidator) { - var validator = $.extend({}, asyncValidator), - originalValidatorFunc = validator.validatorFunction; - validator.async = true; - validator.validatorFunction = function (value, $el, config, language, $form, eventContext) { - var asyncValidation = AsyncValidation.loadInstance(this.name, $el, $form); - return asyncValidation.run(eventContext, function(done) { - originalValidatorFunc.apply(validator, [ - done, value, $el, config, language, $form, eventContext - ]); - }); - }; - this.addValidator(validator); - } - }); - - // Tag elements having async validators - $(window).bind('validatorsLoaded formValidationSetup', function (evt, $form) { - if (!$form) { - $form = $('form'); - } - $form.find('[data-validation]').each(function () { - var $input = $(this); - $input.valAttr('async', false); - $.each($.split($input.attr('data-validation')), function (i, validatorName) { - var validator = $.formUtils.validators['validate_'+validatorName]; - if (validator && validator.async) { - $input.valAttr('async', 'yes'); - } - }); - }); - }); - -})(jQuery, window); - -/** - * Deprecated functions and attributes - * @todo: Remove in release of 3.0 - */ -(function ($, undefined) { - - 'use strict'; - - /** - * @deprecated - * @param language - * @param conf - */ - $.fn.validateForm = function (language, conf) { - $.formUtils.warn('Use of deprecated function $.validateForm, use $.isValid instead'); - return this.isValid(language, conf, true); - }; - - $(window) - .on('formValidationPluginInit', function(evt, config) { - convertDeprecatedLangCodeToISO6391(config); - addSupportForCustomErrorMessageCallback(config); - addSupportForElementReferenceInPositionParam(config); - }) - .on('validatorsLoaded formValidationSetup', function(evt, $form) { - if( !$form ) { - $form = $('form'); - } - addSupportForValidationDependingOnCheckedInput($form); - }); - - - function addSupportForCustomErrorMessageCallback(config) { - if (config && - config.errorMessagePosition === 'custom' && - typeof config.errorMessageCustom === 'function') { - - $.formUtils.warn('Use of deprecated function errorMessageCustom, use config.submitErrorMessageCallback instead'); - - config.submitErrorMessageCallback = function($form, errorMessages) { - config.errorMessageCustom( - $form, - config.language.errorTitle, - errorMessages, - config - ); - }; - } - } - - function addSupportForElementReferenceInPositionParam(config) { - if (config.errorMessagePosition && typeof config.errorMessagePosition === 'object') { - $.formUtils.warn('Deprecated use of config parameter errorMessagePosition, use config.submitErrorMessageCallback instead'); - var $errorMessageContainer = config.errorMessagePosition; - config.errorMessagePosition = 'top'; - config.submitErrorMessageCallback = function() { - return $errorMessageContainer; - }; - } - } - - function addSupportForValidationDependingOnCheckedInput($form) { - var $inputsDependingOnCheckedInputs = $form.find('[data-validation-if-checked]'); - if ($inputsDependingOnCheckedInputs.length) { - $.formUtils.warn( - 'Detected use of attribute "data-validation-if-checked" which is '+ - 'deprecated. Use "data-validation-depends-on" provided by module "logic"' - ); - } - - $inputsDependingOnCheckedInputs - .on('beforeValidation', function() { - - var $elem = $(this), - nameOfDependingInput = $elem.valAttr('if-checked'); - - // Set the boolean telling us that the validation depends - // on another input being checked - var $dependingInput = $('input[name="' + nameOfDependingInput + '"]', $form), - dependingInputIsChecked = $dependingInput.is(':checked'), - valueOfDependingInput = ($.formUtils.getValue($dependingInput) || '').toString(), - requiredValueOfDependingInput = $elem.valAttr('if-checked-value'); - - if (!dependingInputIsChecked || !( - !requiredValueOfDependingInput || - requiredValueOfDependingInput === valueOfDependingInput - )) { - $elem.valAttr('skipped', true); - } - - }); - } - - function convertDeprecatedLangCodeToISO6391(config) { - var deprecatedLangCodes = { - se: 'sv', - cz: 'cs', - dk: 'da' - }; - - if (config.lang in deprecatedLangCodes) { - var newLangCode = deprecatedLangCodes[config.lang]; - $.formUtils.warn( - 'Deprecated use of lang code "'+config.lang+'" use "'+newLangCode+'" instead' - ); - config.lang = newLangCode; - } - } - -})(jQuery); - -/** - * Utility methods used for displaying error messages (attached to $.formUtils) - */ -(function ($) { - - 'use strict'; - - var dialogs = { - - resolveErrorMessage: function($elem, validator, validatorName, conf, language) { - var errorMsgAttr = conf.validationErrorMsgAttribute + '-' + validatorName.replace('validate_', ''), - validationErrorMsg = $elem.attr(errorMsgAttr); - - if (!validationErrorMsg) { - validationErrorMsg = $elem.attr(conf.validationErrorMsgAttribute); - if (!validationErrorMsg) { - if (typeof validator.errorMessageKey !== 'function') { - validationErrorMsg = language[validator.errorMessageKey]; - } - else { - validationErrorMsg = language[validator.errorMessageKey(conf)]; - } - if (!validationErrorMsg) { - validationErrorMsg = validator.errorMessage; - } - } - } - return validationErrorMsg; - }, - getParentContainer: function ($elem) { - if ($elem.valAttr('error-msg-container')) { - return $($elem.valAttr('error-msg-container')); - } else { - var $parent = $elem.parent(); - if($elem.attr('type') === 'checkbox' && $elem.closest('.checkbox').length) { - $parent = $elem.closest('.checkbox').parent(); - } else if($elem.attr('type') === 'radio' && $elem.closest('.radio').length) { - $parent = $elem.closest('.radio').parent(); - } - if($parent.closest('.input-group').length) { - $parent = $parent.closest('.input-group').parent(); - } - return $parent; - } - }, - applyInputErrorStyling: function ($input, conf) { - $input - .addClass(conf.errorElementClass) - .removeClass(conf.successElementClass); - - this.getParentContainer($input) - .addClass(conf.inputParentClassOnError) - .removeClass(conf.inputParentClassOnSuccess); - - if (conf.borderColorOnError !== '') { - $input.css('border-color', conf.borderColorOnError); - } - }, - applyInputSuccessStyling: function($input, conf) { - $input.addClass(conf.successElementClass); - this.getParentContainer($input) - .addClass(conf.inputParentClassOnSuccess); - }, - removeInputStylingAndMessage: function($input, conf) { - - // Reset input css - $input - .removeClass(conf.successElementClass) - .removeClass(conf.errorElementClass) - .css('border-color', ''); - - var $parentContainer = dialogs.getParentContainer($input); - - // Reset parent css - $parentContainer - .removeClass(conf.inputParentClassOnError) - .removeClass(conf.inputParentClassOnSuccess); - - // Remove possible error message - if (typeof conf.inlineErrorMessageCallback === 'function') { - var $errorMessage = conf.inlineErrorMessageCallback($input, false, conf); - if ($errorMessage) { - $errorMessage.html(''); - } - } else { - $parentContainer - .find('.' + conf.errorMessageClass) - .remove(); - } - - }, - removeAllMessagesAndStyling: function($form, conf) { - - // Remove error messages in top of form - if (typeof conf.submitErrorMessageCallback === 'function') { - var $errorMessagesInTopOfForm = conf.submitErrorMessageCallback($form, false, conf); - if ($errorMessagesInTopOfForm) { - $errorMessagesInTopOfForm.html(''); - } - } else { - $form.find('.' + conf.errorMessageClass + '.alert').remove(); - } - - // Remove input css/messages - $form.find('.' + conf.errorElementClass + ',.' + conf.successElementClass).each(function() { - dialogs.removeInputStylingAndMessage($(this), conf); - }); - }, - setInlineMessage: function ($input, errorMsg, conf) { - - this.applyInputErrorStyling($input, conf); - - var custom = document.getElementById($input.attr('name') + '_err_msg'), - $messageContainer = false, - setErrorMessage = function ($elem) { - $.formUtils.$win.trigger('validationErrorDisplay', [$input, $elem]); - $elem.html(errorMsg); - }, - addErrorToMessageContainer = function() { - var $found = false; - $messageContainer.find('.' + conf.errorMessageClass).each(function () { - if (this.inputReferer === $input[0]) { - $found = $(this); - return false; - } - }); - if ($found) { - if (!errorMsg) { - $found.remove(); - } else { - setErrorMessage($found); - } - } else if(errorMsg !== '') { - $message = $('
    '); - setErrorMessage($message); - $message[0].inputReferer = $input[0]; - $messageContainer.prepend($message); - } - }, - $message; - - if (custom) { - // Todo: remove in 3.0 - $.formUtils.warn('Using deprecated element reference ' + custom.id); - $messageContainer = $(custom); - addErrorToMessageContainer(); - } else if (typeof conf.inlineErrorMessageCallback === 'function') { - $messageContainer = conf.inlineErrorMessageCallback($input, errorMsg, conf); - if (!$messageContainer) { - // Error display taken care of by inlineErrorMessageCallback - return; - } - addErrorToMessageContainer(); - } else { - var $parent = this.getParentContainer($input); - $message = $parent.find('.' + conf.errorMessageClass + '.help-block'); - if ($message.length === 0) { - $message = $('').addClass('help-block').addClass(conf.errorMessageClass); - $message.appendTo($parent); - } - setErrorMessage($message); - } - }, - setMessageInTopOfForm: function ($form, errorMessages, conf, lang) { - var view = '
    '+ - '{errorTitle}'+ - '
      {fields}
    '+ - '
    ', - $container = false; - - if (typeof conf.submitErrorMessageCallback === 'function') { - $container = conf.submitErrorMessageCallback($form, errorMessages, conf); - if (!$container) { - // message display taken care of by callback - return; - } - } - - var viewParams = { - errorTitle: lang.errorTitle, - fields: '', - errorMessageClass: conf.errorMessageClass - }; - - $.each(errorMessages, function (i, msg) { - viewParams.fields += '
  • '+msg+'
  • '; - }); - - $.each(viewParams, function(param, value) { - view = view.replace('{'+param+'}', value); - }); - - if ($container) { - $container.html(view); - } else { - $form.children().eq(0).before($(view)); - } - } - }; - - $.formUtils = $.extend($.formUtils || {}, { - dialogs: dialogs - }); - -})(jQuery); - -/** - * File declaring all methods if this plugin which is applied to $.fn. - */ -(function($, window, undefined) { - - 'use strict'; - - var _helpers = 0; - - - /** - * Assigns validateInputOnBlur function to elements blur event - * - * @param {Object} language Optional, will override $.formUtils.LANG - * @param {Object} conf Optional, will override the default settings - * @return {jQuery} - */ - $.fn.validateOnBlur = function (language, conf) { - var $form = this, - $elems = this.find('*[data-validation]'); - - $elems.each(function(){ - var $this = $(this); - if ($this.is('[type=radio]')){ - var $additionals = $form.find('[type=radio][name="' + $this.attr('name') + '"]'); - $additionals.bind('blur.validation', function(){ - $this.validateInputOnBlur(language, conf, true, 'blur'); - }); - if (conf.validateCheckboxRadioOnClick) { - $additionals.bind('click.validation', function () { - $this.validateInputOnBlur(language, conf, true, 'click'); - }); - } - } - }); - - $elems.bind('blur.validation', function () { - $(this).validateInputOnBlur(language, conf, true, 'blur'); - }); - - if (conf.validateCheckboxRadioOnClick) { - // bind click event to validate on click for radio & checkboxes for nice UX - this.find('input[type=checkbox][data-validation],input[type=radio][data-validation]') - .bind('click.validation', function () { - $(this).validateInputOnBlur(language, conf, true, 'click'); - }); - } - - return this; - }; - - /* - * Assigns validateInputOnBlur function to elements custom event - * @param {Object} language Optional, will override $.formUtils.LANG - * @param {Object} settings Optional, will override the default settings - * * @return {jQuery} - */ - $.fn.validateOnEvent = function (language, config) { - if(this.length === 0) { - return; - } - - var $elements = this[0].nodeName === 'FORM' ? this.find('*[data-validation-event]') : this; - $elements - .each(function () { - var $el = $(this), - etype = $el.valAttr('event'); - if (etype) { - $el - .unbind(etype + '.validation') - .bind(etype + '.validation', function (evt) { - if( (evt || {}).keyCode !== 9 ) { - $(this).validateInputOnBlur(language, config, true, etype); - } - }); - } - }); - return this; - }; - - /** - * fade in help message when input gains focus - * fade out when input loses focus - * - * - * @param {String} attrName - Optional, default is data-help - * @return {jQuery} - */ - $.fn.showHelpOnFocus = function (attrName) { - if (!attrName) { - attrName = 'data-validation-help'; - } - - // Add help text listeners - this.find('textarea,input').each(function () { - var $elem = $(this), - className = 'jquery_form_help_' + (++_helpers), - help = $elem.attr(attrName); - - // Reset - $elem - .removeClass('has-help-text') - .unbind('focus.help') - .unbind('blur.help'); - - if (help) { - $elem - .addClass('has-help-txt') - .bind('focus.help', function () { - var $help = $elem.parent().find('.' + className); - if ($help.length === 0) { - $help = $('') - .addClass(className) - .addClass('help') - .addClass('help-block') // twitter bs - .text(help) - .hide(); - - $elem.after($help); - } - $help.fadeIn(); - }) - .bind('blur.help', function () { - $(this) - .parent() - .find('.' + className) - .fadeOut('slow'); - }); - } - }); - - return this; - }; - - /** - * @param {Function} cb - * @param {Object} [conf] - * @param {Object} [lang] - */ - $.fn.validate = function(cb, conf, lang) { - var language = $.extend({}, $.formUtils.LANG, lang || {}); - this.each(function() { - var $elem = $(this), - closestFormElem = $elem.closest('form').get(0) || {}, - formDefaultConfig = closestFormElem.validationConfig || $.formUtils.defaultConfig(); - - $elem.one('validation', function(evt, isValid) { - if ( typeof cb === 'function' ) { - cb(isValid, this, evt); - } - }); - - $elem.validateInputOnBlur( - language, - $.extend({}, formDefaultConfig, conf || {}), - true - ); - }); - }; - - /** - * Tells whether or not validation of this input will have to postpone the form submit () - * @returns {Boolean} - */ - $.fn.willPostponeValidation = function() { - return (this.valAttr('suggestion-nr') || - this.valAttr('postpone') || - this.hasClass('hasDatepicker')) && - !window.postponedValidation; - }; - - /** - * Validate single input when it loses focus - * shows error message in a span element - * that is appended to the parent element - * - * @param {Object} [language] Optional, will override $.formUtils.LANG - * @param {Object} [conf] Optional, will override the default settings - * @param {Boolean} attachKeyupEvent Optional - * @param {String} eventContext - * @return {jQuery} - */ - $.fn.validateInputOnBlur = function (language, conf, attachKeyupEvent, eventContext) { - - $.formUtils.eventType = eventContext; - - if ( this.willPostponeValidation() ) { - // This validation has to be postponed - var _self = this, - postponeTime = this.valAttr('postpone') || 200; - - window.postponedValidation = function () { - _self.validateInputOnBlur(language, conf, attachKeyupEvent, eventContext); - window.postponedValidation = false; - }; - - setTimeout(function () { - if (window.postponedValidation) { - window.postponedValidation(); - } - }, postponeTime); - - return this; - } - - language = $.extend({}, $.formUtils.LANG, language || {}); - $.formUtils.dialogs.removeInputStylingAndMessage(this, conf); - - var $elem = this, - $form = $elem.closest('form'), - result = $.formUtils.validateInput( - $elem, - language, - conf, - $form, - eventContext - ); - - var reValidate = function() { - $elem.validateInputOnBlur(language, conf, false, 'blur.revalidated'); - }; - - if (eventContext === 'blur') { - $elem - .unbind('validation.revalidate', reValidate) - .one('validation.revalidate', reValidate); - } - - if (attachKeyupEvent) { - $elem.removeKeyUpValidation(); - } - - if (result.shouldChangeDisplay) { - if (result.isValid) { - $.formUtils.dialogs.applyInputSuccessStyling($elem, conf); - } else { - $.formUtils.dialogs.setInlineMessage($elem, result.errorMsg, conf); - } - } - - if (!result.isValid && attachKeyupEvent) { - $elem.validateOnKeyUp(language, conf); - } - - return this; - }; - - /** - * Validate element on keyup-event - */ - $.fn.validateOnKeyUp = function(language, conf) { - this.each(function() { - var $input = $(this); - if (!$input.valAttr('has-keyup-event')) { - $input - .valAttr('has-keyup-event', 'true') - .bind('keyup.validation', function (evt) { - if( evt.keyCode !== 9 ) { - $input.validateInputOnBlur(language, conf, false, 'keyup'); - } - }); - } - }); - return this; - }; - - /** - * Remove validation on keyup - */ - $.fn.removeKeyUpValidation = function() { - this.each(function() { - $(this) - .valAttr('has-keyup-event', false) - .unbind('keyup.validation'); - }); - return this; - }; - - /** - * Short hand for fetching/adding/removing element attributes - * prefixed with 'data-validation-' - * - * @param {String} name - * @param {String|Boolean} [val] - * @return {String|undefined|jQuery} - * @protected - */ - $.fn.valAttr = function (name, val) { - if (val === undefined) { - return this.attr('data-validation-' + name); - } else if (val === false || val === null) { - return this.removeAttr('data-validation-' + name); - } else { - name = ((name.length > 0) ? '-' + name : ''); - return this.attr('data-validation' + name, val); - } - }; - - /** - * Function that validates all inputs in active form - * - * @param {Object} [language] - * @param {Object} [conf] - * @param {Boolean} [displayError] Defaults to true - */ - $.fn.isValid = function (language, conf, displayError) { - - if ($.formUtils.isLoadingModules) { - var $self = this; - setTimeout(function () { - $self.isValid(language, conf, displayError); - }, 200); - return null; - } - - conf = $.extend({}, $.formUtils.defaultConfig(), conf || {}); - language = $.extend({}, $.formUtils.LANG, language || {}); - displayError = displayError !== false; - - if ($.formUtils.errorDisplayPreventedWhenHalted) { - // isValid() was called programmatically with argument displayError set - // to false when the validation was halted by any of the validators - delete $.formUtils.errorDisplayPreventedWhenHalted; - displayError = false; - } - - /** - * Adds message to error message stack if not already in the message stack - * - * @param {String} mess - * @para {jQuery} $elem - */ - var addErrorMessage = function (mess, $elem) { - if ($.inArray(mess, errorMessages) < 0) { - errorMessages.push(mess); - } - errorInputs.push($elem); - $elem.valAttr('current-error', mess); - if (displayError) { - $.formUtils.dialogs.applyInputErrorStyling($elem, conf); - } - }, - - /** Holds inputs (of type checkox or radio) already validated, to prevent recheck of mulitple checkboxes & radios */ - checkedInputs = [], - - /** Error messages for this validation */ - errorMessages = [], - - /** Input elements which value was not valid */ - errorInputs = [], - - /** Form instance */ - $form = this, - - /** - * Tells whether or not to validate element with this name and of this type - * - * @param {String} name - * @param {String} type - * @return {Boolean} - */ - ignoreInput = function (name, type) { - if (type === 'submit' || type === 'button' || type === 'reset') { - return true; - } - return $.inArray(name, conf.ignore || []) > -1; - }; - - // Reset style and remove error class - if (displayError) { - $.formUtils.dialogs.removeAllMessagesAndStyling($form, conf); - } - - // Validate element values - $form.find('input,textarea,select').filter(':not([type="submit"],[type="button"])').each(function () { - var $elem = $(this), - elementType = $elem.attr('type'), - isCheckboxOrRadioBtn = elementType === 'radio' || elementType === 'checkbox', - elementName = $elem.attr('name'); - - if (!ignoreInput(elementName, elementType) && (!isCheckboxOrRadioBtn || $.inArray(elementName, checkedInputs) < 0)) { - - if (isCheckboxOrRadioBtn) { - checkedInputs.push(elementName); - } - - var result = $.formUtils.validateInput( - $elem, - language, - conf, - $form, - 'submit' - ); - - if (!result.isValid) { - addErrorMessage(result.errorMsg, $elem); - } else if (result.isValid && result.shouldChangeDisplay) { - $elem.valAttr('current-error', false); - $.formUtils.dialogs.applyInputSuccessStyling($elem, conf); - } - } - - }); - - // Run validation callback - if (typeof conf.onValidate === 'function') { - var errors = conf.onValidate($form); - if ($.isArray(errors)) { - $.each(errors, function (i, err) { - addErrorMessage(err.message, err.element); - }); - } - else if (errors && errors.element && errors.message) { - addErrorMessage(errors.message, errors.element); - } - } - - // Reset form validation flag - $.formUtils.isValidatingEntireForm = false; - - // Validation failed - if (errorInputs.length > 0) { - if (displayError) { - if (conf.errorMessagePosition === 'top') { - $.formUtils.dialogs.setMessageInTopOfForm($form, errorMessages, conf, language); - } else { - $.each(errorInputs, function (i, $input) { - $.formUtils.dialogs.setInlineMessage($input, $input.valAttr('current-error'), conf); - }); - } - if (conf.scrollToTopOnError) { - $.formUtils.$win.scrollTop($form.offset().top - 20); - } - } - } - - if (!displayError && $.formUtils.haltValidation) { - $.formUtils.errorDisplayPreventedWhenHalted = true; - } - - return errorInputs.length === 0 && !$.formUtils.haltValidation; - }; - - /** - * Plugin for displaying input length restriction - */ - $.fn.restrictLength = function (maxLengthElement) { - new $.formUtils.lengthRestriction(this, maxLengthElement); - return this; - }; - - /** - * Add suggestion dropdown to inputs having data-suggestions with a comma - * separated string with suggestions - * @param {Array} [settings] - * @returns {jQuery} - */ - $.fn.addSuggestions = function (settings) { - var sugs = false; - this.find('input').each(function () { - var $field = $(this); - - sugs = $.split($field.attr('data-suggestions')); - - if (sugs.length > 0 && !$field.hasClass('has-suggestions')) { - $.formUtils.suggest($field, sugs, settings); - $field.addClass('has-suggestions'); - } - }); - return this; - }; - - -})(jQuery, window); - -/** - * Utility methods used for handling loading of modules (attached to $.formUtils) - */ -(function($) { - - 'use strict'; - - $.formUtils = $.extend($.formUtils || {}, { - - /** - * @var {Boolean} - */ - isLoadingModules: false, - - /** - * @var {Object} - */ - loadedModules: {}, - - /** - * @param {String} name - */ - registerLoadedModule: function (name) { - this.loadedModules[$.trim(name).toLowerCase()] = true; - }, - - /** - * @param {String} name - * @return {Boolean} - */ - hasLoadedModule: function (name) { - return $.trim(name).toLowerCase() in this.loadedModules; - }, - - /** - * @example - * $.formUtils.loadModules('date, security.dev'); - * - * Will load the scripts date.js and security.dev.js from the - * directory where this script resides. If you want to load - * the modules from another directory you can use the - * path argument. - * - * The script will be cached by the browser unless the module - * name ends with .dev - * - * @param {String} modules - Comma separated string with module file names (no directory nor file extension) - * @param {String} [path] - Path where the module files are located if their not in the same directory as the core modules - * @param {function} [callback] - Callback invoked when all modules are loaded - */ - loadModules: function (modules, path, callback) { - - if ($.formUtils.isLoadingModules) { - setTimeout(function () { - $.formUtils.loadModules(modules, path, callback); - }, 100); - return; - } - - var loadModuleScripts = function (modules, path) { - - var moduleList = $.split(modules), - numModules = moduleList.length, - moduleLoadedCallback = function () { - numModules--; - if (numModules === 0) { - $.formUtils.isLoadingModules = false; - if (typeof callback === 'function') { - callback(); - } - } - }; - - if (numModules > 0) { - $.formUtils.isLoadingModules = true; - } - - var cacheSuffix = '?_=' + ( new Date().getTime() ), - appendToElement = document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]; - - $.each(moduleList, function (i, modName) { - modName = $.trim(modName); - if (modName.length === 0 || $.formUtils.hasLoadedModule(modName)) { - moduleLoadedCallback(); - } else { - var scriptUrl = path + modName + (modName.slice(-3) === '.js' ? '' : '.js'), - script = document.createElement('SCRIPT'); - - if (typeof define === 'function' && define.amd) { - require([scriptUrl + ( scriptUrl.slice(-7) === '.dev.js' ? cacheSuffix : '' )], moduleLoadedCallback); - } else { - // Load the script - script.type = 'text/javascript'; - script.onload = moduleLoadedCallback; - script.src = scriptUrl + ( scriptUrl.slice(-7) === '.dev.js' ? cacheSuffix : '' ); - script.onerror = function() { - $.formUtils.warn('Unable to load form validation module '+scriptUrl, true); - moduleLoadedCallback(); - }; - script.onreadystatechange = function () { - // IE 7 fix - if (this.readyState === 'complete' || this.readyState === 'loaded') { - moduleLoadedCallback(); - // Handle memory leak in IE - this.onload = null; - this.onreadystatechange = null; - } - }; - appendToElement.appendChild(script); - } - } - }); - }; - - if (path) { - loadModuleScripts(modules, path); - } else { - var findScriptPathAndLoadModules = function () { - var foundPath = false; - $('script[src*="form-validator"]').each(function () { - var isScriptFromPluginNodeModulesDirectory = this.src.split('form-validator')[1].split('node_modules').length > 1; - if (!isScriptFromPluginNodeModulesDirectory) { - foundPath = this.src.substr(0, this.src.lastIndexOf('/')) + '/'; - if (foundPath === '/') { - foundPath = ''; - } - return false; - } - }); - - if (foundPath !== false) { - loadModuleScripts(modules, foundPath); - return true; - } - return false; - }; - - if (!findScriptPathAndLoadModules()) { - $(function () { - var hasLoadedModuleScripts = findScriptPathAndLoadModules(); - if (!hasLoadedModuleScripts) { - // The modules may have been inserted via a minified script - if (typeof callback === 'function') { - callback(); - } - } - }); - } - } - } - - }); - -})(jQuery); - -/** - * Setup function for the plugin - */ -(function ($) { - - 'use strict'; - - - /** - * A bit smarter split function - * delimiter can be space, comma, dash or pipe - * @param {String} val - * @param {Function|String} [callback] - * @param {Boolean} [allowSpaceAsDelimiter] - * @returns {Array|void} - */ - $.split = function (val, callback, allowSpaceAsDelimiter) { - // default to true - allowSpaceAsDelimiter = allowSpaceAsDelimiter === undefined || allowSpaceAsDelimiter === true; - var pattern = '[,|'+(allowSpaceAsDelimiter ? '\\s':'')+'-]\\s*', - regex = new RegExp(pattern, 'g'); - if (typeof callback !== 'function') { - // return array - if (!val) { - return []; - } - var values = []; - $.each(val.split(callback ? callback : regex), - function (i, str) { - str = $.trim(str); - if (str.length) { - values.push(str); - } - } - ); - return values; - } else if (val) { - // exec callback func on each - $.each(val.split(regex), - function (i, str) { - str = $.trim(str); - if (str.length) { - return callback(str, i); - } - } - ); - } - }; - - /** - * Short hand function that makes the validation setup require less code - * @param conf - */ - $.validate = function (conf) { - - var defaultConf = $.extend($.formUtils.defaultConfig(), { - form: 'form', - validateOnEvent: false, - validateOnBlur: true, - validateCheckboxRadioOnClick: true, - showHelpOnFocus: true, - addSuggestions: true, - modules: '', - onModulesLoaded: null, - language: false, - onSuccess: false, - onError: false, - onElementValidate: false - }); - - conf = $.extend(defaultConf, conf || {}); - - $(window).trigger('formValidationPluginInit', [conf]); - - if( conf.lang && conf.lang !== 'en' ) { - var langModule = 'lang/'+conf.lang+'.js'; - conf.modules += conf.modules.length ? ','+langModule : langModule; - } - - // Add validation to forms - $(conf.form).each(function (i, form) { - - // Make a reference to the config for this form - form.validationConfig = conf; - - // Trigger jQuery event that we're about to setup validation - var $form = $(form); - $form.trigger('formValidationSetup', [$form, conf]); - - // Remove classes and event handlers that might have been - // added by a previous call to $.validate - $form.find('.has-help-txt') - .unbind('focus.validation') - .unbind('blur.validation'); - - $form - .removeClass('has-validation-callback') - .unbind('submit.validation') - .unbind('reset.validation') - .find('input[data-validation],textarea[data-validation]') - .unbind('blur.validation'); - - // Validate when submitted - $form.bind('submit.validation', function (evt) { - - var $form = $(this), - stop = function() { - evt.stopImmediatePropagation(); - return false; - }; - - if ($.formUtils.haltValidation) { - // pressing several times on submit button while validation is halted - return stop(); - } - - if ($.formUtils.isLoadingModules) { - setTimeout(function () { - $form.trigger('submit.validation'); - }, 200); - return stop(); - } - - var valid = $form.isValid(conf.language, conf); - if ($.formUtils.haltValidation) { - // Validation got halted by one of the validators - return stop(); - } else { - if (valid && typeof conf.onSuccess === 'function') { - var callbackResponse = conf.onSuccess($form); - if (callbackResponse === false) { - return stop(); - } - } else if (!valid && typeof conf.onError === 'function') { - conf.onError($form); - return stop(); - } else { - return valid ? true : stop(); - } - } - }) - .bind('reset.validation', function () { - $.formUtils.dialogs.removeAllMessagesAndStyling($form, conf); - }) - .addClass('has-validation-callback'); - - if (conf.showHelpOnFocus) { - $form.showHelpOnFocus(); - } - if (conf.addSuggestions) { - $form.addSuggestions(); - } - if (conf.validateOnBlur) { - $form.validateOnBlur(conf.language, conf); - $form.bind('html5ValidationAttrsFound', function () { - $form.validateOnBlur(conf.language, conf); - }); - } - if (conf.validateOnEvent) { - $form.validateOnEvent(conf.language, conf); - } - }); - - if (conf.modules !== '') { - $.formUtils.loadModules(conf.modules, null, function() { - if (typeof conf.onModulesLoaded === 'function') { - conf.onModulesLoaded(); - } - var $form = typeof conf.form === 'string' ? $(conf.form) : conf.form; - $.formUtils.$win.trigger('validatorsLoaded', [$form, conf]); - }); - } - }; - -})(jQuery); - -/** - * Utility methods and properties attached to $.formUtils - */ -(function($, window) { - - 'use strict'; - - var $win = $(window); - - $.formUtils = $.extend($.formUtils || {}, { - - $win: $win, - - /** - * Default config for $(...).isValid(); - */ - defaultConfig: function () { - return { - ignore: [], // Names of inputs not to be validated even though `validationRuleAttribute` containing the validation rules tells us to - errorElementClass: 'error', // Class that will be put on elements which value is invalid - successElementClass: 'valid', // Class that will be put on elements that has been validated with success - borderColorOnError: '#b94a48', // Border color of elements which value is invalid, empty string to not change border color - errorMessageClass: 'form-error', // class name of div containing error messages when validation fails - validationRuleAttribute: 'data-validation', // name of the attribute holding the validation rules - validationErrorMsgAttribute: 'data-validation-error-msg', // define custom err msg inline with element - errorMessagePosition: 'inline', // Can be either "top" or "inline" - errorMessageTemplate: { - container: '
    {messages}
    ', - messages: '{errorTitle}
      {fields}
    ', - field: '
  • {msg}
  • ' - }, - scrollToTopOnError: true, - dateFormat: 'yyyy-mm-dd', - addValidClassOnAll: false, // whether or not to apply class="valid" even if the input wasn't validated - decimalSeparator: '.', - inputParentClassOnError: 'has-error', // twitter-bootstrap default class name - inputParentClassOnSuccess: 'has-success', // twitter-bootstrap default class name - validateHiddenInputs: false, // whether or not hidden inputs should be validated - inlineErrorMessageCallback: false, - submitErrorMessageCallback: false - }; - }, - - /** - * Available validators - */ - validators: {}, - - /** - * Available sanitizers - */ - sanitizers: {}, - - /** - * Events triggered by form validator - */ - _events: {load: [], valid: [], invalid: []}, - - /** - * Setting this property to true during validation will - * stop further validation from taking place and form will - * not be sent - */ - haltValidation: false, - - /** - * Function for adding a validator - * @see $.formUtils.addAsyncValidator (async.js) - * @param {Object} validator - */ - addValidator: function (validator) { - // prefix with "validate_" for backward compatibility reasons - var name = validator.name.indexOf('validate_') === 0 ? validator.name : 'validate_' + validator.name; - if (validator.validateOnKeyUp === undefined) { - validator.validateOnKeyUp = true; - } - this.validators[name] = validator; - }, - - /** - * Function for adding a sanitizer - * @param {Object} sanitizer - */ - addSanitizer: function (sanitizer) { - this.sanitizers[sanitizer.name] = sanitizer; - }, - - /** - * Warn user via the console if available - */ - warn: function(msg, fallbackOnAlert) { - if( 'console' in window ) { - if( typeof window.console.warn === 'function' ) { - window.console.warn(msg); - } else if( typeof window.console.log === 'function' ) { - window.console.log(msg); - } - } else if (fallbackOnAlert) { - // This is for some old IE version... - alert(msg); - } - }, - - /** - * Same as input $.fn.val() but also supporting input of typ radio or checkbox - * @example - * - * $.formUtils.getValue('.myRadioButtons', $('#some-form')); - * $.formUtils.getValue($('#some-form').find('.check-boxes')); - * - * @param query - * @param $parent - * @returns {String|Boolean} - */ - getValue: function(query, $parent) { - var $inputs = $parent ? $parent.find(query) : query; - if ($inputs.length > 0 ) { - var type = $inputs.eq(0).attr('type'); - if (type === 'radio' || type === 'checkbox') { - return $inputs.filter(':checked').val() || ''; - } else { - return $inputs.val() || ''; - } - } - return false; - }, - - /** - * Validate the value of given element according to the validation rules - * found in the attribute data-validation. Will return an object representing - * a validation result, having the props shouldChangeDisplay, isValid and errorMsg - * @param {jQuery} $elem - * @param {Object} language ($.formUtils.LANG) - * @param {Object} conf - * @param {jQuery} $form - * @param {String} [eventContext] - * @return {Object} - */ - validateInput: function ($elem, language, conf, $form, eventContext) { - - conf = conf || $.formUtils.defaultConfig(); - language = language || $.formUtils.LANG; - - if (!$form.length) { - $form = $elem.parent(); - } - - var value = this.getValue($elem); - - $elem - .valAttr('skipped', false) - .one('beforeValidation', function() { - // Skip input because its hidden or disabled - // Doing this in a callback makes it possible for others to prevent the default - // behaviour by binding to the same event and call evt.stopImmediatePropagation() - if ($elem.attr('disabled') || (!$elem.is(':visible') && !conf.validateHiddenInputs)) { - $elem.valAttr('skipped', 1); - } - }) - .trigger('beforeValidation', [value, language, conf]); - - var inputIsOptional = $elem.valAttr('optional') === 'true', - skipBecauseItsEmpty = !value && inputIsOptional, - validationRules = $elem.attr(conf.validationRuleAttribute), - isValid = true, - errorMsg = '', - result = {isValid: true, shouldChangeDisplay:true, errorMsg:''}; - - // For input type="number", browsers attempt to parse the entered value into a number. - // If the input is not numeric, browsers handle the situation differently: - // Chrome 48 simply disallows non-numeric input; FF 44 clears out the input box on blur; - // Safari 5 parses the entered string to find a leading number. - // If the input fails browser validation, the browser sets the input value equal to an empty string. - // Therefore, we cannot distinguish (apart from hacks) between an empty input type="text" and one with a - // value that can't be parsed by the browser. - - if (!validationRules || skipBecauseItsEmpty || $elem.valAttr('skipped')) { - result.shouldChangeDisplay = conf.addValidClassOnAll; - return result; - } - - // Filter out specified characters - var ignore = $elem.valAttr('ignore'); - if (ignore) { - $.each(ignore.split(''), function(i, character) { - value = value.replace(new RegExp('\\'+character, 'g'), ''); - }); - } - - $.split(validationRules, function (rule) { - - if (rule.indexOf('validate_') !== 0) { - rule = 'validate_' + rule; - } - - var validator = $.formUtils.validators[rule]; - - if (validator) { - - // special change of element for checkbox_group rule - if (rule === 'validate_checkbox_group') { - // set element to first in group, so error msg attr doesn't need to be set on all elements in group - $elem = $form.find('[name="' + $elem.attr('name') + '"]:eq(0)'); - } - - if (eventContext !== 'keyup' || validator.validateOnKeyUp) { - // A validator can prevent itself from getting triggered on keyup - isValid = validator.validatorFunction(value, $elem, conf, language, $form, eventContext); - } - - if (!isValid) { - if (conf.validateOnBlur) { - $elem.validateOnKeyUp(language, conf); - } - errorMsg = $.formUtils.dialogs.resolveErrorMessage($elem, validator, rule, conf, language); - return false; // break iteration - } - - } else { - - // todo: Add some validator lookup function and tell immediately which module is missing - throw new Error('Using undefined validator "' + rule + - '". Maybe you have forgotten to load the module that "' + rule +'" belongs to?'); - - } - - }); - - - if (isValid === false) { - $elem.trigger('validation', false); - result.errorMsg = errorMsg; - result.isValid = false; - result.shouldChangeDisplay = true; - } else if (isValid === null) { - // A validatorFunction returning null means that it's not able to validate - // the input at this time. Most probably some async stuff need to gets finished - // first and then the validator will re-trigger the validation. - result.shouldChangeDisplay = false; - } else { - $elem.trigger('validation', true); - result.shouldChangeDisplay = true; - } - - // Run element validation callback - if (typeof conf.onElementValidate === 'function' && errorMsg !== null) { - conf.onElementValidate(result.isValid, $elem, $form, errorMsg); - } - - $elem.trigger('afterValidation', [result, eventContext]); - - return result; - }, - - /** - * Is it a correct date according to given dateFormat. Will return false if not, otherwise - * an array 0=>year 1=>month 2=>day - * - * @param {String} val - * @param {String} dateFormat - * @param {Boolean} [addMissingLeadingZeros] - * @return {Array}|{Boolean} - */ - parseDate: function (val, dateFormat, addMissingLeadingZeros) { - var divider = dateFormat.replace(/[a-zA-Z]/gi, '').substring(0, 1), - regexp = '^', - formatParts = dateFormat.split(divider || null), - matches, day, month, year; - - $.each(formatParts, function (i, part) { - regexp += (i > 0 ? '\\' + divider : '') + '(\\d{' + part.length + '})'; - }); - - regexp += '$'; - - if (addMissingLeadingZeros) { - var newValueParts = []; - $.each(val.split(divider), function(i, part) { - if(part.length === 1) { - part = '0'+part; - } - newValueParts.push(part); - }); - val = newValueParts.join(divider); - } - - matches = val.match(new RegExp(regexp)); - if (matches === null) { - return false; - } - - var findDateUnit = function (unit, formatParts, matches) { - for (var i = 0; i < formatParts.length; i++) { - if (formatParts[i].substring(0, 1) === unit) { - return $.formUtils.parseDateInt(matches[i + 1]); - } - } - return -1; - }; - - month = findDateUnit('m', formatParts, matches); - day = findDateUnit('d', formatParts, matches); - year = findDateUnit('y', formatParts, matches); - - if ((month === 2 && day > 28 && (year % 4 !== 0 || year % 100 === 0 && year % 400 !== 0)) || - (month === 2 && day > 29 && (year % 4 === 0 || year % 100 !== 0 && year % 400 === 0)) || - month > 12 || month === 0) { - return false; - } - if ((this.isShortMonth(month) && day > 30) || (!this.isShortMonth(month) && day > 31) || day === 0) { - return false; - } - - return [year, month, day]; - }, - - /** - * skum fix. är talet 05 eller lägre ger parseInt rätt int annars får man 0 när man kör parseInt? - * - * @param {String} val - * @return {Number} - */ - parseDateInt: function (val) { - if (val.indexOf('0') === 0) { - val = val.replace('0', ''); - } - return parseInt(val, 10); - }, - - /** - * Has month only 30 days? - * - * @param {Number} m - * @return {Boolean} - */ - isShortMonth: function (m) { - return (m % 2 === 0 && m < 7) || (m % 2 !== 0 && m > 7); - }, - - /** - * Restrict input length - * - * @param {jQuery} $inputElement Jquery Html object - * @param {jQuery} $maxLengthElement jQuery Html Object - * @return void - */ - lengthRestriction: function ($inputElement, $maxLengthElement) { - // read maxChars from counter display initial text value - var maxChars = parseInt($maxLengthElement.text(), 10), - charsLeft = 0, - - // internal function does the counting and sets display value - countCharacters = function () { - var numChars = $inputElement.val().length; - if (numChars > maxChars) { - // get current scroll bar position - var currScrollTopPos = $inputElement.scrollTop(); - // trim value to max length - $inputElement.val($inputElement.val().substring(0, maxChars)); - $inputElement.scrollTop(currScrollTopPos); - } - charsLeft = maxChars - numChars; - if (charsLeft < 0) { - charsLeft = 0; - } - - // set counter text - $maxLengthElement.text(charsLeft); - }; - - // bind events to this element - // setTimeout is needed, cut or paste fires before val is available - $($inputElement).bind('keydown keyup keypress focus blur', countCharacters) - .bind('cut paste', function () { - setTimeout(countCharacters, 100); - }); - - // count chars on pageload, if there are prefilled input-values - $(document).bind('ready', countCharacters); - }, - - /** - * Test numeric against allowed range - * - * @param $value int - * @param $rangeAllowed str; (1-2, min1, max2, 10) - * @return array - */ - numericRangeCheck: function (value, rangeAllowed) { - // split by dash - var range = $.split(rangeAllowed), - // min or max - minmax = parseInt(rangeAllowed.substr(3), 10); - - if( range.length === 1 && rangeAllowed.indexOf('min') === -1 && rangeAllowed.indexOf('max') === -1 ) { - range = [rangeAllowed, rangeAllowed]; // only a number, checking agains an exact number of characters - } - - // range ? - if (range.length === 2 && (value < parseInt(range[0], 10) || value > parseInt(range[1], 10) )) { - return [ 'out', range[0], range[1] ]; - } // value is out of range - else if (rangeAllowed.indexOf('min') === 0 && (value < minmax )) // min - { - return ['min', minmax]; - } // value is below min - else if (rangeAllowed.indexOf('max') === 0 && (value > minmax )) // max - { - return ['max', minmax]; - } // value is above max - // since no other returns executed, value is in allowed range - return [ 'ok' ]; - }, - - - _numSuggestionElements: 0, - _selectedSuggestion: null, - _previousTypedVal: null, - - /** - * Utility function that can be used to create plugins that gives - * suggestions when inputs is typed into - * @param {jQuery} $elem - * @param {Array} suggestions - * @param {Object} settings - Optional - * @return {jQuery} - */ - suggest: function ($elem, suggestions, settings) { - var conf = { - css: { - maxHeight: '150px', - background: '#FFF', - lineHeight: '150%', - textDecoration: 'underline', - overflowX: 'hidden', - overflowY: 'auto', - border: '#CCC solid 1px', - borderTop: 'none', - cursor: 'pointer' - }, - activeSuggestionCSS: { - background: '#E9E9E9' - } - }, - setSuggsetionPosition = function ($suggestionContainer, $input) { - var offset = $input.offset(); - $suggestionContainer.css({ - width: $input.outerWidth(), - left: offset.left + 'px', - top: (offset.top + $input.outerHeight()) + 'px' - }); - }; - - if (settings) { - $.extend(conf, settings); - } - - conf.css.position = 'absolute'; - conf.css['z-index'] = 9999; - $elem.attr('autocomplete', 'off'); - - if (this._numSuggestionElements === 0) { - // Re-position suggestion container if window size changes - $win.bind('resize', function () { - $('.jquery-form-suggestions').each(function () { - var $container = $(this), - suggestID = $container.attr('data-suggest-container'); - setSuggsetionPosition($container, $('.suggestions-' + suggestID).eq(0)); - }); - }); - } - - this._numSuggestionElements++; - - var onSelectSuggestion = function ($el) { - var suggestionId = $el.valAttr('suggestion-nr'); - $.formUtils._selectedSuggestion = null; - $.formUtils._previousTypedVal = null; - $('.jquery-form-suggestion-' + suggestionId).fadeOut('fast'); - }; - - $elem - .data('suggestions', suggestions) - .valAttr('suggestion-nr', this._numSuggestionElements) - .unbind('focus.suggest') - .bind('focus.suggest', function () { - $(this).trigger('keyup'); - $.formUtils._selectedSuggestion = null; - }) - .unbind('keyup.suggest') - .bind('keyup.suggest', function () { - var $input = $(this), - foundSuggestions = [], - val = $.trim($input.val()).toLocaleLowerCase(); - - if (val === $.formUtils._previousTypedVal) { - return; - } - else { - $.formUtils._previousTypedVal = val; - } - - var hasTypedSuggestion = false, - suggestionId = $input.valAttr('suggestion-nr'), - $suggestionContainer = $('.jquery-form-suggestion-' + suggestionId); - - $suggestionContainer.scrollTop(0); - - // Find the right suggestions - if (val !== '') { - var findPartial = val.length > 2; - $.each($input.data('suggestions'), function (i, suggestion) { - var lowerCaseVal = suggestion.toLocaleLowerCase(); - if (lowerCaseVal === val) { - foundSuggestions.push('' + suggestion + ''); - hasTypedSuggestion = true; - return false; - } else if (lowerCaseVal.indexOf(val) === 0 || (findPartial && lowerCaseVal.indexOf(val) > -1)) { - foundSuggestions.push(suggestion.replace(new RegExp(val, 'gi'), '$&')); - } - }); - } - - // Hide suggestion container - if (hasTypedSuggestion || (foundSuggestions.length === 0 && $suggestionContainer.length > 0)) { - $suggestionContainer.hide(); - } - - // Create suggestion container if not already exists - else if (foundSuggestions.length > 0 && $suggestionContainer.length === 0) { - $suggestionContainer = $('
    ').css(conf.css).appendTo('body'); - $elem.addClass('suggestions-' + suggestionId); - $suggestionContainer - .attr('data-suggest-container', suggestionId) - .addClass('jquery-form-suggestions') - .addClass('jquery-form-suggestion-' + suggestionId); - } - - // Show hidden container - else if (foundSuggestions.length > 0 && !$suggestionContainer.is(':visible')) { - $suggestionContainer.show(); - } - - // add suggestions - if (foundSuggestions.length > 0 && val.length !== foundSuggestions[0].length) { - - // put container in place every time, just in case - setSuggsetionPosition($suggestionContainer, $input); - - // Add suggestions HTML to container - $suggestionContainer.html(''); - $.each(foundSuggestions, function (i, text) { - $('
    ') - .append(text) - .css({ - overflow: 'hidden', - textOverflow: 'ellipsis', - whiteSpace: 'nowrap', - padding: '5px' - }) - .addClass('form-suggest-element') - .appendTo($suggestionContainer) - .click(function () { - $input.focus(); - $input.val($(this).text()); - $input.trigger('change'); - onSelectSuggestion($input); - }); - }); - } - }) - .unbind('keydown.validation') - .bind('keydown.validation', function (e) { - var code = (e.keyCode ? e.keyCode : e.which), - suggestionId, - $suggestionContainer, - $input = $(this); - - if (code === 13 && $.formUtils._selectedSuggestion !== null) { - suggestionId = $input.valAttr('suggestion-nr'); - $suggestionContainer = $('.jquery-form-suggestion-' + suggestionId); - if ($suggestionContainer.length > 0) { - var newText = $suggestionContainer.find('div').eq($.formUtils._selectedSuggestion).text(); - $input.val(newText); - $input.trigger('change'); - onSelectSuggestion($input); - e.preventDefault(); - } - } - else { - suggestionId = $input.valAttr('suggestion-nr'); - $suggestionContainer = $('.jquery-form-suggestion-' + suggestionId); - var $suggestions = $suggestionContainer.children(); - if ($suggestions.length > 0 && $.inArray(code, [38, 40]) > -1) { - if (code === 38) { // key up - if ($.formUtils._selectedSuggestion === null) { - $.formUtils._selectedSuggestion = $suggestions.length - 1; - } - else{ - $.formUtils._selectedSuggestion--; - } - if ($.formUtils._selectedSuggestion < 0) { - $.formUtils._selectedSuggestion = $suggestions.length - 1; - } - } - else if (code === 40) { // key down - if ($.formUtils._selectedSuggestion === null) { - $.formUtils._selectedSuggestion = 0; - } - else { - $.formUtils._selectedSuggestion++; - } - if ($.formUtils._selectedSuggestion > ($suggestions.length - 1)) { - $.formUtils._selectedSuggestion = 0; - } - } - - // Scroll in suggestion window - var containerInnerHeight = $suggestionContainer.innerHeight(), - containerScrollTop = $suggestionContainer.scrollTop(), - suggestionHeight = $suggestionContainer.children().eq(0).outerHeight(), - activeSuggestionPosY = suggestionHeight * ($.formUtils._selectedSuggestion); - - if (activeSuggestionPosY < containerScrollTop || activeSuggestionPosY > (containerScrollTop + containerInnerHeight)) { - $suggestionContainer.scrollTop(activeSuggestionPosY); - } - - $suggestions - .removeClass('active-suggestion') - .css('background', 'none') - .eq($.formUtils._selectedSuggestion) - .addClass('active-suggestion') - .css(conf.activeSuggestionCSS); - - e.preventDefault(); - return false; - } - } - }) - .unbind('blur.suggest') - .bind('blur.suggest', function () { - onSelectSuggestion($(this)); - }); - - return $elem; - }, - - /** - * Error dialogs - * - * @var {Object} - */ - LANG: { - errorTitle: 'Form submission failed!', - requiredField: 'This is a required field', - requiredFields: 'You have not answered all required fields', - badTime: 'You have not given a correct time', - badEmail: 'You have not given a correct e-mail address', - badTelephone: 'You have not given a correct phone number', - badSecurityAnswer: 'You have not given a correct answer to the security question', - badDate: 'You have not given a correct date', - lengthBadStart: 'The input value must be between ', - lengthBadEnd: ' characters', - lengthTooLongStart: 'The input value is longer than ', - lengthTooShortStart: 'The input value is shorter than ', - notConfirmed: 'Input values could not be confirmed', - badDomain: 'Incorrect domain value', - badUrl: 'The input value is not a correct URL', - badCustomVal: 'The input value is incorrect', - andSpaces: ' and spaces ', - badInt: 'The input value was not a correct number', - badSecurityNumber: 'Your social security number was incorrect', - badUKVatAnswer: 'Incorrect UK VAT Number', - badUKNin: 'Incorrect UK NIN', - badUKUtr: 'Incorrect UK UTR Number', - badStrength: 'The password isn\'t strong enough', - badNumberOfSelectedOptionsStart: 'You have to choose at least ', - badNumberOfSelectedOptionsEnd: ' answers', - badAlphaNumeric: 'The input value can only contain alphanumeric characters ', - badAlphaNumericExtra: ' and ', - wrongFileSize: 'The file you are trying to upload is too large (max %s)', - wrongFileType: 'Only files of type %s is allowed', - groupCheckedRangeStart: 'Please choose between ', - groupCheckedTooFewStart: 'Please choose at least ', - groupCheckedTooManyStart: 'Please choose a maximum of ', - groupCheckedEnd: ' item(s)', - badCreditCard: 'The credit card number is not correct', - badCVV: 'The CVV number was not correct', - wrongFileDim : 'Incorrect image dimensions,', - imageTooTall : 'the image can not be taller than', - imageTooWide : 'the image can not be wider than', - imageTooSmall : 'the image was too small', - min : 'min', - max : 'max', - imageRatioNotAccepted : 'Image ratio is not be accepted', - badBrazilTelephoneAnswer: 'The phone number entered is invalid', - badBrazilCEPAnswer: 'The CEP entered is invalid', - badBrazilCPFAnswer: 'The CPF entered is invalid', - badPlPesel: 'The PESEL entered is invalid', - badPlNip: 'The NIP entered is invalid', - badPlRegon: 'The REGON entered is invalid', - badreCaptcha: 'Please confirm that you are not a bot', - passwordComplexityStart: 'Password must contain at least ', - passwordComplexitySeparator: ', ', - passwordComplexityUppercaseInfo: ' uppercase letter(s)', - passwordComplexityLowercaseInfo: ' lowercase letter(s)', - passwordComplexitySpecialCharsInfo: ' special character(s)', - passwordComplexityNumericCharsInfo: ' numeric character(s)', - passwordComplexityEnd: '.' - } - }); - -})(jQuery, window); - -/** - * File declaring all default validators. - */ -(function($) { - - /* - * Validate email - */ - $.formUtils.addValidator({ - name: 'email', - validatorFunction: function (email) { - - var emailParts = email.toLowerCase().split('@'), - localPart = emailParts[0], - domain = emailParts[1]; - - if (localPart && domain) { - - if( localPart.indexOf('"') === 0 ) { - var len = localPart.length; - localPart = localPart.replace(/\"/g, ''); - if( localPart.length !== (len-2) ) { - return false; // It was not allowed to have more than two apostrophes - } - } - - return $.formUtils.validators.validate_domain.validatorFunction(emailParts[1]) && - localPart.indexOf('.') !== 0 && - localPart.substring(localPart.length-1, localPart.length) !== '.' && - localPart.indexOf('..') === -1 && - !(/[^\w\+\.\-\#\-\_\~\!\$\&\'\(\)\*\+\,\;\=\:]/.test(localPart)); - } - - return false; - }, - errorMessage: '', - errorMessageKey: 'badEmail' - }); - - /* - * Validate domain name - */ - $.formUtils.addValidator({ - name: 'domain', - validatorFunction: function (val) { - return val.length > 0 && - val.length <= 253 && // Including sub domains - !(/[^a-zA-Z0-9]/.test(val.slice(-2))) && !(/[^a-zA-Z0-9]/.test(val.substr(0, 1))) && !(/[^a-zA-Z0-9\.\-]/.test(val)) && - val.split('..').length === 1 && - val.split('.').length > 1; - }, - errorMessage: '', - errorMessageKey: 'badDomain' - }); - - /* - * Validate required - */ - $.formUtils.addValidator({ - name: 'required', - validatorFunction: function (val, $el, config, language, $form) { - switch ($el.attr('type')) { - case 'checkbox': - return $el.is(':checked'); - case 'radio': - return $form.find('input[name="' + $el.attr('name') + '"]').filter(':checked').length > 0; - default: - return $.trim(val) !== ''; - } - }, - errorMessage: '', - errorMessageKey: function(config) { - if (config.errorMessagePosition === 'top' || typeof config.errorMessagePosition === 'function') { - return 'requiredFields'; - } - else { - return 'requiredField'; - } - } - }); - - /* - * Validate length range - */ - $.formUtils.addValidator({ - name: 'length', - validatorFunction: function (val, $el, conf, lang) { - var lengthAllowed = $el.valAttr('length'), - type = $el.attr('type'); - - if (lengthAllowed === undefined) { - alert('Please add attribute "data-validation-length" to ' + $el[0].nodeName + ' named ' + $el.attr('name')); - return true; - } - - // check if length is above min, below max or within range. - var len = type === 'file' && $el.get(0).files !== undefined ? $el.get(0).files.length : val.length, - lengthCheckResults = $.formUtils.numericRangeCheck(len, lengthAllowed), - checkResult; - - switch (lengthCheckResults[0]) { // outside of allowed range - case 'out': - this.errorMessage = lang.lengthBadStart + lengthAllowed + lang.lengthBadEnd; - checkResult = false; - break; - // too short - case 'min': - this.errorMessage = lang.lengthTooShortStart + lengthCheckResults[1] + lang.lengthBadEnd; - checkResult = false; - break; - // too long - case 'max': - this.errorMessage = lang.lengthTooLongStart + lengthCheckResults[1] + lang.lengthBadEnd; - checkResult = false; - break; - // ok - default: - checkResult = true; - } - - return checkResult; - }, - errorMessage: '', - errorMessageKey: '' - }); - - /* - * Validate url - */ - $.formUtils.addValidator({ - name: 'url', - validatorFunction: function (url) { - // written by Scott Gonzalez: http://projects.scottsplayground.com/iri/ - // - Victor Jonsson added support for arrays in the url ?arg[]=sdfsdf - // - General improvements made by Stéphane Moureau - - var urlFilter = /^(https?|ftp):\/\/((((\w|-|\.|~|[\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])(\w|-|\.|~|[\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])(\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|\[|\]|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i; - if (urlFilter.test(url)) { - var domain = url.split('://')[1], - domainSlashPos = domain.indexOf('/'); - - if (domainSlashPos > -1) { - domain = domain.substr(0, domainSlashPos); - } - - return $.formUtils.validators.validate_domain.validatorFunction(domain); // todo: add support for IP-addresses - } - return false; - }, - errorMessage: '', - errorMessageKey: 'badUrl' - }); - - /* - * Validate number (floating or integer) - */ - $.formUtils.addValidator({ - name: 'number', - validatorFunction: function (val, $el, conf) { - if (val !== '') { - var allowing = $el.valAttr('allowing') || '', - decimalSeparator = $el.valAttr('decimal-separator') || conf.decimalSeparator, - allowsRange = false, - begin, end, - steps = $el.valAttr('step') || '', - allowsSteps = false, - sanitize = $el.attr('data-sanitize') || '', - isFormattedWithNumeral = sanitize.match(/(^|[\s])numberFormat([\s]|$)/i); - - if (isFormattedWithNumeral) { - if (!window.numeral) { - throw new ReferenceError('The data-sanitize value numberFormat cannot be used without the numeral' + - ' library. Please see Data Validation in http://www.formvalidator.net for more information.'); - } - //Unformat input first, then convert back to String - if (val.length) { - val = String(numeral().unformat(val)); - } - } - - if (allowing.indexOf('number') === -1) { - allowing += ',number'; - } - - if (allowing.indexOf('negative') === -1 && val.indexOf('-') === 0) { - return false; - } - - if (allowing.indexOf('range') > -1) { - begin = parseFloat(allowing.substring(allowing.indexOf('[') + 1, allowing.indexOf(';'))); - end = parseFloat(allowing.substring(allowing.indexOf(';') + 1, allowing.indexOf(']'))); - allowsRange = true; - } - - if (steps !== '') { - allowsSteps = true; - } - - if (decimalSeparator === ',') { - if (val.indexOf('.') > -1) { - return false; - } - // Fix for checking range with floats using , - val = val.replace(',', '.'); - } - if (val.replace(/[0-9-]/g, '') === '' && (!allowsRange || (val >= begin && val <= end)) && (!allowsSteps || (val % steps === 0))) { - return true; - } - - if (allowing.indexOf('float') > -1 && val.match(new RegExp('^([0-9-]+)\\.([0-9]+)$')) !== null && (!allowsRange || (val >= begin && val <= end)) && (!allowsSteps || (val % steps === 0))) { - return true; - } - } - return false; - }, - errorMessage: '', - errorMessageKey: 'badInt' - }); - - /* - * Validate alpha numeric - */ - $.formUtils.addValidator({ - name: 'alphanumeric', - validatorFunction: function (val, $el, conf, language) { - var patternStart = '^([a-zA-Z0-9', - patternEnd = ']+)$', - additionalChars = $el.valAttr('allowing'), - pattern = '', - hasSpaces = false; - - if (additionalChars) { - pattern = patternStart + additionalChars + patternEnd; - var extra = additionalChars.replace(/\\/g, ''); - if (extra.indexOf(' ') > -1) { - hasSpaces = true; - extra = extra.replace(' ', ''); - extra += language.andSpaces || $.formUtils.LANG.andSpaces; - } - - if(language.badAlphaNumericAndExtraAndSpaces && language.badAlphaNumericAndExtra) { - if(hasSpaces) { - this.errorMessage = language.badAlphaNumericAndExtraAndSpaces + extra; - } else { - this.errorMessage = language.badAlphaNumericAndExtra + extra + language.badAlphaNumericExtra; - } - } else { - this.errorMessage = language.badAlphaNumeric + language.badAlphaNumericExtra + extra; - } - } else { - pattern = patternStart + patternEnd; - this.errorMessage = language.badAlphaNumeric; - } - - return new RegExp(pattern).test(val); - }, - errorMessage: '', - errorMessageKey: '' - }); - - /* - * Validate against regexp - */ - $.formUtils.addValidator({ - name: 'custom', - validatorFunction: function (val, $el) { - var regexp = new RegExp($el.valAttr('regexp')); - return regexp.test(val); - }, - errorMessage: '', - errorMessageKey: 'badCustomVal' - }); - - /* - * Validate date - */ - $.formUtils.addValidator({ - name: 'date', - validatorFunction: function (date, $el, conf) { - var dateFormat = $el.valAttr('format') || conf.dateFormat || 'yyyy-mm-dd', - addMissingLeadingZeros = $el.valAttr('require-leading-zero') === 'false'; - return $.formUtils.parseDate(date, dateFormat, addMissingLeadingZeros) !== false; - }, - errorMessage: '', - errorMessageKey: 'badDate' - }); - - - /* - * Validate group of checkboxes, validate qty required is checked - * written by Steve Wasiura : http://stevewasiura.waztech.com - * element attrs - * data-validation="checkbox_group" - * data-validation-qty="1-2" // min 1 max 2 - * data-validation-error-msg="chose min 1, max of 2 checkboxes" - */ - $.formUtils.addValidator({ - name: 'checkbox_group', - validatorFunction: function (val, $el, conf, lang, $form) { - // preset return var - var isValid = true, - // get name of element. since it is a checkbox group, all checkboxes will have same name - elname = $el.attr('name'), - // get checkboxes and count the checked ones - $checkBoxes = $('input[type=checkbox][name^="' + elname + '"]', $form), - checkedCount = $checkBoxes.filter(':checked').length, - // get el attr that specs qty required / allowed - qtyAllowed = $el.valAttr('qty'); - - if (qtyAllowed === undefined) { - var elementType = $el.get(0).nodeName; - alert('Attribute "data-validation-qty" is missing from ' + elementType + ' named ' + $el.attr('name')); - } - - // call Utility function to check if count is above min, below max, within range etc. - var qtyCheckResults = $.formUtils.numericRangeCheck(checkedCount, qtyAllowed); - - // results will be array, [0]=result str, [1]=qty int - switch (qtyCheckResults[0]) { - // outside allowed range - case 'out': - this.errorMessage = lang.groupCheckedRangeStart + qtyAllowed + lang.groupCheckedEnd; - isValid = false; - break; - // below min qty - case 'min': - this.errorMessage = lang.groupCheckedTooFewStart + qtyCheckResults[1] + (lang.groupCheckedTooFewEnd || lang.groupCheckedEnd); - isValid = false; - break; - // above max qty - case 'max': - this.errorMessage = lang.groupCheckedTooManyStart + qtyCheckResults[1] + (lang.groupCheckedTooManyEnd || lang.groupCheckedEnd); - isValid = false; - break; - // ok - default: - isValid = true; - } - - if( !isValid ) { - var _triggerOnBlur = function() { - $checkBoxes.unbind('click', _triggerOnBlur); - $checkBoxes.filter('*[data-validation]').validateInputOnBlur(lang, conf, false, 'blur'); - }; - $checkBoxes.bind('click', _triggerOnBlur); - } - - return isValid; - } - // errorMessage : '', // set above in switch statement - // errorMessageKey: '' // not used - }); - -})(jQuery); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b,c){function d(a,b){this.$form=a,this.$input=b,this.reset(),b.on("change paste",this.reset.bind(this))}var e=function(){return!1},f=null,g={numHalted:0,haltValidation:function(b){this.numHalted++,a.formUtils.haltValidation=!0,b.unbind("submit",e).bind("submit",e).find('*[type="submit"]').addClass("disabled").attr("disabled","disabled")},unHaltValidation:function(b){this.numHalted--,0===this.numHalted&&(a.formUtils.haltValidation=!1,b.unbind("submit",e).find('*[type="submit"]').removeClass("disabled").removeAttr("disabled","disabled"))}};d.prototype.reset=function(){this.haltedFormValidation=!1,this.hasRun=!1,this.isRunning=!1,this.result=c},d.prototype.run=function(a,b){return"keyup"===a?null:this.isRunning?(f=a,this.haltedFormValidation||(g.haltValidation(),this.haltedFormValidation=!0),null):this.hasRun?this.result:(f=a,g.haltValidation(this.$form),this.haltedFormValidation=!0,this.isRunning=!0,this.$input.attr("disabled","disabled").addClass("async-validation"),this.$form.addClass("async-validation"),b(function(a){this.done(a)}.bind(this)),null)},d.prototype.done=function(a){this.result=a,this.hasRun=!0,this.isRunning=!1,this.$input.removeAttr("disabled").removeClass("async-validation"),this.$form.removeClass("async-validation"),this.haltedFormValidation&&(g.unHaltValidation(this.$form),"submit"===f?this.$form.trigger("submit"):this.$input.trigger("validation.revalidate"))},d.loadInstance=function(a,b,c){var e,f=b.get(0);return f.asyncValidators||(f.asyncValidators={}),f.asyncValidators[a]?e=f.asyncValidators[a]:(e=new d(c,b),f.asyncValidators[a]=e),e},a.formUtils=a.extend(a.formUtils||{},{asyncValidation:function(a,b,c){return this.warn("Use of deprecated function $.formUtils.asyncValidation, use $.formUtils.addAsyncValidator() instead"),d.loadInstance(a,b,c)},addAsyncValidator:function(b){var c=a.extend({},b),e=c.validatorFunction;c.async=!0,c.validatorFunction=function(a,b,f,g,h,i){var j=d.loadInstance(this.name,b,h);return j.run(i,function(d){e.apply(c,[d,a,b,f,g,h,i])})},this.addValidator(c)}}),a(b).bind("validatorsLoaded formValidationSetup",function(b,c){c||(c=a("form")),c.find("[data-validation]").each(function(){var b=a(this);b.valAttr("async",!1),a.each(a.split(b.attr("data-validation")),function(c,d){var e=a.formUtils.validators["validate_"+d];e&&e.async&&b.valAttr("async","yes")})})})}(a,window),function(a,b){"use strict";function c(b){b&&"custom"===b.errorMessagePosition&&"function"==typeof b.errorMessageCustom&&(a.formUtils.warn("Use of deprecated function errorMessageCustom, use config.submitErrorMessageCallback instead"),b.submitErrorMessageCallback=function(a,c){b.errorMessageCustom(a,b.language.errorTitle,c,b)})}function d(b){if(b.errorMessagePosition&&"object"==typeof b.errorMessagePosition){a.formUtils.warn("Deprecated use of config parameter errorMessagePosition, use config.submitErrorMessageCallback instead");var c=b.errorMessagePosition;b.errorMessagePosition="top",b.submitErrorMessageCallback=function(){return c}}}function e(b){var c=b.find("[data-validation-if-checked]");c.length&&a.formUtils.warn('Detected use of attribute "data-validation-if-checked" which is deprecated. Use "data-validation-depends-on" provided by module "logic"'),c.on("beforeValidation",function(){var c=a(this),d=c.valAttr("if-checked"),e=a('input[name="'+d+'"]',b),f=e.is(":checked"),g=(a.formUtils.getValue(e)||"").toString(),h=c.valAttr("if-checked-value");(!f||h&&h!==g)&&c.valAttr("skipped",!0)})}function f(b){var c={se:"sv",cz:"cs",dk:"da"};if(b.lang in c){var d=c[b.lang];a.formUtils.warn('Deprecated use of lang code "'+b.lang+'" use "'+d+'" instead'),b.lang=d}}a.fn.validateForm=function(b,c){return a.formUtils.warn("Use of deprecated function $.validateForm, use $.isValid instead"),this.isValid(b,c,!0)},a(window).on("formValidationPluginInit",function(a,b){f(b),c(b),d(b)}).on("validatorsLoaded formValidationSetup",function(b,c){c||(c=a("form")),e(c)})}(a),function(a){"use strict";var b={resolveErrorMessage:function(a,b,c,d,e){var f=d.validationErrorMsgAttribute+"-"+c.replace("validate_",""),g=a.attr(f);return g||(g=a.attr(d.validationErrorMsgAttribute),g||(g="function"!=typeof b.errorMessageKey?e[b.errorMessageKey]:e[b.errorMessageKey(d)],g||(g=b.errorMessage))),g},getParentContainer:function(b){if(b.valAttr("error-msg-container"))return a(b.valAttr("error-msg-container"));var c=b.parent();return"checkbox"===b.attr("type")&&b.closest(".checkbox").length?c=b.closest(".checkbox").parent():"radio"===b.attr("type")&&b.closest(".radio").length&&(c=b.closest(".radio").parent()),c.closest(".input-group").length&&(c=c.closest(".input-group").parent()),c},applyInputErrorStyling:function(a,b){a.addClass(b.errorElementClass).removeClass(b.successElementClass),this.getParentContainer(a).addClass(b.inputParentClassOnError).removeClass(b.inputParentClassOnSuccess),""!==b.borderColorOnError&&a.css("border-color",b.borderColorOnError)},applyInputSuccessStyling:function(a,b){a.addClass(b.successElementClass),this.getParentContainer(a).addClass(b.inputParentClassOnSuccess)},removeInputStylingAndMessage:function(a,c){a.removeClass(c.successElementClass).removeClass(c.errorElementClass).css("border-color","");var d=b.getParentContainer(a);if(d.removeClass(c.inputParentClassOnError).removeClass(c.inputParentClassOnSuccess),"function"==typeof c.inlineErrorMessageCallback){var e=c.inlineErrorMessageCallback(a,!1,c);e&&e.html("")}else d.find("."+c.errorMessageClass).remove()},removeAllMessagesAndStyling:function(c,d){if("function"==typeof d.submitErrorMessageCallback){var e=d.submitErrorMessageCallback(c,!1,d);e&&e.html("")}else c.find("."+d.errorMessageClass+".alert").remove();c.find("."+d.errorElementClass+",."+d.successElementClass).each(function(){b.removeInputStylingAndMessage(a(this),d)})},setInlineMessage:function(b,c,d){this.applyInputErrorStyling(b,d);var e,f=document.getElementById(b.attr("name")+"_err_msg"),g=!1,h=function(d){a.formUtils.$win.trigger("validationErrorDisplay",[b,d]),d.html(c)},i=function(){var f=!1;g.find("."+d.errorMessageClass).each(function(){if(this.inputReferer===b[0])return f=a(this),!1}),f?c?h(f):f.remove():""!==c&&(e=a('
    '),h(e),e[0].inputReferer=b[0],g.prepend(e))};if(f)a.formUtils.warn("Using deprecated element reference "+f.id),g=a(f),i();else if("function"==typeof d.inlineErrorMessageCallback){if(g=d.inlineErrorMessageCallback(b,c,d),!g)return;i()}else{var j=this.getParentContainer(b);e=j.find("."+d.errorMessageClass+".help-block"),0===e.length&&(e=a("").addClass("help-block").addClass(d.errorMessageClass),e.appendTo(j)),h(e)}},setMessageInTopOfForm:function(b,c,d,e){var f='
    {errorTitle}
      {fields}
    ',g=!1;if("function"!=typeof d.submitErrorMessageCallback||(g=d.submitErrorMessageCallback(b,c,d))){var h={errorTitle:e.errorTitle,fields:"",errorMessageClass:d.errorMessageClass};a.each(c,function(a,b){h.fields+="
  • "+b+"
  • "}),a.each(h,function(a,b){f=f.replace("{"+a+"}",b)}),g?g.html(f):b.children().eq(0).before(a(f))}}};a.formUtils=a.extend(a.formUtils||{},{dialogs:b})}(a),function(a,b,c){"use strict";var d=0;a.fn.validateOnBlur=function(b,c){var d=this,e=this.find("*[data-validation]");return e.each(function(){var e=a(this);if(e.is("[type=radio]")){var f=d.find('[type=radio][name="'+e.attr("name")+'"]');f.bind("blur.validation",function(){e.validateInputOnBlur(b,c,!0,"blur")}),c.validateCheckboxRadioOnClick&&f.bind("click.validation",function(){e.validateInputOnBlur(b,c,!0,"click")})}}),e.bind("blur.validation",function(){a(this).validateInputOnBlur(b,c,!0,"blur")}),c.validateCheckboxRadioOnClick&&this.find("input[type=checkbox][data-validation],input[type=radio][data-validation]").bind("click.validation",function(){a(this).validateInputOnBlur(b,c,!0,"click")}),this},a.fn.validateOnEvent=function(b,c){if(0!==this.length){var d="FORM"===this[0].nodeName?this.find("*[data-validation-event]"):this;return d.each(function(){var d=a(this),e=d.valAttr("event");e&&d.unbind(e+".validation").bind(e+".validation",function(d){9!==(d||{}).keyCode&&a(this).validateInputOnBlur(b,c,!0,e)})}),this}},a.fn.showHelpOnFocus=function(b){return b||(b="data-validation-help"),this.find("textarea,input").each(function(){var c=a(this),e="jquery_form_help_"+ ++d,f=c.attr(b);c.removeClass("has-help-text").unbind("focus.help").unbind("blur.help"),f&&c.addClass("has-help-txt").bind("focus.help",function(){var b=c.parent().find("."+e);0===b.length&&(b=a("").addClass(e).addClass("help").addClass("help-block").text(f).hide(),c.after(b)),b.fadeIn()}).bind("blur.help",function(){a(this).parent().find("."+e).fadeOut("slow")})}),this},a.fn.validate=function(b,c,d){var e=a.extend({},a.formUtils.LANG,d||{});this.each(function(){var d=a(this),f=d.closest("form").get(0)||{},g=f.validationConfig||a.formUtils.defaultConfig();d.one("validation",function(a,c){"function"==typeof b&&b(c,this,a)}),d.validateInputOnBlur(e,a.extend({},g,c||{}),!0)})},a.fn.willPostponeValidation=function(){return(this.valAttr("suggestion-nr")||this.valAttr("postpone")||this.hasClass("hasDatepicker"))&&!b.postponedValidation},a.fn.validateInputOnBlur=function(c,d,e,f){if(a.formUtils.eventType=f,this.willPostponeValidation()){var g=this,h=this.valAttr("postpone")||200;return b.postponedValidation=function(){g.validateInputOnBlur(c,d,e,f),b.postponedValidation=!1},setTimeout(function(){b.postponedValidation&&b.postponedValidation()},h),this}c=a.extend({},a.formUtils.LANG,c||{}),a.formUtils.dialogs.removeInputStylingAndMessage(this,d);var i=this,j=i.closest("form"),k=a.formUtils.validateInput(i,c,d,j,f),l=function(){i.validateInputOnBlur(c,d,!1,"blur.revalidated")};return"blur"===f&&i.unbind("validation.revalidate",l).one("validation.revalidate",l),e&&i.removeKeyUpValidation(),k.shouldChangeDisplay&&(k.isValid?a.formUtils.dialogs.applyInputSuccessStyling(i,d):a.formUtils.dialogs.setInlineMessage(i,k.errorMsg,d)),!k.isValid&&e&&i.validateOnKeyUp(c,d),this},a.fn.validateOnKeyUp=function(b,c){return this.each(function(){var d=a(this);d.valAttr("has-keyup-event")||d.valAttr("has-keyup-event","true").bind("keyup.validation",function(a){9!==a.keyCode&&d.validateInputOnBlur(b,c,!1,"keyup")})}),this},a.fn.removeKeyUpValidation=function(){return this.each(function(){a(this).valAttr("has-keyup-event",!1).unbind("keyup.validation")}),this},a.fn.valAttr=function(a,b){return b===c?this.attr("data-validation-"+a):b===!1||null===b?this.removeAttr("data-validation-"+a):(a=a.length>0?"-"+a:"",this.attr("data-validation"+a,b))},a.fn.isValid=function(b,c,d){if(a.formUtils.isLoadingModules){var e=this;return setTimeout(function(){e.isValid(b,c,d)},200),null}c=a.extend({},a.formUtils.defaultConfig(),c||{}),b=a.extend({},a.formUtils.LANG,b||{}),d=d!==!1,a.formUtils.errorDisplayPreventedWhenHalted&&(delete a.formUtils.errorDisplayPreventedWhenHalted,d=!1);var f=function(b,e){a.inArray(b,h)<0&&h.push(b),i.push(e),e.valAttr("current-error",b),d&&a.formUtils.dialogs.applyInputErrorStyling(e,c)},g=[],h=[],i=[],j=this,k=function(b,d){return"submit"===d||"button"===d||"reset"===d||a.inArray(b,c.ignore||[])>-1};if(d&&a.formUtils.dialogs.removeAllMessagesAndStyling(j,c),j.find("input,textarea,select").filter(':not([type="submit"],[type="button"])').each(function(){var d=a(this),e=d.attr("type"),h="radio"===e||"checkbox"===e,i=d.attr("name");if(!k(i,e)&&(!h||a.inArray(i,g)<0)){h&&g.push(i);var l=a.formUtils.validateInput(d,b,c,j,"submit");l.isValid?l.isValid&&l.shouldChangeDisplay&&(d.valAttr("current-error",!1),a.formUtils.dialogs.applyInputSuccessStyling(d,c)):f(l.errorMsg,d)}}),"function"==typeof c.onValidate){var l=c.onValidate(j);a.isArray(l)?a.each(l,function(a,b){f(b.message,b.element)}):l&&l.element&&l.message&&f(l.message,l.element)}return a.formUtils.isValidatingEntireForm=!1,i.length>0&&d&&("top"===c.errorMessagePosition?a.formUtils.dialogs.setMessageInTopOfForm(j,h,c,b):a.each(i,function(b,d){a.formUtils.dialogs.setInlineMessage(d,d.valAttr("current-error"),c)}),c.scrollToTopOnError&&a.formUtils.$win.scrollTop(j.offset().top-20)),!d&&a.formUtils.haltValidation&&(a.formUtils.errorDisplayPreventedWhenHalted=!0),0===i.length&&!a.formUtils.haltValidation},a.fn.restrictLength=function(b){return new a.formUtils.lengthRestriction(this,b),this},a.fn.addSuggestions=function(b){var c=!1;return this.find("input").each(function(){var d=a(this);c=a.split(d.attr("data-suggestions")),c.length>0&&!d.hasClass("has-suggestions")&&(a.formUtils.suggest(d,c,b),d.addClass("has-suggestions"))}),this}}(a,window),function(a){"use strict";a.formUtils=a.extend(a.formUtils||{},{isLoadingModules:!1,loadedModules:{},registerLoadedModule:function(b){this.loadedModules[a.trim(b).toLowerCase()]=!0},hasLoadedModule:function(b){return a.trim(b).toLowerCase()in this.loadedModules},loadModules:function(b,c,d){if(a.formUtils.isLoadingModules)return void setTimeout(function(){a.formUtils.loadModules(b,c,d)},100);var e=function(b,c){var e=a.split(b),f=e.length,g=function(){f--,0===f&&(a.formUtils.isLoadingModules=!1,"function"==typeof d&&d())};f>0&&(a.formUtils.isLoadingModules=!0);var h="?_="+(new Date).getTime(),i=document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0];a.each(e,function(b,d){if(d=a.trim(d),0===d.length||a.formUtils.hasLoadedModule(d))g();else{var e=c+d+(".js"===d.slice(-3)?"":".js"),f=document.createElement("SCRIPT");"function"==typeof define&&define.amd?require([e+(".dev.js"===e.slice(-7)?h:"")],g):(f.type="text/javascript",f.onload=g,f.src=e+(".dev.js"===e.slice(-7)?h:""),f.onerror=function(){a.formUtils.warn("Unable to load form validation module "+e,!0),g()},f.onreadystatechange=function(){"complete"!==this.readyState&&"loaded"!==this.readyState||(g(),this.onload=null,this.onreadystatechange=null)},i.appendChild(f))}})};if(c)e(b,c);else{var f=function(){var c=!1;return a('script[src*="form-validator"]').each(function(){var a=this.src.split("form-validator")[1].split("node_modules").length>1;if(!a)return c=this.src.substr(0,this.src.lastIndexOf("/"))+"/","/"===c&&(c=""),!1}),c!==!1&&(e(b,c),!0)};f()||a(function(){var a=f();a||"function"==typeof d&&d()})}}})}(a),function(a){"use strict";a.split=function(b,c,d){d=void 0===d||d===!0;var e="[,|"+(d?"\\s":"")+"-]\\s*",f=new RegExp(e,"g");if("function"!=typeof c){if(!b)return[];var g=[];return a.each(b.split(c?c:f),function(b,c){c=a.trim(c),c.length&&g.push(c)}),g}b&&a.each(b.split(f),function(b,d){if(d=a.trim(d),d.length)return c(d,b)})},a.validate=function(b){var c=a.extend(a.formUtils.defaultConfig(),{form:"form",validateOnEvent:!1,validateOnBlur:!0,validateCheckboxRadioOnClick:!0,showHelpOnFocus:!0,addSuggestions:!0,modules:"",onModulesLoaded:null,language:!1,onSuccess:!1,onError:!1,onElementValidate:!1});if(b=a.extend(c,b||{}),a(window).trigger("formValidationPluginInit",[b]),b.lang&&"en"!==b.lang){var d="lang/"+b.lang+".js";b.modules+=b.modules.length?","+d:d}a(b.form).each(function(c,d){d.validationConfig=b;var e=a(d);e.trigger("formValidationSetup",[e,b]),e.find(".has-help-txt").unbind("focus.validation").unbind("blur.validation"),e.removeClass("has-validation-callback").unbind("submit.validation").unbind("reset.validation").find("input[data-validation],textarea[data-validation]").unbind("blur.validation"),e.bind("submit.validation",function(c){var d=a(this),e=function(){return c.stopImmediatePropagation(),!1};if(a.formUtils.haltValidation)return e();if(a.formUtils.isLoadingModules)return setTimeout(function(){d.trigger("submit.validation")},200),e();var f=d.isValid(b.language,b);if(a.formUtils.haltValidation)return e();if(!f||"function"!=typeof b.onSuccess)return f||"function"!=typeof b.onError?!!f||e():(b.onError(d),e());var g=b.onSuccess(d);return g===!1?e():void 0}).bind("reset.validation",function(){a.formUtils.dialogs.removeAllMessagesAndStyling(e,b)}).addClass("has-validation-callback"),b.showHelpOnFocus&&e.showHelpOnFocus(),b.addSuggestions&&e.addSuggestions(),b.validateOnBlur&&(e.validateOnBlur(b.language,b),e.bind("html5ValidationAttrsFound",function(){e.validateOnBlur(b.language,b)})),b.validateOnEvent&&e.validateOnEvent(b.language,b)}),""!==b.modules&&a.formUtils.loadModules(b.modules,null,function(){"function"==typeof b.onModulesLoaded&&b.onModulesLoaded();var c="string"==typeof b.form?a(b.form):b.form;a.formUtils.$win.trigger("validatorsLoaded",[c,b])})}}(a),function(a,b){"use strict";var c=a(b);a.formUtils=a.extend(a.formUtils||{},{$win:c,defaultConfig:function(){return{ignore:[],errorElementClass:"error",successElementClass:"valid",borderColorOnError:"#b94a48",errorMessageClass:"form-error",validationRuleAttribute:"data-validation",validationErrorMsgAttribute:"data-validation-error-msg",errorMessagePosition:"inline",errorMessageTemplate:{container:'
    {messages}
    ',messages:"{errorTitle}
      {fields}
    ",field:"
  • {msg}
  • "},scrollToTopOnError:!0,dateFormat:"yyyy-mm-dd",addValidClassOnAll:!1,decimalSeparator:".",inputParentClassOnError:"has-error",inputParentClassOnSuccess:"has-success",validateHiddenInputs:!1,inlineErrorMessageCallback:!1,submitErrorMessageCallback:!1}},validators:{},sanitizers:{},_events:{load:[],valid:[],invalid:[]},haltValidation:!1,addValidator:function(a){var b=0===a.name.indexOf("validate_")?a.name:"validate_"+a.name;void 0===a.validateOnKeyUp&&(a.validateOnKeyUp=!0),this.validators[b]=a},addSanitizer:function(a){this.sanitizers[a.name]=a},warn:function(a,c){"console"in b?"function"==typeof b.console.warn?b.console.warn(a):"function"==typeof b.console.log&&b.console.log(a):c&&alert(a)},getValue:function(a,b){var c=b?b.find(a):a;if(c.length>0){var d=c.eq(0).attr("type");return"radio"===d||"checkbox"===d?c.filter(":checked").val()||"":c.val()||""}return!1},validateInput:function(b,c,d,e,f){d=d||a.formUtils.defaultConfig(),c=c||a.formUtils.LANG,e.length||(e=b.parent());var g=this.getValue(b);b.valAttr("skipped",!1).one("beforeValidation",function(){(b.attr("disabled")||!b.is(":visible")&&!d.validateHiddenInputs)&&b.valAttr("skipped",1)}).trigger("beforeValidation",[g,c,d]);var h="true"===b.valAttr("optional"),i=!g&&h,j=b.attr(d.validationRuleAttribute),k=!0,l="",m={isValid:!0,shouldChangeDisplay:!0,errorMsg:""};if(!j||i||b.valAttr("skipped"))return m.shouldChangeDisplay=d.addValidClassOnAll,m;var n=b.valAttr("ignore");return n&&a.each(n.split(""),function(a,b){g=g.replace(new RegExp("\\"+b,"g"),"")}),a.split(j,function(h){0!==h.indexOf("validate_")&&(h="validate_"+h);var i=a.formUtils.validators[h];if(!i)throw new Error('Using undefined validator "'+h+'". Maybe you have forgotten to load the module that "'+h+'" belongs to?');if("validate_checkbox_group"===h&&(b=e.find('[name="'+b.attr("name")+'"]:eq(0)')),("keyup"!==f||i.validateOnKeyUp)&&(k=i.validatorFunction(g,b,d,c,e,f)),!k)return d.validateOnBlur&&b.validateOnKeyUp(c,d),l=a.formUtils.dialogs.resolveErrorMessage(b,i,h,d,c),!1}),k===!1?(b.trigger("validation",!1),m.errorMsg=l,m.isValid=!1,m.shouldChangeDisplay=!0):null===k?m.shouldChangeDisplay=!1:(b.trigger("validation",!0),m.shouldChangeDisplay=!0),"function"==typeof d.onElementValidate&&null!==l&&d.onElementValidate(m.isValid,b,e,l),b.trigger("afterValidation",[m,f]),m},parseDate:function(b,c,d){var e,f,g,h,i=c.replace(/[a-zA-Z]/gi,"").substring(0,1),j="^",k=c.split(i||null);if(a.each(k,function(a,b){j+=(a>0?"\\"+i:"")+"(\\d{"+b.length+"})"}),j+="$",d){var l=[];a.each(b.split(i),function(a,b){1===b.length&&(b="0"+b),l.push(b)}),b=l.join(i)}if(e=b.match(new RegExp(j)),null===e)return!1;var m=function(b,c,d){for(var e=0;e28&&(h%4!==0||h%100===0&&h%400!==0)||2===g&&f>29&&(h%4===0||h%100!==0&&h%400===0)||g>12||0===g)&&(!(this.isShortMonth(g)&&f>30||!this.isShortMonth(g)&&f>31||0===f)&&[h,g,f])},parseDateInt:function(a){return 0===a.indexOf("0")&&(a=a.replace("0","")),parseInt(a,10)},isShortMonth:function(a){return a%2===0&&a<7||a%2!==0&&a>7},lengthRestriction:function(b,c){var d=parseInt(c.text(),10),e=0,f=function(){var a=b.val().length;if(a>d){var f=b.scrollTop();b.val(b.val().substring(0,d)),b.scrollTop(f)}e=d-a,e<0&&(e=0),c.text(e)};a(b).bind("keydown keyup keypress focus blur",f).bind("cut paste",function(){setTimeout(f,100)}),a(document).bind("ready",f)},numericRangeCheck:function(b,c){var d=a.split(c),e=parseInt(c.substr(3),10);return 1===d.length&&c.indexOf("min")===-1&&c.indexOf("max")===-1&&(d=[c,c]),2===d.length&&(bparseInt(d[1],10))?["out",d[0],d[1]]:0===c.indexOf("min")&&be?["max",e]:["ok"]},_numSuggestionElements:0,_selectedSuggestion:null,_previousTypedVal:null,suggest:function(b,d,e){var f={css:{maxHeight:"150px",background:"#FFF",lineHeight:"150%",textDecoration:"underline",overflowX:"hidden",overflowY:"auto",border:"#CCC solid 1px",borderTop:"none",cursor:"pointer"},activeSuggestionCSS:{background:"#E9E9E9"}},g=function(a,b){var c=b.offset();a.css({width:b.outerWidth(),left:c.left+"px",top:c.top+b.outerHeight()+"px"})};e&&a.extend(f,e),f.css.position="absolute",f.css["z-index"]=9999,b.attr("autocomplete","off"),0===this._numSuggestionElements&&c.bind("resize",function(){a(".jquery-form-suggestions").each(function(){var b=a(this),c=b.attr("data-suggest-container");g(b,a(".suggestions-"+c).eq(0))})}),this._numSuggestionElements++;var h=function(b){var c=b.valAttr("suggestion-nr");a.formUtils._selectedSuggestion=null,a.formUtils._previousTypedVal=null,a(".jquery-form-suggestion-"+c).fadeOut("fast")};return b.data("suggestions",d).valAttr("suggestion-nr",this._numSuggestionElements).unbind("focus.suggest").bind("focus.suggest",function(){a(this).trigger("keyup"),a.formUtils._selectedSuggestion=null}).unbind("keyup.suggest").bind("keyup.suggest",function(){var c=a(this),d=[],e=a.trim(c.val()).toLocaleLowerCase();if(e!==a.formUtils._previousTypedVal){a.formUtils._previousTypedVal=e;var i=!1,j=c.valAttr("suggestion-nr"),k=a(".jquery-form-suggestion-"+j);if(k.scrollTop(0),""!==e){var l=e.length>2;a.each(c.data("suggestions"),function(a,b){var c=b.toLocaleLowerCase();return c===e?(d.push(""+b+""),i=!0,!1):void((0===c.indexOf(e)||l&&c.indexOf(e)>-1)&&d.push(b.replace(new RegExp(e,"gi"),"$&")))})}i||0===d.length&&k.length>0?k.hide():d.length>0&&0===k.length?(k=a("
    ").css(f.css).appendTo("body"),b.addClass("suggestions-"+j),k.attr("data-suggest-container",j).addClass("jquery-form-suggestions").addClass("jquery-form-suggestion-"+j)):d.length>0&&!k.is(":visible")&&k.show(),d.length>0&&e.length!==d[0].length&&(g(k,c),k.html(""),a.each(d,function(b,d){a("
    ").append(d).css({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"5px"}).addClass("form-suggest-element").appendTo(k).click(function(){c.focus(),c.val(a(this).text()),c.trigger("change"),h(c)})}))}}).unbind("keydown.validation").bind("keydown.validation",function(b){var c,d,e=b.keyCode?b.keyCode:b.which,g=a(this);if(13===e&&null!==a.formUtils._selectedSuggestion){if(c=g.valAttr("suggestion-nr"),d=a(".jquery-form-suggestion-"+c),d.length>0){var i=d.find("div").eq(a.formUtils._selectedSuggestion).text();g.val(i),g.trigger("change"),h(g),b.preventDefault()}}else{c=g.valAttr("suggestion-nr"),d=a(".jquery-form-suggestion-"+c);var j=d.children();if(j.length>0&&a.inArray(e,[38,40])>-1){38===e?(null===a.formUtils._selectedSuggestion?a.formUtils._selectedSuggestion=j.length-1:a.formUtils._selectedSuggestion--,a.formUtils._selectedSuggestion<0&&(a.formUtils._selectedSuggestion=j.length-1)):40===e&&(null===a.formUtils._selectedSuggestion?a.formUtils._selectedSuggestion=0:a.formUtils._selectedSuggestion++,a.formUtils._selectedSuggestion>j.length-1&&(a.formUtils._selectedSuggestion=0));var k=d.innerHeight(),l=d.scrollTop(),m=d.children().eq(0).outerHeight(),n=m*a.formUtils._selectedSuggestion;return(nl+k)&&d.scrollTop(n),j.removeClass("active-suggestion").css("background","none").eq(a.formUtils._selectedSuggestion).addClass("active-suggestion").css(f.activeSuggestionCSS),b.preventDefault(),!1}}}).unbind("blur.suggest").bind("blur.suggest",function(){h(a(this))}),b},LANG:{errorTitle:"Form submission failed!",requiredField:"This is a required field",requiredFields:"You have not answered all required fields",badTime:"You have not given a correct time",badEmail:"You have not given a correct e-mail address",badTelephone:"You have not given a correct phone number",badSecurityAnswer:"You have not given a correct answer to the security question",badDate:"You have not given a correct date",lengthBadStart:"The input value must be between ",lengthBadEnd:" characters",lengthTooLongStart:"The input value is longer than ",lengthTooShortStart:"The input value is shorter than ",notConfirmed:"Input values could not be confirmed",badDomain:"Incorrect domain value",badUrl:"The input value is not a correct URL",badCustomVal:"The input value is incorrect",andSpaces:" and spaces ",badInt:"The input value was not a correct number",badSecurityNumber:"Your social security number was incorrect",badUKVatAnswer:"Incorrect UK VAT Number",badUKNin:"Incorrect UK NIN",badUKUtr:"Incorrect UK UTR Number",badStrength:"The password isn't strong enough",badNumberOfSelectedOptionsStart:"You have to choose at least ",badNumberOfSelectedOptionsEnd:" answers",badAlphaNumeric:"The input value can only contain alphanumeric characters ",badAlphaNumericExtra:" and ",wrongFileSize:"The file you are trying to upload is too large (max %s)",wrongFileType:"Only files of type %s is allowed",groupCheckedRangeStart:"Please choose between ",groupCheckedTooFewStart:"Please choose at least ",groupCheckedTooManyStart:"Please choose a maximum of ",groupCheckedEnd:" item(s)",badCreditCard:"The credit card number is not correct",badCVV:"The CVV number was not correct",wrongFileDim:"Incorrect image dimensions,",imageTooTall:"the image can not be taller than",imageTooWide:"the image can not be wider than",imageTooSmall:"the image was too small",min:"min",max:"max",imageRatioNotAccepted:"Image ratio is not be accepted",badBrazilTelephoneAnswer:"The phone number entered is invalid",badBrazilCEPAnswer:"The CEP entered is invalid",badBrazilCPFAnswer:"The CPF entered is invalid",badPlPesel:"The PESEL entered is invalid",badPlNip:"The NIP entered is invalid",badPlRegon:"The REGON entered is invalid",badreCaptcha:"Please confirm that you are not a bot",passwordComplexityStart:"Password must contain at least ",passwordComplexitySeparator:", ",passwordComplexityUppercaseInfo:" uppercase letter(s)",passwordComplexityLowercaseInfo:" lowercase letter(s)",passwordComplexitySpecialCharsInfo:" special character(s)",passwordComplexityNumericCharsInfo:" numeric character(s)",passwordComplexityEnd:"."}})}(a,window),function(a){a.formUtils.addValidator({name:"email",validatorFunction:function(b){var c=b.toLowerCase().split("@"),d=c[0],e=c[1];if(d&&e){if(0===d.indexOf('"')){var f=d.length;if(d=d.replace(/\"/g,""),d.length!==f-2)return!1}return a.formUtils.validators.validate_domain.validatorFunction(c[1])&&0!==d.indexOf(".")&&"."!==d.substring(d.length-1,d.length)&&d.indexOf("..")===-1&&!/[^\w\+\.\-\#\-\_\~\!\$\&\'\(\)\*\+\,\;\=\:]/.test(d)}return!1},errorMessage:"",errorMessageKey:"badEmail"}),a.formUtils.addValidator({name:"domain",validatorFunction:function(a){return a.length>0&&a.length<=253&&!/[^a-zA-Z0-9]/.test(a.slice(-2))&&!/[^a-zA-Z0-9]/.test(a.substr(0,1))&&!/[^a-zA-Z0-9\.\-]/.test(a)&&1===a.split("..").length&&a.split(".").length>1},errorMessage:"",errorMessageKey:"badDomain"}),a.formUtils.addValidator({name:"required",validatorFunction:function(b,c,d,e,f){switch(c.attr("type")){case"checkbox":return c.is(":checked");case"radio":return f.find('input[name="'+c.attr("name")+'"]').filter(":checked").length>0;default:return""!==a.trim(b)}},errorMessage:"",errorMessageKey:function(a){return"top"===a.errorMessagePosition||"function"==typeof a.errorMessagePosition?"requiredFields":"requiredField"}}),a.formUtils.addValidator({name:"length",validatorFunction:function(b,c,d,e){var f=c.valAttr("length"),g=c.attr("type");if(void 0===f)return alert('Please add attribute "data-validation-length" to '+c[0].nodeName+" named "+c.attr("name")),!0;var h,i="file"===g&&void 0!==c.get(0).files?c.get(0).files.length:b.length,j=a.formUtils.numericRangeCheck(i,f);switch(j[0]){case"out":this.errorMessage=e.lengthBadStart+f+e.lengthBadEnd,h=!1;break;case"min":this.errorMessage=e.lengthTooShortStart+j[1]+e.lengthBadEnd,h=!1;break;case"max":this.errorMessage=e.lengthTooLongStart+j[1]+e.lengthBadEnd,h=!1;break;default:h=!0}return h},errorMessage:"",errorMessageKey:""}),a.formUtils.addValidator({name:"url",validatorFunction:function(b){var c=/^(https?|ftp):\/\/((((\w|-|\.|~|[\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])(\w|-|\.|~|[\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])(\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|\[|\]|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;if(c.test(b)){var d=b.split("://")[1],e=d.indexOf("/");return e>-1&&(d=d.substr(0,e)),a.formUtils.validators.validate_domain.validatorFunction(d)}return!1},errorMessage:"",errorMessageKey:"badUrl"}),a.formUtils.addValidator({name:"number",validatorFunction:function(a,b,c){if(""!==a){var d,e,f=b.valAttr("allowing")||"",g=b.valAttr("decimal-separator")||c.decimalSeparator,h=!1,i=b.valAttr("step")||"",j=!1,k=b.attr("data-sanitize")||"",l=k.match(/(^|[\s])numberFormat([\s]|$)/i);if(l){if(!window.numeral)throw new ReferenceError("The data-sanitize value numberFormat cannot be used without the numeral library. Please see Data Validation in http://www.formvalidator.net for more information.");a.length&&(a=String(numeral().unformat(a)))}if(f.indexOf("number")===-1&&(f+=",number"),f.indexOf("negative")===-1&&0===a.indexOf("-"))return!1;if(f.indexOf("range")>-1&&(d=parseFloat(f.substring(f.indexOf("[")+1,f.indexOf(";"))),e=parseFloat(f.substring(f.indexOf(";")+1,f.indexOf("]"))),h=!0),""!==i&&(j=!0),","===g){if(a.indexOf(".")>-1)return!1;a=a.replace(",",".")}if(""===a.replace(/[0-9-]/g,"")&&(!h||a>=d&&a<=e)&&(!j||a%i===0))return!0;if(f.indexOf("float")>-1&&null!==a.match(new RegExp("^([0-9-]+)\\.([0-9]+)$"))&&(!h||a>=d&&a<=e)&&(!j||a%i===0))return!0}return!1},errorMessage:"",errorMessageKey:"badInt"}),a.formUtils.addValidator({name:"alphanumeric",validatorFunction:function(b,c,d,e){var f="^([a-zA-Z0-9",g="]+)$",h=c.valAttr("allowing"),i="",j=!1;if(h){i=f+h+g;var k=h.replace(/\\/g,"");k.indexOf(" ")>-1&&(j=!0,k=k.replace(" ",""),k+=e.andSpaces||a.formUtils.LANG.andSpaces),e.badAlphaNumericAndExtraAndSpaces&&e.badAlphaNumericAndExtra?j?this.errorMessage=e.badAlphaNumericAndExtraAndSpaces+k:this.errorMessage=e.badAlphaNumericAndExtra+k+e.badAlphaNumericExtra:this.errorMessage=e.badAlphaNumeric+e.badAlphaNumericExtra+k; +}else i=f+g,this.errorMessage=e.badAlphaNumeric;return new RegExp(i).test(b)},errorMessage:"",errorMessageKey:""}),a.formUtils.addValidator({name:"custom",validatorFunction:function(a,b){var c=new RegExp(b.valAttr("regexp"));return c.test(a)},errorMessage:"",errorMessageKey:"badCustomVal"}),a.formUtils.addValidator({name:"date",validatorFunction:function(b,c,d){var e=c.valAttr("format")||d.dateFormat||"yyyy-mm-dd",f="false"===c.valAttr("require-leading-zero");return a.formUtils.parseDate(b,e,f)!==!1},errorMessage:"",errorMessageKey:"badDate"}),a.formUtils.addValidator({name:"checkbox_group",validatorFunction:function(b,c,d,e,f){var g=!0,h=c.attr("name"),i=a('input[type=checkbox][name^="'+h+'"]',f),j=i.filter(":checked").length,k=c.valAttr("qty");if(void 0===k){var l=c.get(0).nodeName;alert('Attribute "data-validation-qty" is missing from '+l+" named "+c.attr("name"))}var m=a.formUtils.numericRangeCheck(j,k);switch(m[0]){case"out":this.errorMessage=e.groupCheckedRangeStart+k+e.groupCheckedEnd,g=!1;break;case"min":this.errorMessage=e.groupCheckedTooFewStart+m[1]+(e.groupCheckedTooFewEnd||e.groupCheckedEnd),g=!1;break;case"max":this.errorMessage=e.groupCheckedTooManyStart+m[1]+(e.groupCheckedTooManyEnd||e.groupCheckedEnd),g=!1;break;default:g=!0}if(!g){var n=function(){i.unbind("click",n),i.filter("*[data-validation]").validateInputOnBlur(e,d,!1,"blur")};i.bind("click",n)}return g}})}(a)}); \ No newline at end of file diff --git a/form-validator/jsconf.js b/form-validator/jsconf.js index b846e76..1499923 100644 --- a/form-validator/jsconf.js +++ b/form-validator/jsconf.js @@ -1,75 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator Module: JSconf - * ------------------------------------------ - * Created by Victor Jonsson +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * This module makes it possible to configure form validation using javascript - * - * @website http://formvalidator.net/#location-validators - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($) { - - 'use strict'; - - $.formUtils.registerLoadedModule('jsconf'); - - $.setupValidation = function(conf) { - var $forms = $(conf.form || 'form'); - $.each(conf.validate || conf.validation || {}, function(elemRef, attr) { - var $elem; - if ( elemRef[0] === '#' ) { - $elem = $(elemRef); - } - else if ( elemRef[0] === '.' ) { - $elem = $forms.find(elemRef); - } - else { - $elem = $forms.find('*[name="' +elemRef+ '"]'); - } - - $elem.attr('data-validation', attr.validation); - - $.each(attr, function(name, val) { - if( name !== 'validation' && val !== false) { - if( val === true ) { - val = 'true'; - } - if( name[0] === '_' ) { - name = name.substring(1); - if( val === false ) { - $elem.removeAttr(name); - } else { - $elem.attr(name, val); - } - } else { - $elem.valAttr(name, val); - } - } - }); - }); - - $.validate(conf); - - }; - -})(jQuery); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){"use strict";a.formUtils.registerLoadedModule("jsconf"),a.setupValidation=function(b){var c=a(b.form||"form");a.each(b.validate||b.validation||{},function(b,d){var e;e="#"===b[0]?a(b):"."===b[0]?c.find(b):c.find('*[name="'+b+'"]'),e.attr("data-validation",d.validation),a.each(d,function(a,b){"validation"!==a&&b!==!1&&(b===!0&&(b="true"),"_"===a[0]?(a=a.substring(1),b===!1?e.removeAttr(a):e.attr(a,b)):e.valAttr(a,b))})}),a.validate(b)}}(a)}); \ No newline at end of file diff --git a/form-validator/lang/ar.js b/form-validator/lang/ar.js index bed8259..8b80062 100644 --- a/form-validator/lang/ar.js +++ b/form-validator/lang/ar.js @@ -1,98 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Arabic language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/ar'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'فَشِلَ إرسال النموذج', - requiredField: 'هذا الحقل مطلوب', - requiredFields: 'لم يتم ملأ جميع الحقول المطلوبة.', - badTime: 'حقل الوقت خاطىء', - badEmail: 'البريد الإلكتروني المدخل خاطئ', - badTelephone: 'رقم الهاتف المدخل خاطئ', - badSecurityAnswer: 'لم يتم الإجابة عن سؤال الأمان', - badDate: 'تاريخ مدخل خاطئ', - lengthBadStart: 'القيمة المدخلة يجب أن تكون بين ', - lengthBadEnd: ' حروف', - lengthTooLongStart: 'القيمة المدخل أطول من ', - lengthTooShortStart: 'القيمة المدخل أقصر من ', - notConfirmed: 'لم يتم تأكيد القيمة المدخلة', - badDomain: 'قيمة نطاق خاطئة', - badUrl: 'القيمة المدخلة ليست رابطاً صالحاً', - badCustomVal: 'القيمة المدخلة غير صالحة', - andSpaces: ' ومسافات ', - badInt: 'القيمة المدخلة ليست رقماً صحيحاً', - badSecurityNumber: 'رقم بطاقة الهوية غير صحيح', - badUKVatAnswer: 'رقم UK VAT غير صحيح', - badUKNin: 'غير صحيح UK NINرقم ', - badUKUtr: 'غير صحيح UK UTR رقم', - badStrength: 'كلمة المرور غير قوية', - badNumberOfSelectedOptionsStart: 'يجب اختيار على الأقل ', - badNumberOfSelectedOptionsEnd: ' أجوبة', - badAlphaNumeric: 'القيمة المدخلة يجب أن تتضمن حروف وأرقام فقط ', - badAlphaNumericExtra: ' و ', - wrongFileSize: 'الملف المراد تحميله كبير جداً (الحد المسموج %s)', - wrongFileType: 'ملفات من نوع %s فقط مسموحة', - groupCheckedRangeStart: 'من فضلك اختر بين ', - groupCheckedTooFewStart: 'من فضلك اختر على الأقل ', - groupCheckedTooManyStart: 'من فضلك اختر بحد أقصى ', - groupCheckedEnd: ' مرات', - badCreditCard: 'رقم بطاقة ائتمانية خاطىء', - badCVV: 'رمز الأمان خاطئ', - wrongFileDim : 'حدود الصورة غير صالحة', - imageTooTall : 'الصورة يمكن أن تكون أطول من', - imageTooWide : 'الصورة يمكن أن تكون أعرض من', - imageTooSmall : 'صورة صغيرة جداً', - min : 'أدنى', - max : 'أقصى', - imageRatioNotAccepted : 'أبعاد صورة غير مقبولة', - badBrazilTelephoneAnswer: 'رقم هاتف مدخل خاطىء', - badBrazilCEPAnswer: 'قيمة CEP المدخلة غير صحيحة', - badBrazilCPFAnswer: 'قيمة CPF المدخلة غير صحيحة', - badPlPesel: 'قيمة Pl PESEL المدخلة غير صحيحة', - badPlNip: 'قيمة Pl NIP المدخلة غير صحيحة', - badPlRegon: 'قيمة Pl REGON المدخلة غير صحيحة', - badreCaptcha: 'من فضلك أكد أنك لست روبوتاً', - passwordComplexityStart: 'كملة المرور تتكون على الأقل من ', - passwordComplexitySeparator: ', ', - passwordComplexityUppercaseInfo: ' حروف كبيرة', - passwordComplexityLowercaseInfo: ' حروف صغيرة', - passwordComplexitySpecialCharsInfo: ' رموز خاصة', - passwordComplexityNumericCharsInfo: ' أرقام', - passwordComplexityEnd: '.' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/ar"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"فَشِلَ إرسال النموذج",requiredField:"هذا الحقل مطلوب",requiredFields:"لم يتم ملأ جميع الحقول المطلوبة.",badTime:"حقل الوقت خاطىء",badEmail:"البريد الإلكتروني المدخل خاطئ",badTelephone:"رقم الهاتف المدخل خاطئ",badSecurityAnswer:"لم يتم الإجابة عن سؤال الأمان",badDate:"تاريخ مدخل خاطئ",lengthBadStart:"القيمة المدخلة يجب أن تكون بين ",lengthBadEnd:" حروف",lengthTooLongStart:"القيمة المدخل أطول من ",lengthTooShortStart:"القيمة المدخل أقصر من ",notConfirmed:"لم يتم تأكيد القيمة المدخلة",badDomain:"قيمة نطاق خاطئة",badUrl:"القيمة المدخلة ليست رابطاً صالحاً",badCustomVal:"القيمة المدخلة غير صالحة",andSpaces:" ومسافات ",badInt:"القيمة المدخلة ليست رقماً صحيحاً",badSecurityNumber:"رقم بطاقة الهوية غير صحيح",badUKVatAnswer:"رقم UK VAT غير صحيح",badUKNin:"غير صحيح UK NINرقم ",badUKUtr:"غير صحيح UK UTR رقم",badStrength:"كلمة المرور غير قوية",badNumberOfSelectedOptionsStart:"يجب اختيار على الأقل ",badNumberOfSelectedOptionsEnd:" أجوبة",badAlphaNumeric:"القيمة المدخلة يجب أن تتضمن حروف وأرقام فقط ",badAlphaNumericExtra:" و ",wrongFileSize:"الملف المراد تحميله كبير جداً (الحد المسموج %s)",wrongFileType:"ملفات من نوع %s فقط مسموحة",groupCheckedRangeStart:"من فضلك اختر بين ",groupCheckedTooFewStart:"من فضلك اختر على الأقل ",groupCheckedTooManyStart:"من فضلك اختر بحد أقصى ",groupCheckedEnd:" مرات",badCreditCard:"رقم بطاقة ائتمانية خاطىء",badCVV:"رمز الأمان خاطئ",wrongFileDim:"حدود الصورة غير صالحة",imageTooTall:"الصورة يمكن أن تكون أطول من",imageTooWide:"الصورة يمكن أن تكون أعرض من",imageTooSmall:"صورة صغيرة جداً",min:"أدنى",max:"أقصى",imageRatioNotAccepted:"أبعاد صورة غير مقبولة",badBrazilTelephoneAnswer:"رقم هاتف مدخل خاطىء",badBrazilCEPAnswer:"قيمة CEP المدخلة غير صحيحة",badBrazilCPFAnswer:"قيمة CPF المدخلة غير صحيحة",badPlPesel:"قيمة Pl PESEL المدخلة غير صحيحة",badPlNip:"قيمة Pl NIP المدخلة غير صحيحة",badPlRegon:"قيمة Pl REGON المدخلة غير صحيحة",badreCaptcha:"من فضلك أكد أنك لست روبوتاً",passwordComplexityStart:"كملة المرور تتكون على الأقل من ",passwordComplexitySeparator:", ",passwordComplexityUppercaseInfo:" حروف كبيرة",passwordComplexityLowercaseInfo:" حروف صغيرة",passwordComplexitySpecialCharsInfo:" رموز خاصة",passwordComplexityNumericCharsInfo:" أرقام",passwordComplexityEnd:"."}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/ca.js b/form-validator/lang/ca.js index 1ce45a4..5e92f50 100644 --- a/form-validator/lang/ca.js +++ b/form-validator/lang/ca.js @@ -1,82 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Catalan language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/ca'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'El formulari no s\'ha pogut enviar!', - requiredField: 'Aquest camp és obligatori', - requiredFields: 'No ha contestat tots els camps requerits', - badTime: 'L\'hora proporcionada no és vàlida', - badEmail: 'La direcció d\'e-mail no és vàlida', - badTelephone: 'El número de telèfon proporcionat no és vàlid', - badSecurityAnswer: 'La resposta a la seva pregunta de seguretat és incorrecte', - badDate: 'La data proporcionada no és vàlida', - lengthBadStart: 'La seva resposta s\'ha d\'incloure entre ', - lengthBadEnd: ' caràcters', - lengthTooLongStart: 'La seva resposta ha de ser menor a ', - lengthTooShortStart: 'La seva resposta ha de ser major a ', - notConfirmed: 'Els valors proporcionats no poden ser confirmats', - badDomain: 'Ha introduït un domini incorrecte', - badUrl: 'La URL proporcionada no és vàlida', - badCustomVal: 'Els valors proporcionats no són vàlids', - andSpaces: ' i espais ', - badInt: 'El valor proporcionat no és un número vàlid', - badSecurityNumber: 'El número de seguretat social proporcionat és incorrecte', - badUKVatAnswer: 'El número VAT proporcionat no és vàlid pel Regne Unit', - badStrength: 'La contrasenya proporcionada no és suficientment segura', - badNumberOfSelectedOptionsStart: 'Ha de seleccionar almenys', - badNumberOfSelectedOptionsEnd: ' resposta(es)', - badAlphaNumeric: 'El valor proporcionat només ha de contenir caràcters alfanumèrics (a-z i números)', - badAlphaNumericExtra: ' i', - wrongFileSize: 'L\'arxiu que està tractant de pujar és massa gran (màx. %s)', - wrongFileType: 'Només els arxius de tipus %s estan permesos', - groupCheckedRangeStart: 'Si us plau, triï entre ', - groupCheckedTooFewStart: 'Si us plau, triï almenys ', - groupCheckedTooManyStart: 'Si us plau, triï un màxim de ', - groupCheckedEnd: ' element(s)', - badCreditCard: 'El número de targeta de crèdit proporcionat no és vàlid', - badCVV: 'CVV proporcionat no és vàlid', - wrongFileDim: 'Les dimensions de la imatge no són vàlides,', - imageTooTall: 'l\'alçada de la imatge no pot ser major a', - imageTooWide: 'l\'amplada de la imatge no pot ser major a', - imageTooSmall: 'la imatge és massa petita', - min: 'min.', - max: 'màx.', - imageRatioNotAccepted : 'La proporció de la imatge (alçada x amplada) no és vàlida' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/ca"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"El formulari no s'ha pogut enviar!",requiredField:"Aquest camp és obligatori",requiredFields:"No ha contestat tots els camps requerits",badTime:"L'hora proporcionada no és vàlida",badEmail:"La direcció d'e-mail no és vàlida",badTelephone:"El número de telèfon proporcionat no és vàlid",badSecurityAnswer:"La resposta a la seva pregunta de seguretat és incorrecte",badDate:"La data proporcionada no és vàlida",lengthBadStart:"La seva resposta s'ha d'incloure entre ",lengthBadEnd:" caràcters",lengthTooLongStart:"La seva resposta ha de ser menor a ",lengthTooShortStart:"La seva resposta ha de ser major a ",notConfirmed:"Els valors proporcionats no poden ser confirmats",badDomain:"Ha introduït un domini incorrecte",badUrl:"La URL proporcionada no és vàlida",badCustomVal:"Els valors proporcionats no són vàlids",andSpaces:" i espais ",badInt:"El valor proporcionat no és un número vàlid",badSecurityNumber:"El número de seguretat social proporcionat és incorrecte",badUKVatAnswer:"El número VAT proporcionat no és vàlid pel Regne Unit",badStrength:"La contrasenya proporcionada no és suficientment segura",badNumberOfSelectedOptionsStart:"Ha de seleccionar almenys",badNumberOfSelectedOptionsEnd:" resposta(es)",badAlphaNumeric:"El valor proporcionat només ha de contenir caràcters alfanumèrics (a-z i números)",badAlphaNumericExtra:" i",wrongFileSize:"L'arxiu que està tractant de pujar és massa gran (màx. %s)",wrongFileType:"Només els arxius de tipus %s estan permesos",groupCheckedRangeStart:"Si us plau, triï entre ",groupCheckedTooFewStart:"Si us plau, triï almenys ",groupCheckedTooManyStart:"Si us plau, triï un màxim de ",groupCheckedEnd:" element(s)",badCreditCard:"El número de targeta de crèdit proporcionat no és vàlid",badCVV:"CVV proporcionat no és vàlid",wrongFileDim:"Les dimensions de la imatge no són vàlides,",imageTooTall:"l'alçada de la imatge no pot ser major a",imageTooWide:"l'amplada de la imatge no pot ser major a",imageTooSmall:"la imatge és massa petita",min:"min.",max:"màx.",imageRatioNotAccepted:"La proporció de la imatge (alçada x amplada) no és vàlida"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/cs.js b/form-validator/lang/cs.js index 3ff61d8..b6247ce 100644 --- a/form-validator/lang/cs.js +++ b/form-validator/lang/cs.js @@ -1,85 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Czech language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/cs'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'Podání formuláře selhalo!', - requiredField: 'Toto pole je povinné', - requiredfields: 'Nebyly vyplněny všechny požadované pole', - badTime: 'Neplatný čas', - badEmail: 'Neplatná e-mailová adresa', - badTelephone: 'Neplatné telefonní číslo', - badSecurityAnswer: 'Chybná odpověď na bezpečnostní otázku', - badDate: 'Nesprávné datum', - lengthBadStart: 'Zadaná hodnota musí být v rozmezí ', - lengthBadEnd: ' znaků', - lengthTooLongStart: 'Zadaná hodnota je větší než ', - lengthTooShortStart: 'Zadaná hodnota je menší než ', - notConfirmed: 'Zadané hodnoty nebyly potvrzené', - badDomain: 'Neplatná doména', - badUrl: 'Neplatný URL', - badCustomVal: 'Zadaná hodnota je chybná', - andSpaces: ' a mezery', - badInt: 'Neplatné číslo', - badSecurityNumber: 'Neplatné číslo zabezpečení', - badUKVatAnswer: 'Neplatné číslo DIČ ', - badStrength: 'Vaše heslo není dostatečně silné', - badNumberOfSelectedOptionsStart: 'Musíte vybrat nejméně ', - badNumberOfSelectedOptionsEnd: ' odpověď', - badAlphaNumeric: 'Zadaná hodnota může obsahovat pouze alfanumerické znaky ', - badAlphaNumericExtra: ' a ', - wrongFileSize: 'Soubor je příliš velký (max %s)', - wrongFileType: 'Pouze soubory typu %s', - groupCheckedRangeStart: 'Prosím, vyberte ', - groupCheckedTooFewStart: 'Vyberte prosím nejméně ', - groupCheckedTooManyStart: 'Vyberte prosím maximálně ', - groupCheckedEnd: ' složka(y)', - badCreditCard: 'Číslo kreditní karty je neplatné', - badCVV: 'Číslo CVV je neplatné', - wrongFileDim: 'Nesprávné rozměry obrázku,', - imageTooTall: 'obraz nemůže být vyšší než', - imageTooWide: 'obraz nemůže být širší než', - imageTooSmall: 'obraz je příliš malý', - min: 'min', - max: 'max', - imageRatioNotAccepted: 'Poměr obrázku je nesprávný', - badBrazilTelephoneAnswer: 'Neplatné telefonní číslo', - badBrazilCEPAnswer: 'Neplatné CEP', - badBrazilCPFAnswer: 'Neplatné CPF' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/cs"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Podání formuláře selhalo!",requiredField:"Toto pole je povinné",requiredfields:"Nebyly vyplněny všechny požadované pole",badTime:"Neplatný čas",badEmail:"Neplatná e-mailová adresa",badTelephone:"Neplatné telefonní číslo",badSecurityAnswer:"Chybná odpověď na bezpečnostní otázku",badDate:"Nesprávné datum",lengthBadStart:"Zadaná hodnota musí být v rozmezí ",lengthBadEnd:" znaků",lengthTooLongStart:"Zadaná hodnota je větší než ",lengthTooShortStart:"Zadaná hodnota je menší než ",notConfirmed:"Zadané hodnoty nebyly potvrzené",badDomain:"Neplatná doména",badUrl:"Neplatný URL",badCustomVal:"Zadaná hodnota je chybná",andSpaces:" a mezery",badInt:"Neplatné číslo",badSecurityNumber:"Neplatné číslo zabezpečení",badUKVatAnswer:"Neplatné číslo DIČ ",badStrength:"Vaše heslo není dostatečně silné",badNumberOfSelectedOptionsStart:"Musíte vybrat nejméně ",badNumberOfSelectedOptionsEnd:" odpověď",badAlphaNumeric:"Zadaná hodnota může obsahovat pouze alfanumerické znaky ",badAlphaNumericExtra:" a ",wrongFileSize:"Soubor je příliš velký (max %s)",wrongFileType:"Pouze soubory typu %s",groupCheckedRangeStart:"Prosím, vyberte ",groupCheckedTooFewStart:"Vyberte prosím nejméně ",groupCheckedTooManyStart:"Vyberte prosím maximálně ",groupCheckedEnd:" složka(y)",badCreditCard:"Číslo kreditní karty je neplatné",badCVV:"Číslo CVV je neplatné",wrongFileDim:"Nesprávné rozměry obrázku,",imageTooTall:"obraz nemůže být vyšší než",imageTooWide:"obraz nemůže být širší než",imageTooSmall:"obraz je příliš malý",min:"min",max:"max",imageRatioNotAccepted:"Poměr obrázku je nesprávný",badBrazilTelephoneAnswer:"Neplatné telefonní číslo",badBrazilCEPAnswer:"Neplatné CEP",badBrazilCPFAnswer:"Neplatné CPF"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/da.js b/form-validator/lang/da.js index f07b170..f0365b7 100644 --- a/form-validator/lang/da.js +++ b/form-validator/lang/da.js @@ -1,85 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Danish language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/da'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - andSpaces: ' og mellemrum ', - badAlphaNumeric: 'Det indtastede kan kun indeholde alfanumeriske karakter ', - badAlphaNumericExtra: ' og ', - badCVV: 'Det angivne CVV nummer er ugyldigt', - badCreditCard:'Det angivne kortnummer er ugyldigt', - badCustomVal: 'Den indtastede værdi er ugyldig', - badDate: 'Den angivne dato er ugyldig', - badDomain: 'Det angivne domæne er ugyldigt', - badEmail: 'Den angivne email adresse er ugyldig', - badInt: 'Det angivne tal er ugyldigt', - badNumberOfSelectedOptionsEnd: ' svar', - badNumberOfSelectedOptionsStart: 'Du skal vælge mindst ', - badSecurityAnswer: 'Du har ikke angivet et korrekt svar til sikkerhedsspørgsmålet', - badSecurityNumber: 'Dit CPR nummer er ikke korrekt', - badStrength: 'Det angivne password er ikke stærkt nok', - badTelephone: 'Det angivne telefonnummer er ugyldigt', - badTime: 'Det angivne tidspunkt er ugyldigt', - badUrl: 'Den angivne URL er ugyldig', - badreCaptcha: 'Verificer venligst at du ikke er en bot', - errorTitle: 'Formular forespørgslen fejlede!', - groupCheckedEnd: ' ting', - groupCheckedRangeStart: 'Vælg venligst mellem ', - groupCheckedTooFewStart: 'Vælg mindst ', - groupCheckedTooManyStart: 'Vælg højst ', - imageRatioNotAccepted: 'Billedets dimensioner er ikke acceptable', - imageTooSmall: 'Billedet er for lille', - imageTooTall: 'Billedet må ikke være højere end', - imageTooWide: 'Billedet må ikke være bredere end', - lengthBadEnd: ' tegn', - lengthBadStart: 'Feltets værdi skal være mellem ', - lengthTooLongStart: 'Feltets værdi må ikke være længere end ', - lengthTooShortStart: 'Feltets værdi må ikke være kortere end ', - max: 'max', - min: 'min', - notConfirmed: 'Feltværdierne kunne ikke bekræftes', - requiredField: 'Dette felt er påkrævet', - requiredFields: 'Du har ikke udfyldt alle påkrævede felter', - wrongFileDim: 'Forkerte billede dimensioner,', - wrongFileSize: 'Filen du forsøger at uploade er for stor (max %s)', - wrongFileType: 'Udelukkende filer at følgedne type er tilladt %s' - }; - - }); - -})(jQuery, window); - - - - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/da"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={andSpaces:" og mellemrum ",badAlphaNumeric:"Det indtastede kan kun indeholde alfanumeriske karakter ",badAlphaNumericExtra:" og ",badCVV:"Det angivne CVV nummer er ugyldigt",badCreditCard:"Det angivne kortnummer er ugyldigt",badCustomVal:"Den indtastede værdi er ugyldig",badDate:"Den angivne dato er ugyldig",badDomain:"Det angivne domæne er ugyldigt",badEmail:"Den angivne email adresse er ugyldig",badInt:"Det angivne tal er ugyldigt",badNumberOfSelectedOptionsEnd:" svar",badNumberOfSelectedOptionsStart:"Du skal vælge mindst ",badSecurityAnswer:"Du har ikke angivet et korrekt svar til sikkerhedsspørgsmålet",badSecurityNumber:"Dit CPR nummer er ikke korrekt",badStrength:"Det angivne password er ikke stærkt nok",badTelephone:"Det angivne telefonnummer er ugyldigt",badTime:"Det angivne tidspunkt er ugyldigt",badUrl:"Den angivne URL er ugyldig",badreCaptcha:"Verificer venligst at du ikke er en bot",errorTitle:"Formular forespørgslen fejlede!",groupCheckedEnd:" ting",groupCheckedRangeStart:"Vælg venligst mellem ",groupCheckedTooFewStart:"Vælg mindst ",groupCheckedTooManyStart:"Vælg højst ",imageRatioNotAccepted:"Billedets dimensioner er ikke acceptable",imageTooSmall:"Billedet er for lille",imageTooTall:"Billedet må ikke være højere end",imageTooWide:"Billedet må ikke være bredere end",lengthBadEnd:" tegn",lengthBadStart:"Feltets værdi skal være mellem ",lengthTooLongStart:"Feltets værdi må ikke være længere end ",lengthTooShortStart:"Feltets værdi må ikke være kortere end ",max:"max",min:"min",notConfirmed:"Feltværdierne kunne ikke bekræftes",requiredField:"Dette felt er påkrævet",requiredFields:"Du har ikke udfyldt alle påkrævede felter",wrongFileDim:"Forkerte billede dimensioner,",wrongFileSize:"Filen du forsøger at uploade er for stor (max %s)",wrongFileType:"Udelukkende filer at følgedne type er tilladt %s"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/de.js b/form-validator/lang/de.js index 3123968..1196abf 100644 --- a/form-validator/lang/de.js +++ b/form-validator/lang/de.js @@ -1,85 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * German language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/de'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'Ihre Anfrage konnte nicht gesendet werden!', - requiredField: 'Dies ist ein Pflichtfeld', - requiredFields: 'Sie haben nicht alle Fragen beantwortet', - badTime: 'Sie haben nicht die korrekte Zeit eingegeben', - badEmail: 'Sie haben keine gültige E-Mail-Adresse eingegeben', - badTelephone: 'Sie haben keine richtige Telefonnummer eingetragen', - badSecurityAnswer: 'Sie haben die falsche Antwort auf die Sicherheitsfrage eingegeben', - badDate: 'Eingabe eines falschen Datums', - lengthBadStart: 'Der eingegebene Wert muss dazwischen sein ', - lengthBadEnd: '  Zeichen', - lengthTooLongStart: 'Der eingegebene Wert ist größer als ', - lengthTooShortStart: 'Der eingegebene Wert ist kleiner als ', - notConfirmed: 'Die Eingaben sind unterschiedlich', - badDomain: 'Sie haben die falsche Domäne eingetragen', - badUrl: 'Sie haben nicht die richtige URL eingegeben', - badCustomVal: 'Eingabe einer falschen Antwort', - andSpaces: ' und Leerzeichen', - badInt: 'Sie haben keine Nummer eingegeben', - badSecurityNumber: 'Sie haben eine falsche Sozialversicherungsnummer eingegeben', - badUKVatAnswer: 'Sie haben keine UK-Umsatzsteuer-Identifikationsnummer eingegeben', - badStrength: 'Sie haben ein Kennwort, das nicht sicher genug ist eingegeben', - badNumberOfSelectedOptionsStart: 'Wählen Sie zu mindestens ', - badNumberOfSelectedOptionsEnd: ' Antwort', - badAlphaNumeric: 'Sie können nur alphanumerische Zeichen (Buchstaben und Zahlen) eingeben', - badAlphaNumericExtra: ' und', - wrongFileSize: 'Die Datei, die Sie hochzuladen versuchen, ist zu groß (max %s)', - wrongFileType: 'Nur Dateien vom Typ %s sind zulässig', - groupCheckedRangeStart: 'Wählen Sie zwischen', - groupCheckedTooFewStart: 'Dann müssen Sie zumindest sicher,', - groupCheckedTooManyStart: 'Sie können nicht mehr als zu machen', - groupCheckedEnd: ' Auswahl', - badCreditCard: 'Sie haben eine ungültige Kreditkartennummer eingegeben', - badCVV: 'Sie haben eine falsche CVV eingegeben', - wrongFileDim: 'Illegale Bildgröße,', - imageTooTall: 'Bild kann nicht größer sein als', - imageTooWide: 'Bild kann nicht breiter sein als', - imageTooSmall: 'Bild ist zu klein', - min: 'min', - max: 'max', - imageRatioNotAccepted : 'Bildverhältnis wird nicht akzeptiert', - badBrazilTelephoneAnswer: 'Die eingegebene Telefonnummer ist nicht korrekt', - badBrazilCEPAnswer: 'Der CEP ist ungültig', - badBrazilCPFAnswer: 'Der CEP ist ungültig' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/de"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Ihre Anfrage konnte nicht gesendet werden!",requiredField:"Dies ist ein Pflichtfeld",requiredFields:"Sie haben nicht alle Fragen beantwortet",badTime:"Sie haben nicht die korrekte Zeit eingegeben",badEmail:"Sie haben keine gültige E-Mail-Adresse eingegeben",badTelephone:"Sie haben keine richtige Telefonnummer eingetragen",badSecurityAnswer:"Sie haben die falsche Antwort auf die Sicherheitsfrage eingegeben",badDate:"Eingabe eines falschen Datums",lengthBadStart:"Der eingegebene Wert muss dazwischen sein ",lengthBadEnd:"  Zeichen",lengthTooLongStart:"Der eingegebene Wert ist größer als ",lengthTooShortStart:"Der eingegebene Wert ist kleiner als ",notConfirmed:"Die Eingaben sind unterschiedlich",badDomain:"Sie haben die falsche Domäne eingetragen",badUrl:"Sie haben nicht die richtige URL eingegeben",badCustomVal:"Eingabe einer falschen Antwort",andSpaces:" und Leerzeichen",badInt:"Sie haben keine Nummer eingegeben",badSecurityNumber:"Sie haben eine falsche Sozialversicherungsnummer eingegeben",badUKVatAnswer:"Sie haben keine UK-Umsatzsteuer-Identifikationsnummer eingegeben",badStrength:"Sie haben ein Kennwort, das nicht sicher genug ist eingegeben",badNumberOfSelectedOptionsStart:"Wählen Sie zu mindestens ",badNumberOfSelectedOptionsEnd:" Antwort",badAlphaNumeric:"Sie können nur alphanumerische Zeichen (Buchstaben und Zahlen) eingeben",badAlphaNumericExtra:" und",wrongFileSize:"Die Datei, die Sie hochzuladen versuchen, ist zu groß (max %s)",wrongFileType:"Nur Dateien vom Typ %s sind zulässig",groupCheckedRangeStart:"Wählen Sie zwischen",groupCheckedTooFewStart:"Dann müssen Sie zumindest sicher,",groupCheckedTooManyStart:"Sie können nicht mehr als zu machen",groupCheckedEnd:" Auswahl",badCreditCard:"Sie haben eine ungültige Kreditkartennummer eingegeben",badCVV:"Sie haben eine falsche CVV eingegeben",wrongFileDim:"Illegale Bildgröße,",imageTooTall:"Bild kann nicht größer sein als",imageTooWide:"Bild kann nicht breiter sein als",imageTooSmall:"Bild ist zu klein",min:"min",max:"max",imageRatioNotAccepted:"Bildverhältnis wird nicht akzeptiert",badBrazilTelephoneAnswer:"Die eingegebene Telefonnummer ist nicht korrekt",badBrazilCEPAnswer:"Der CEP ist ungültig",badBrazilCPFAnswer:"Der CEP ist ungültig"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/es.js b/form-validator/lang/es.js index ed6535d..ebfa545 100644 --- a/form-validator/lang/es.js +++ b/form-validator/lang/es.js @@ -1,89 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Spanish language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/es'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'El formulario no se ha podido enviar!', - requiredField: 'Este campo es obligatorio', - requiredFields: 'No ha contestado todos los campos requeridos', - badTime: 'La hora proporcionada no es válida', - badEmail: 'La dirección de e-mail no es válida', - badTelephone: 'El número de teléfono proporcionado no es válido', - badSecurityAnswer: 'La respuesta a su pregunta de seguridad es incorrecta', - badDate: 'La fecha proporcionada no es válida', - lengthBadStart: 'Su respuesta debe incluir entre ', - lengthBadEnd: ' caracteres', - lengthTooLongStart: 'Su respuesta debe de ser menor a ', - lengthTooShortStart: 'Su respuesta debe de ser mayor a ', - notConfirmed: 'Los valores proporcionados no pudieron ser confirmados', - badDomain: 'Ha introducido un dominio incorrecto', - badUrl: 'La URL proporcionada no es válida', - badCustomVal: 'Los valores proporcionados no son válidos', - andSpaces: ' y espacios ', - badInt: 'El valor proporcionado no es un número válido', - badSecurityNumber: 'El número de seguridad social proporcionado es incorrecto', - badUKVatAnswer: 'El número VAT proporcionado no es válido para el Reino Unido', - badStrength: 'La contraseña proporcionada no es lo suficientemente segura', - badNumberOfSelectedOptionsStart: 'Debe seleccionar al menos', - badNumberOfSelectedOptionsEnd: ' respuesta(s)', - badAlphaNumeric: 'El valor proporcionado solo debe contener caracteres alfanuméricos (a-z y números)', - badAlphaNumericExtra: ' y', - wrongFileSize: 'El archivo que está tratando de subir es demasiado grande (máx. %s)', - wrongFileType: 'Sólo los archivos del tipo %s están permitido', - groupCheckedRangeStart: 'Por favor, elija entre ', - groupCheckedTooFewStart: 'Por favor, elija al menos ', - groupCheckedTooManyStart: 'Por favor, elija un máximo de ', - groupCheckedEnd: ' ítem(s)', - badCreditCard: 'El número de tarjeta de crédito proporcionado no es válido', - badCVV: 'CVV proporcionado no es válido', - wrongFileDim: 'Las dimensiones de la imagen no son validas,', - imageTooTall: 'el alto de la imagen no puede ser mayor a', - imageTooWide: 'el ancho de la imagen no puede ser mayor a', - imageTooSmall: 'la imagen es demasiado pequeña', - min: 'min.', - max: 'máx.', - imageRatioNotAccepted : 'La proporción de imagen (alto x ancho) no es válida', - passwordComplexityStart: 'La contraseña debe contener al menos ', - passwordComplexitySeparator: ', ', - passwordComplexityUppercaseInfo: ' mayúscula(s)', - passwordComplexityLowercaseInfo: ' minúscula(s)', - passwordComplexitySpecialCharsInfo: ' caracter(es) especial(es)', - passwordComplexityNumericCharsInfo: ' número(s)', - passwordComplexityEnd: '.' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/es"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"El formulario no se ha podido enviar!",requiredField:"Este campo es obligatorio",requiredFields:"No ha contestado todos los campos requeridos",badTime:"La hora proporcionada no es válida",badEmail:"La dirección de e-mail no es válida",badTelephone:"El número de teléfono proporcionado no es válido",badSecurityAnswer:"La respuesta a su pregunta de seguridad es incorrecta",badDate:"La fecha proporcionada no es válida",lengthBadStart:"Su respuesta debe incluir entre ",lengthBadEnd:" caracteres",lengthTooLongStart:"Su respuesta debe de ser menor a ",lengthTooShortStart:"Su respuesta debe de ser mayor a ",notConfirmed:"Los valores proporcionados no pudieron ser confirmados",badDomain:"Ha introducido un dominio incorrecto",badUrl:"La URL proporcionada no es válida",badCustomVal:"Los valores proporcionados no son válidos",andSpaces:" y espacios ",badInt:"El valor proporcionado no es un número válido",badSecurityNumber:"El número de seguridad social proporcionado es incorrecto",badUKVatAnswer:"El número VAT proporcionado no es válido para el Reino Unido",badStrength:"La contraseña proporcionada no es lo suficientemente segura",badNumberOfSelectedOptionsStart:"Debe seleccionar al menos",badNumberOfSelectedOptionsEnd:" respuesta(s)",badAlphaNumeric:"El valor proporcionado solo debe contener caracteres alfanuméricos (a-z y números)",badAlphaNumericExtra:" y",wrongFileSize:"El archivo que está tratando de subir es demasiado grande (máx. %s)",wrongFileType:"Sólo los archivos del tipo %s están permitido",groupCheckedRangeStart:"Por favor, elija entre ",groupCheckedTooFewStart:"Por favor, elija al menos ",groupCheckedTooManyStart:"Por favor, elija un máximo de ",groupCheckedEnd:" ítem(s)",badCreditCard:"El número de tarjeta de crédito proporcionado no es válido",badCVV:"CVV proporcionado no es válido",wrongFileDim:"Las dimensiones de la imagen no son validas,",imageTooTall:"el alto de la imagen no puede ser mayor a",imageTooWide:"el ancho de la imagen no puede ser mayor a",imageTooSmall:"la imagen es demasiado pequeña",min:"min.",max:"máx.",imageRatioNotAccepted:"La proporción de imagen (alto x ancho) no es válida",passwordComplexityStart:"La contraseña debe contener al menos ",passwordComplexitySeparator:", ",passwordComplexityUppercaseInfo:" mayúscula(s)",passwordComplexityLowercaseInfo:" minúscula(s)",passwordComplexitySpecialCharsInfo:" caracter(es) especial(es)",passwordComplexityNumericCharsInfo:" número(s)",passwordComplexityEnd:"."}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/fa.js b/form-validator/lang/fa.js index 267faee..e973dd5 100644 --- a/form-validator/lang/fa.js +++ b/form-validator/lang/fa.js @@ -1,84 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/* jshint -W100 */ -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Farsi language package - * - * @website http://formvalidator.net/ - * @license MIT - * @version 0.0.1 + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/fa'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'ثبت فرم با مشکل مواجه شد!', - requiredField: 'شما همه فیلدهای ضروری را تکمیل نکرده اید', - requiredFields: 'شما فیلد ضروری را تکمیل نکرده اید', - badTime: 'زمان درستی را وارد نکرده اید', - badEmail: 'آدرس ایمیل را به درستی وارد نکرده اید', - badTelephone: 'شماره تلفن وارد شده معتبر نیست', - badSecurityAnswer: 'شما به سوال امنیتی درست پاسخ نداده اید', - badDate: 'تاریخ درستی را وارد نکرده اید', - lengthBadStart: 'مقدار وارد شده باید ', - lengthBadEnd: ' حرف باشد.', - lengthTooLongStart: 'مقدار ورودی بیشتر از ', - lengthTooShortStart: 'مقدار ورودی کمتر از ', - notConfirmed: 'ورودی ها یکسان نیستند', - badDomain: 'آدرس دامنه به درستی وارد نشده است', - badUrl: 'آدرس اینترنتی به درستی وارد نشده است', - badCustomVal: 'مقدار ورودی نادرست است', - andSpaces: ' و فاصله خالی ', - badInt: 'مقدار ورودی باید عدد باشد', - badSecurityNumber: 'شماره امنیت اجتماعی شما معتبر نیست', - badUKVatAnswer: 'شماره مالیاتی شما درست نیست', - badStrength: 'کلمه عبور به قدر کافی مستحکم نیست', - badNumberOfSelectedOptionsStart: 'شما باید حداقل ', - badNumberOfSelectedOptionsEnd: ' پاسخ را انتخاب کنید', - badAlphaNumeric: 'مقدار ورودی می تواند حروف و شماره باشد ', - badAlphaNumericExtra: ' و ', - wrongFileSize: 'حجم فایل انتخابی زیاد است. (حداکثر %s)', - wrongFileType: 'فقط فایل های با فرمت %s مجاز هستند', - groupCheckedRangeStart: 'لطفا بین ', - groupCheckedTooFewStart: 'لطفا حداقل ', - groupCheckedTooManyStart: 'لطفا حداکثر ', - groupCheckedEnd: ' گزینه انتخاب کنید', - badCreditCard: 'شماره کارت اعتباری معتبر نیست', - badCVV: 'کد شناسایی سی وی وی معتبر نیست', - wrongFileDim : 'ابعاد تصویر صحیح نیست,', - imageTooTall : 'حداکثر طول تصویر', - imageTooWide : 'حداکثر عرض تصویر', - imageTooSmall : 'تصویر خیلی کوچک است', - min : 'حداقل', - max : 'حداکثر', - imageRatioNotAccepted : 'نسبت ابعاد تصویر مناسب نیست' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/fa"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"ثبت فرم با مشکل مواجه شد!",requiredField:"شما همه فیلدهای ضروری را تکمیل نکرده اید",requiredFields:"شما فیلد ضروری را تکمیل نکرده اید",badTime:"زمان درستی را وارد نکرده اید",badEmail:"آدرس ایمیل را به درستی وارد نکرده اید",badTelephone:"شماره تلفن وارد شده معتبر نیست",badSecurityAnswer:"شما به سوال امنیتی درست پاسخ نداده اید",badDate:"تاریخ درستی را وارد نکرده اید",lengthBadStart:"مقدار وارد شده باید ",lengthBadEnd:" حرف باشد.",lengthTooLongStart:"مقدار ورودی بیشتر از ",lengthTooShortStart:"مقدار ورودی کمتر از ",notConfirmed:"ورودی ها یکسان نیستند",badDomain:"آدرس دامنه به درستی وارد نشده است",badUrl:"آدرس اینترنتی به درستی وارد نشده است",badCustomVal:"مقدار ورودی نادرست است",andSpaces:" و فاصله خالی ",badInt:"مقدار ورودی باید عدد باشد",badSecurityNumber:"شماره امنیت اجتماعی شما معتبر نیست",badUKVatAnswer:"شماره مالیاتی شما درست نیست",badStrength:"کلمه عبور به قدر کافی مستحکم نیست",badNumberOfSelectedOptionsStart:"شما باید حداقل ",badNumberOfSelectedOptionsEnd:" پاسخ را انتخاب کنید",badAlphaNumeric:"مقدار ورودی می تواند حروف و شماره باشد ",badAlphaNumericExtra:" و ",wrongFileSize:"حجم فایل انتخابی زیاد است. (حداکثر %s)",wrongFileType:"فقط فایل های با فرمت %s مجاز هستند",groupCheckedRangeStart:"لطفا بین ",groupCheckedTooFewStart:"لطفا حداقل ",groupCheckedTooManyStart:"لطفا حداکثر ",groupCheckedEnd:" گزینه انتخاب کنید",badCreditCard:"شماره کارت اعتباری معتبر نیست",badCVV:"کد شناسایی سی وی وی معتبر نیست",wrongFileDim:"ابعاد تصویر صحیح نیست,",imageTooTall:"حداکثر طول تصویر",imageTooWide:"حداکثر عرض تصویر",imageTooSmall:"تصویر خیلی کوچک است",min:"حداقل",max:"حداکثر",imageRatioNotAccepted:"نسبت ابعاد تصویر مناسب نیست"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/fr.js b/form-validator/lang/fr.js index 2ad20ca..1526584 100644 --- a/form-validator/lang/fr.js +++ b/form-validator/lang/fr.js @@ -1,82 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * French language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/fr'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'Le formulaire n\'a pas pu être envoyé!', - requiredField: 'Ce champ est obligatoire', - requiredFields: 'Vous n\'avez pas rempli tous les champs', - badTime: 'Vous n\'avez pas saisi l\'heure correctement', - badEmail: 'Vous n\'avez pas saisi une adresse e-mail valide', - badTelephone: 'Vous n\'avez pas saisi un numéro de téléphone valide', - badSecurityAnswer: 'Vous avez saisi une mauvaise réponse à la question de sécurité', - badDate: 'Vous n\'avez pas saisi une date correcte', - lengthBadStart: 'Votre saisie doit comporter entre ', - lengthBadEnd: ' caractères', - lengthTooLongStart: 'Vous avez saisi une réponse qui est plus longue que ', - lengthTooShortStart: 'Votre saisie est plus courte que ', - notConfirmed: 'Les saisies ne sont pas identiques', - badDomain: 'Vous avez saisi un domaine incorrect', - badUrl: 'Vous avez saisi une URL incorrecte', - badCustomVal: 'Re-saisissez une réponse correcte', - andSpaces: ' et des espaces ', - badInt: 'Vous n\'avez pas saisi un numéro', - badSecurityNumber: 'Vous avez saisi un mauvais numéro de sécurité sociale', - badUKVatAnswer: 'Vous n\'avez pas saisi un numéro de TVA au Royaume-Uni', - badStrength: 'Vous avez saisi un mot de passe pas assez sécurisé', - badNumberOfSelectedOptionsStart: 'Vous devez sélectionner au moins ', - badNumberOfSelectedOptionsEnd: ' réponse(s)', - badAlphaNumeric: 'Vous ne pouvez répondre qu\'avec des caractères alphanumériques et des chiffres ', - badAlphaNumericExtra: ' et ', - wrongFileSize: 'Le fichier que vous essayez de télécharger est trop grand (max %s)', - wrongFileType: 'Seuls les fichiers du type %s sont autorisés', - groupCheckedRangeStart: 'Choisissez entre ', - groupCheckedTooFewStart: 'Vous devez faire au moins ', - groupCheckedTooManyStart: 'Vous ne pouvez pas faire plus de ', - groupCheckedEnd: ' sélection(s)', - badCreditCard: 'Vous avez saisi un numéro de carte de crédit invalide', - badCVV: 'Vous avez saisi un CVV incorrect', - wrongFileDim: 'Mauvaise taille de l\'image, ', - imageTooTall: 'l\'image ne peut pas être plus élevée que', - imageTooWide: 'l\'image ne peut pas être plus large que', - imageTooSmall: 'l\'image est trop petite', - min: 'moins', - max: 'max', - imageRatioNotAccepted: 'Ratio de l\'image non accepté' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/fr"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Le formulaire n'a pas pu être envoyé!",requiredField:"Ce champ est obligatoire",requiredFields:"Vous n'avez pas rempli tous les champs",badTime:"Vous n'avez pas saisi l'heure correctement",badEmail:"Vous n'avez pas saisi une adresse e-mail valide",badTelephone:"Vous n'avez pas saisi un numéro de téléphone valide",badSecurityAnswer:"Vous avez saisi une mauvaise réponse à la question de sécurité",badDate:"Vous n'avez pas saisi une date correcte",lengthBadStart:"Votre saisie doit comporter entre ",lengthBadEnd:" caractères",lengthTooLongStart:"Vous avez saisi une réponse qui est plus longue que ",lengthTooShortStart:"Votre saisie est plus courte que ",notConfirmed:"Les saisies ne sont pas identiques",badDomain:"Vous avez saisi un domaine incorrect",badUrl:"Vous avez saisi une URL incorrecte",badCustomVal:"Re-saisissez une réponse correcte",andSpaces:" et des espaces ",badInt:"Vous n'avez pas saisi un numéro",badSecurityNumber:"Vous avez saisi un mauvais numéro de sécurité sociale",badUKVatAnswer:"Vous n'avez pas saisi un numéro de TVA au Royaume-Uni",badStrength:"Vous avez saisi un mot de passe pas assez sécurisé",badNumberOfSelectedOptionsStart:"Vous devez sélectionner au moins ",badNumberOfSelectedOptionsEnd:" réponse(s)",badAlphaNumeric:"Vous ne pouvez répondre qu'avec des caractères alphanumériques et des chiffres ",badAlphaNumericExtra:" et ",wrongFileSize:"Le fichier que vous essayez de télécharger est trop grand (max %s)",wrongFileType:"Seuls les fichiers du type %s sont autorisés",groupCheckedRangeStart:"Choisissez entre ",groupCheckedTooFewStart:"Vous devez faire au moins ",groupCheckedTooManyStart:"Vous ne pouvez pas faire plus de ",groupCheckedEnd:" sélection(s)",badCreditCard:"Vous avez saisi un numéro de carte de crédit invalide",badCVV:"Vous avez saisi un CVV incorrect",wrongFileDim:"Mauvaise taille de l'image, ",imageTooTall:"l'image ne peut pas être plus élevée que",imageTooWide:"l'image ne peut pas être plus large que",imageTooSmall:"l'image est trop petite",min:"moins",max:"max",imageRatioNotAccepted:"Ratio de l'image non accepté"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/it.js b/form-validator/lang/it.js index e21e0bd..76b83d5 100644 --- a/form-validator/lang/it.js +++ b/form-validator/lang/it.js @@ -1,82 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Italian language package - * - * @website http://formvalidator.net/ - * @license MIT - * @version 2.2.163 + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - 'use strict'; - - $.formUtils.registerLoadedModule('lang/it'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'Impossibile inviare il modulo!', - requiredField: 'Campo obbligatorio', - requiredFields: 'Non sono stati compilati tutti i campi richiesti', - badTime: 'L\'ora scelta non è valida', - badEmail: 'Questo indirizzo email non è valido', - badTelephone: 'Il numero di telefono imputato non è valido', - badSecurityAnswer: 'La risposta alla domanda di sicurezza è errata', - badDate: 'La data scelta non è valida', - lengthBadStart: 'La sua risposta non può essere più lunga di ', - lengthBadEnd: ' caratteri', - lengthTooLongStart: 'La lunghezza della risposta deve essere minore di ', - lengthTooShortStart: 'La lunghezza della risposta deve essere maggiore di ', - notConfirmed: 'Il valore non è stato confermato.', - badDomain: 'Il dominio inserito non è corretto.', - badUrl: 'L\' URL inserito non è valido', - badCustomVal: 'I valori inseriti non sono validi', - andSpaces: ' e spazi ', - badInt: 'Il numero inserito non è valido', - badSecurityNumber: 'Il numero di sicurezza inserito non è valido', - badUKVatAnswer: 'La Partita IVA (VAT) inserita non è valida nel Regno Unito', - badStrength: 'La password proposta non è sufficientemente sicura', - badNumberOfSelectedOptionsStart: 'Deve selezionare almeno', - badNumberOfSelectedOptionsEnd: ' risposta/e', - badAlphaNumeric: 'Il valore proposto deve contenere caratteri alfanumerici (a-z e 1234...)', - badAlphaNumericExtra: '', - wrongFileSize: 'Il file che si sta cercando di caricare è troppo grande (massimo %s)', - wrongFileType: 'Solo i file di tipo %s possono essere inviati', - groupCheckedRangeStart: 'Si prega di scegliere tra ', - groupCheckedTooFewStart: 'Si prega di selezionare un minimo di ', - groupCheckedTooManyStart: 'Si prega di selezionare un massimo di ', - groupCheckedEnd: ' opzione/i', - badCreditCard: 'Il numero di carta di credito non risulta valido', - badCVV: 'CVV non valido', - wrongFileDim: 'La dimensione dell\'immagine non è valida,', - imageTooTall: 'il lato alto dell\'immagine non può essere maggiore di', - imageTooWide: 'il lato lungo dell\'immagine non può essere maggiore di', - imageTooSmall: 'L\'immagine è troppo piccola', - min: 'min.', - max: 'máx.', - imageRatioNotAccepted : 'La proporzione dell\' immagine (altezza x larghezza) non è valida' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/it"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Impossibile inviare il modulo!",requiredField:"Campo obbligatorio",requiredFields:"Non sono stati compilati tutti i campi richiesti",badTime:"L'ora scelta non è valida",badEmail:"Questo indirizzo email non è valido",badTelephone:"Il numero di telefono imputato non è valido",badSecurityAnswer:"La risposta alla domanda di sicurezza è errata",badDate:"La data scelta non è valida",lengthBadStart:"La sua risposta non può essere più lunga di ",lengthBadEnd:" caratteri",lengthTooLongStart:"La lunghezza della risposta deve essere minore di ",lengthTooShortStart:"La lunghezza della risposta deve essere maggiore di ",notConfirmed:"Il valore non è stato confermato.",badDomain:"Il dominio inserito non è corretto.",badUrl:"L' URL inserito non è valido",badCustomVal:"I valori inseriti non sono validi",andSpaces:" e spazi ",badInt:"Il numero inserito non è valido",badSecurityNumber:"Il numero di sicurezza inserito non è valido",badUKVatAnswer:"La Partita IVA (VAT) inserita non è valida nel Regno Unito",badStrength:"La password proposta non è sufficientemente sicura",badNumberOfSelectedOptionsStart:"Deve selezionare almeno",badNumberOfSelectedOptionsEnd:" risposta/e",badAlphaNumeric:"Il valore proposto deve contenere caratteri alfanumerici (a-z e 1234...)",badAlphaNumericExtra:"",wrongFileSize:"Il file che si sta cercando di caricare è troppo grande (massimo %s)",wrongFileType:"Solo i file di tipo %s possono essere inviati",groupCheckedRangeStart:"Si prega di scegliere tra ",groupCheckedTooFewStart:"Si prega di selezionare un minimo di ",groupCheckedTooManyStart:"Si prega di selezionare un massimo di ",groupCheckedEnd:" opzione/i",badCreditCard:"Il numero di carta di credito non risulta valido",badCVV:"CVV non valido",wrongFileDim:"La dimensione dell'immagine non è valida,",imageTooTall:"il lato alto dell'immagine non può essere maggiore di",imageTooWide:"il lato lungo dell'immagine non può essere maggiore di",imageTooSmall:"L'immagine è troppo piccola",min:"min.",max:"máx.",imageRatioNotAccepted:"La proporzione dell' immagine (altezza x larghezza) non è valida"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/ka.js b/form-validator/lang/ka.js index bcf4233..0d88991 100644 --- a/form-validator/lang/ka.js +++ b/form-validator/lang/ka.js @@ -1,88 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Georgian language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/ka'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'ფორმა ვერ გაიგზავნა!', - requiredField: 'ველის შევსება სავალდებულოა', - requiredFields: 'თქვენ არ შეგივსიათ ყველა სავალდებულო ველი', - badTime: 'თქვენ მიუთითეთ არასწორი დრო', - badEmail: 'თქვენ მიუთითეთ არასწორი ელ.ფოსტის მისამართი', - badTelephone: 'თქვენ მიუთითეთ არასწორი ტელეფონის ნომერი', - badSecurityAnswer: 'თქვენ გაეცით არასწორი პასუხი უსაფრთხოების კითხვას', - badDate: 'თქვენ მიუთითეთ არასწორი თარიღი', - lengthBadStart: 'ველის მნიშვნელობის სიგრძე უნდა იყოს ', - lengthBadEnd: ' შუალედში', - lengthTooLongStart: 'ველის მნიშვნელობის სიგრძე უნდა იყოს მაქსიმუმ ', - lengthTooShortStart: 'ველის მნიშვნელობის სიგრძე უნდა იყოს მინიმუმ ', - notConfirmed: 'ველის მნიშვნელობები ვერ დადასტურდა', - badDomain: 'არასწორი დომენის მისამართი', - badUrl: 'ველის მნიშვნელობა არ არის მართებული URL მისამართი', - badCustomVal: 'ველის მნიშვნელობა არ არის მართებული', - andSpaces: ' და გამოტოვებები ', - badInt: 'ველის მნიშვნელობა არ არის მართებული რიცხვი', - badStrength: 'პაროლი არ არის საკმარისად ძლიერი (კარგი)', - badNumberOfSelectedOptionsStart: 'თქვენ უნდა აირჩიოთ სულ მცირე ', - badNumberOfSelectedOptionsEnd: ' პასუხი', - badAlphaNumeric: 'ველის მნიშვნელობა უნდა შეიცავდეს მხოლოდ ციფრებსა და ასოებს ', - badAlphaNumericExtra: ' და ', - wrongFileSize: 'ფაილი, რომლის ატვირთვასაც ცდილობთ არის ძალიან დიდი (დასაშვებია მაქსიმუმ %s)', - wrongFileType: 'დასაშვებია მხოლოდ შემდეგი გაფართოების ფაილები: %s', - groupCheckedRangeStart: 'გთხოვთ, აირჩიოთ ', - groupCheckedTooFewStart: 'გთხოვთ, აირჩიოთ სულ მცირე ', - groupCheckedTooManyStart: 'გთხოვთ, აირჩიოთ მაქსიმუმ ', - groupCheckedEnd: ' პუნქტი', - badCreditCard: 'საკრედიტო ბარათის ნომერი არ არის მართებული', - badCVV: 'CVV კოდი არ არის მართებული', - wrongFileDim: 'არამართებული სურათის ზომები,', - imageTooTall: 'სურათი არ უნდა იყოს უფრო გრძელი ვიდრე', - imageTooWide: 'სურათი არ უნდა იყოს უფრო ფართე ვიდრე', - imageTooSmall: 'სურათი არის ძალიან პატარა', - min: 'მინიმუმ', - max: 'მაქსიმუმ', - imageRatioNotAccepted: 'სურათის სიგრძისა და სიგანის ეს თანაფარდობა დაუშვებელია', - badBrazilTelephoneAnswer: 'მითითებული ტელეფონის ნომერი არ არის მართებული', - badreCaptcha: 'დაადასტურეთ, რომ არ ხართ რობოტი', - passwordComplexityStart: 'პაროლი უნდა შეიცავდეს მინიმუმ ', - passwordComplexitySeparator: ', ', - passwordComplexityUppercaseInfo: ' დიდი ასო(ები)', - passwordComplexityLowercaseInfo: ' პატარა ასო(ები)', - passwordComplexitySpecialCharsInfo: ' სპეციალური სიმბოლო(ები)', - passwordComplexityNumericCharsInfo: ' რიცხვითი მნიშვნელობა(ები)', - passwordComplexityEnd: '.' - }; - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/ka"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"ფორმა ვერ გაიგზავნა!",requiredField:"ველის შევსება სავალდებულოა",requiredFields:"თქვენ არ შეგივსიათ ყველა სავალდებულო ველი",badTime:"თქვენ მიუთითეთ არასწორი დრო",badEmail:"თქვენ მიუთითეთ არასწორი ელ.ფოსტის მისამართი",badTelephone:"თქვენ მიუთითეთ არასწორი ტელეფონის ნომერი",badSecurityAnswer:"თქვენ გაეცით არასწორი პასუხი უსაფრთხოების კითხვას",badDate:"თქვენ მიუთითეთ არასწორი თარიღი",lengthBadStart:"ველის მნიშვნელობის სიგრძე უნდა იყოს ",lengthBadEnd:" შუალედში",lengthTooLongStart:"ველის მნიშვნელობის სიგრძე უნდა იყოს მაქსიმუმ ",lengthTooShortStart:"ველის მნიშვნელობის სიგრძე უნდა იყოს მინიმუმ ",notConfirmed:"ველის მნიშვნელობები ვერ დადასტურდა",badDomain:"არასწორი დომენის მისამართი",badUrl:"ველის მნიშვნელობა არ არის მართებული URL მისამართი",badCustomVal:"ველის მნიშვნელობა არ არის მართებული",andSpaces:" და გამოტოვებები ",badInt:"ველის მნიშვნელობა არ არის მართებული რიცხვი",badStrength:"პაროლი არ არის საკმარისად ძლიერი (კარგი)",badNumberOfSelectedOptionsStart:"თქვენ უნდა აირჩიოთ სულ მცირე ",badNumberOfSelectedOptionsEnd:" პასუხი",badAlphaNumeric:"ველის მნიშვნელობა უნდა შეიცავდეს მხოლოდ ციფრებსა და ასოებს ",badAlphaNumericExtra:" და ",wrongFileSize:"ფაილი, რომლის ატვირთვასაც ცდილობთ არის ძალიან დიდი (დასაშვებია მაქსიმუმ %s)",wrongFileType:"დასაშვებია მხოლოდ შემდეგი გაფართოების ფაილები: %s",groupCheckedRangeStart:"გთხოვთ, აირჩიოთ ",groupCheckedTooFewStart:"გთხოვთ, აირჩიოთ სულ მცირე ",groupCheckedTooManyStart:"გთხოვთ, აირჩიოთ მაქსიმუმ ",groupCheckedEnd:" პუნქტი",badCreditCard:"საკრედიტო ბარათის ნომერი არ არის მართებული",badCVV:"CVV კოდი არ არის მართებული",wrongFileDim:"არამართებული სურათის ზომები,",imageTooTall:"სურათი არ უნდა იყოს უფრო გრძელი ვიდრე",imageTooWide:"სურათი არ უნდა იყოს უფრო ფართე ვიდრე",imageTooSmall:"სურათი არის ძალიან პატარა",min:"მინიმუმ",max:"მაქსიმუმ",imageRatioNotAccepted:"სურათის სიგრძისა და სიგანის ეს თანაფარდობა დაუშვებელია",badBrazilTelephoneAnswer:"მითითებული ტელეფონის ნომერი არ არის მართებული",badreCaptcha:"დაადასტურეთ, რომ არ ხართ რობოტი",passwordComplexityStart:"პაროლი უნდა შეიცავდეს მინიმუმ ",passwordComplexitySeparator:", ",passwordComplexityUppercaseInfo:" დიდი ასო(ები)",passwordComplexityLowercaseInfo:" პატარა ასო(ები)",passwordComplexitySpecialCharsInfo:" სპეციალური სიმბოლო(ები)",passwordComplexityNumericCharsInfo:" რიცხვითი მნიშვნელობა(ები)",passwordComplexityEnd:"."}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/ko.js b/form-validator/lang/ko.js index c56d807..7e2c0ea 100644 --- a/form-validator/lang/ko.js +++ b/form-validator/lang/ko.js @@ -1,89 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Korean language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/ko'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: '이 양식은 보낼 수 없습니다!', - requiredField: '필수 입력란입니다.', - requiredFields: '모든 필수 입력란을 입력해야 합니다.', - badTime: '시간을 정확하게 입력하지 않았습니다.', - badEmail: 'e-mail을 정확하게 입력하지 않았습니다.', - badTelephone: '전화번호를 정확하게 입력하지 않았습니다.', - badSecurityAnswer: '보안 입력을 정확하게 입력하지 않았습니다.', - badDate: '날짜를 정확하게 입력하지 않았습니다.', - lengthBadStart: '입력 값은 ', - lengthBadEnd: ' 사이의 문자여야 합니다.', - lengthTooLongStart: '입력 값의 길이가 ', - lengthTooLongEnd: ' 보다 깁니다.', - lengthTooShortStart: '입력 값의 길이가 ', - lengthTooShortEnd: ' 보다 짧습니다.', - notConfirmed: '입력 값이 일치하지 않습니다.', - badDomain: '도메인을 정확하게 입력하지 않았습니다.', - badUrl: 'URL을 정확하게 입력하지 않았습니다.', - badCustomVal: '입력 값이 정확하지 않습니다.', - badInt: '입력 값이 숫자가 아닙니다.', - badSecurityNumber: '주민등록번호가 정확하지 않습니다.', - badStrength: '암호를 더 복잡하게 조합해야 합니다.', - badNumberOfSelectedOptionsStart: '최소한 ', - badNumberOfSelectedOptionsEnd: ' 개 항목 이상을 선택해야 합니다.', - badAlphaNumeric: '입력 값은 문자와 숫자만 허용합니다.', - badAlphaNumericAndExtra: '입력 값은 문자와 숫자와 ', - badAlphaNumericExtra: ' 만 허용합니다.', - badAlphaNumericAndExtraAndSpaces: '입력 값은 문자와 숫자와 ', - andSpaces: ' 와 빈문자(spaces)만 허용합니다. ', - wrongFileSize: '업로드 하려고 하는 파일의 크기가 너무 큽니다. (최대 %s)', - wrongFileType: '파일 타입은 %s 만 허용합니다.', - groupCheckedRangeStart: '', - groupCheckedEnd: ' 개 항목을 선택해야 합니다.', - groupCheckedTooFewStart: '최소한 ', - groupCheckedTooFewEnd: ' 개 항목 이상을 선택해야 합니다.', - groupCheckedTooManyStart: '', - groupCheckedTooManyEnd: ' 개 항목 이하를 선택해야 합니다.', - badCreditCard: '신용카드번호를 정확하지 않습니다.', - badCVV: 'CVV 번호가 정확하지 않습니다.', - wrongFileDim : '잘못된 이미지 크기 ,', - imageTooTall : '이미지 길이가 ', - imageTooTallEnd : ' 보다 길어야 합니다.', - imageTooWide : '이미지 넓이가 ', - imageTooWideEnd : ' 보다 넓어야 합니다.', - imageTooSmall : '이미지 크기가 너무 작습니다.', - min : 'min', - max : 'max', - imageRatioNotAccepted : '이미지 비율이 맞지 않습니다.', - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/ko"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"이 양식은 보낼 수 없습니다!",requiredField:"필수 입력란입니다.",requiredFields:"모든 필수 입력란을 입력해야 합니다.",badTime:"시간을 정확하게 입력하지 않았습니다.",badEmail:"e-mail을 정확하게 입력하지 않았습니다.",badTelephone:"전화번호를 정확하게 입력하지 않았습니다.",badSecurityAnswer:"보안 입력을 정확하게 입력하지 않았습니다.",badDate:"날짜를 정확하게 입력하지 않았습니다.",lengthBadStart:"입력 값은 ",lengthBadEnd:" 사이의 문자여야 합니다.",lengthTooLongStart:"입력 값의 길이가 ",lengthTooLongEnd:" 보다 깁니다.",lengthTooShortStart:"입력 값의 길이가 ",lengthTooShortEnd:" 보다 짧습니다.",notConfirmed:"입력 값이 일치하지 않습니다.",badDomain:"도메인을 정확하게 입력하지 않았습니다.",badUrl:"URL을 정확하게 입력하지 않았습니다.",badCustomVal:"입력 값이 정확하지 않습니다.",badInt:"입력 값이 숫자가 아닙니다.",badSecurityNumber:"주민등록번호가 정확하지 않습니다.",badStrength:"암호를 더 복잡하게 조합해야 합니다.",badNumberOfSelectedOptionsStart:"최소한 ",badNumberOfSelectedOptionsEnd:" 개 항목 이상을 선택해야 합니다.",badAlphaNumeric:"입력 값은 문자와 숫자만 허용합니다.",badAlphaNumericAndExtra:"입력 값은 문자와 숫자와 ",badAlphaNumericExtra:" 만 허용합니다.",badAlphaNumericAndExtraAndSpaces:"입력 값은 문자와 숫자와 ",andSpaces:" 와 빈문자(spaces)만 허용합니다. ",wrongFileSize:"업로드 하려고 하는 파일의 크기가 너무 큽니다. (최대 %s)",wrongFileType:"파일 타입은 %s 만 허용합니다.",groupCheckedRangeStart:"",groupCheckedEnd:" 개 항목을 선택해야 합니다.",groupCheckedTooFewStart:"최소한 ",groupCheckedTooFewEnd:" 개 항목 이상을 선택해야 합니다.",groupCheckedTooManyStart:"",groupCheckedTooManyEnd:" 개 항목 이하를 선택해야 합니다.",badCreditCard:"신용카드번호를 정확하지 않습니다.",badCVV:"CVV 번호가 정확하지 않습니다.",wrongFileDim:"잘못된 이미지 크기 ,",imageTooTall:"이미지 길이가 ",imageTooTallEnd:" 보다 길어야 합니다.",imageTooWide:"이미지 넓이가 ",imageTooWideEnd:" 보다 넓어야 합니다.",imageTooSmall:"이미지 크기가 너무 작습니다.",min:"min",max:"max",imageRatioNotAccepted:"이미지 비율이 맞지 않습니다."}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/nl.js b/form-validator/lang/nl.js index d9506f0..ae0f5f9 100644 --- a/form-validator/lang/nl.js +++ b/form-validator/lang/nl.js @@ -1,82 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Dutch language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function ($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/nl'); - - $(window).bind('validatorsLoaded', function () { - - $.formUtils.LANG = { - andSpaces: ' en spaties ', - badAlphaNumeric: 'De ingevoerde waarde mag alleen alfabetische karakters bevatten', - badAlphaNumericExtra: ' en ', - badCVV: 'Het CVV nummer was onjuist', - badCreditCard: 'Het creditcardnummer is onjuist', - badCustomVal: 'De ingevoerde waarde is onjuist', - badDate: 'U heeft niet de juiste datum aangegeven', - badDomain: 'Incorrect domein', - badEmail: 'U heeft een onjuist e-mailadres ingevoerd ', - badInt: 'De ingevoerde waarde was een onjuist getal', - badNumberOfSelectedOptionsEnd: ' antwoorden', - badNumberOfSelectedOptionsStart: 'U moet tenminste ', - badSecurityAnswer: 'U heeft de beveilingsvraag onjuist beantwoord', - badSecurityNumber: 'Uw burgerservicenummer was incorrect', - badStrength: 'Het wachtwoord is niet veilig genoeg', - badTelephone: 'U heeft een onjuist telefoonnummer ingevoerd', - badTime: 'U heeft een incorrecte tijd aangegeven', - badUrl: 'De ingevoerde waarde is geen correcte URL', - badreCaptcha: 'Bevestig a.u.b. dat u geen robot bent', - errorTitle: 'Indienen van formulier mislukt!', - groupCheckedEnd: ' item(s)', - groupCheckedRangeStart: 'Kies a.u.b. tussen ', - groupCheckedTooFewStart: 'Kies a.u.b. ten minste ', - groupCheckedTooManyStart: 'Kies a.u.b. maximaal ', - imageRatioNotAccepted: 'De afbeeldingsverhouding wordt niet geaccepteerd', - imageTooSmall: 'de afbeelding was te klein', - imageTooTall: 'de afbeelding kan niet langer zijn dan', - imageTooWide: 'de afbeelding kan niet wijder zijn dan', - lengthBadEnd: ' karakters', - lengthBadStart: 'De ingevoerde waarde moet liggen tussen ', - lengthTooLongStart: 'De ingevoerde waarde is langer dan ', - lengthTooShortStart: 'De ingevoerde waarde is korter dan ', - max: 'max', - min: 'min', - notConfirmed: 'Invoerwaarden konden niet worden bevestigd', - requiredField: 'Dit is een verplicht veld', - requiredFields: 'U heeft niet alle verplichte velden ingevuld', - wrongFileDim: 'Incorrecte afbeeldingsafmetingen,', - wrongFileSize: 'Het bestand dat u probeert te uploaden is te groot (max %s)', - wrongFileType: 'Alleen type %s bestanden zijn toegestaan' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/nl"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={andSpaces:" en spaties ",badAlphaNumeric:"De ingevoerde waarde mag alleen alfabetische karakters bevatten",badAlphaNumericExtra:" en ",badCVV:"Het CVV nummer was onjuist",badCreditCard:"Het creditcardnummer is onjuist",badCustomVal:"De ingevoerde waarde is onjuist",badDate:"U heeft niet de juiste datum aangegeven",badDomain:"Incorrect domein",badEmail:"U heeft een onjuist e-mailadres ingevoerd ",badInt:"De ingevoerde waarde was een onjuist getal",badNumberOfSelectedOptionsEnd:" antwoorden",badNumberOfSelectedOptionsStart:"U moet tenminste ",badSecurityAnswer:"U heeft de beveilingsvraag onjuist beantwoord",badSecurityNumber:"Uw burgerservicenummer was incorrect",badStrength:"Het wachtwoord is niet veilig genoeg",badTelephone:"U heeft een onjuist telefoonnummer ingevoerd",badTime:"U heeft een incorrecte tijd aangegeven",badUrl:"De ingevoerde waarde is geen correcte URL",badreCaptcha:"Bevestig a.u.b. dat u geen robot bent",errorTitle:"Indienen van formulier mislukt!",groupCheckedEnd:" item(s)",groupCheckedRangeStart:"Kies a.u.b. tussen ",groupCheckedTooFewStart:"Kies a.u.b. ten minste ",groupCheckedTooManyStart:"Kies a.u.b. maximaal ",imageRatioNotAccepted:"De afbeeldingsverhouding wordt niet geaccepteerd",imageTooSmall:"de afbeelding was te klein",imageTooTall:"de afbeelding kan niet langer zijn dan",imageTooWide:"de afbeelding kan niet wijder zijn dan",lengthBadEnd:" karakters",lengthBadStart:"De ingevoerde waarde moet liggen tussen ",lengthTooLongStart:"De ingevoerde waarde is langer dan ",lengthTooShortStart:"De ingevoerde waarde is korter dan ",max:"max",min:"min",notConfirmed:"Invoerwaarden konden niet worden bevestigd",requiredField:"Dit is een verplicht veld",requiredFields:"U heeft niet alle verplichte velden ingevuld",wrongFileDim:"Incorrecte afbeeldingsafmetingen,",wrongFileSize:"Het bestand dat u probeert te uploaden is te groot (max %s)",wrongFileType:"Alleen type %s bestanden zijn toegestaan"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/no.js b/form-validator/lang/no.js index 83882a3..7b4b1eb 100644 --- a/form-validator/lang/no.js +++ b/form-validator/lang/no.js @@ -1,82 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Norwegian language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function ($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/no'); - - $(window).bind('validatorsLoaded', function () { - - $.formUtils.LANG = { - andSpaces: ' og mellomrom ', - badAlphaNumeric: 'Inntastningsverdien kan kun inneholde alfanumeriske tegn ', - badAlphaNumericExtra: ' og ', - badCVV: 'CVV-nummeret var ikke korrekt', - badCreditCard: 'Kredittkortnummeret er ikke korrekt', - badCustomVal: 'Inntastingsverdien er ikke korrekt', - badDate: 'Du har ikke oppgitt en korrekt dato', - badDomain: 'Ukorrekt domeneverdi', - badEmail: 'Du har ikke oppgitt en korrekt e-postadresse', - badInt: 'Inntastingsverdien er ikke et korrekt tall', - badNumberOfSelectedOptionsEnd: ' svar', - badNumberOfSelectedOptionsStart: 'Du må velge minst ', - badSecurityAnswer: 'Du har ikke oppgitt et korrekt svar på sikkerhetsspørsmålet', - badSecurityNumber: 'Ditt personnummer var ukorrekt', - badStrength: 'Passordet er ikke sterkt nok', - badTelephone: 'Du har ikke oppgitt et korrekt telefonnummer', - badTime: 'Du har ikke oppgitt en korrekt tid', - badUrl: 'Inntastingsverdien er ikke en korrekt URL', - badreCaptcha: 'Vennligst bekreft at du ikke er en robot', - errorTitle: 'Innsending av skjemaet feilet!', - groupCheckedEnd: ' ting', - groupCheckedRangeStart: 'Vennligst velg mellom ', - groupCheckedTooFewStart: 'Vennligst velg minst ', - groupCheckedTooManyStart: 'Vennligst velg maksimum ', - imageRatioNotAccepted: 'Bildestørrelse ikke akseptert', - imageTooSmall: 'bildet er for lite', - imageTooTall: 'bildet kan ikke være høyere enn', - imageTooWide: 'bildet kan ikke være bredere enn', - lengthBadEnd: 'tegn', - lengthBadStart: 'Inntastingsverdien må være mellom ', - lengthTooLongStart: 'Inntastingsverdien er lenger enn ', - lengthTooShortStart: 'Inntastingsverdien er kortere enn ', - max: 'maks', - min: 'min', - notConfirmed: 'Inntastingsverdier kunne ikke bekreftes', - requiredField: 'Dette er et obligatorisk felt', - requiredFields: 'Du har ikke besvart alle obligatoriske felt', - wrongFileDim: 'Ukorrekte bildedimensjoner,', - wrongFileSize: 'Bildet du prøver å laste opp er for stort (max %s)', - wrongFileType: 'Kun filer av type %s er tillatt' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/no"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={andSpaces:" og mellomrom ",badAlphaNumeric:"Inntastningsverdien kan kun inneholde alfanumeriske tegn ",badAlphaNumericExtra:" og ",badCVV:"CVV-nummeret var ikke korrekt",badCreditCard:"Kredittkortnummeret er ikke korrekt",badCustomVal:"Inntastingsverdien er ikke korrekt",badDate:"Du har ikke oppgitt en korrekt dato",badDomain:"Ukorrekt domeneverdi",badEmail:"Du har ikke oppgitt en korrekt e-postadresse",badInt:"Inntastingsverdien er ikke et korrekt tall",badNumberOfSelectedOptionsEnd:" svar",badNumberOfSelectedOptionsStart:"Du må velge minst ",badSecurityAnswer:"Du har ikke oppgitt et korrekt svar på sikkerhetsspørsmålet",badSecurityNumber:"Ditt personnummer var ukorrekt",badStrength:"Passordet er ikke sterkt nok",badTelephone:"Du har ikke oppgitt et korrekt telefonnummer",badTime:"Du har ikke oppgitt en korrekt tid",badUrl:"Inntastingsverdien er ikke en korrekt URL",badreCaptcha:"Vennligst bekreft at du ikke er en robot",errorTitle:"Innsending av skjemaet feilet!",groupCheckedEnd:" ting",groupCheckedRangeStart:"Vennligst velg mellom ",groupCheckedTooFewStart:"Vennligst velg minst ",groupCheckedTooManyStart:"Vennligst velg maksimum ",imageRatioNotAccepted:"Bildestørrelse ikke akseptert",imageTooSmall:"bildet er for lite",imageTooTall:"bildet kan ikke være høyere enn",imageTooWide:"bildet kan ikke være bredere enn",lengthBadEnd:"tegn",lengthBadStart:"Inntastingsverdien må være mellom ",lengthTooLongStart:"Inntastingsverdien er lenger enn ",lengthTooShortStart:"Inntastingsverdien er kortere enn ",max:"maks",min:"min",notConfirmed:"Inntastingsverdier kunne ikke bekreftes",requiredField:"Dette er et obligatorisk felt",requiredFields:"Du har ikke besvart alle obligatoriske felt",wrongFileDim:"Ukorrekte bildedimensjoner,",wrongFileSize:"Bildet du prøver å laste opp er for stort (max %s)",wrongFileType:"Kun filer av type %s er tillatt"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/pl.js b/form-validator/lang/pl.js index 3ec17fe..f0af0e1 100644 --- a/form-validator/lang/pl.js +++ b/form-validator/lang/pl.js @@ -1,91 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Polish language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/pl'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'Złożenie formularza nie powiodło się!', - requiredField: 'To pole jest wymagane', - requiredfields: 'Nie wszystkie wymagane pola zostały wypełnione', - badTime: 'Wprowadzono niepoprawny czas', - badEmail: 'Wprowadzono niepoprawny adres e-mail', - badTelephone: 'Wprowadzono niepoprawny numeru telefonu', - badSecurityAnswer: 'Nieprawidłowa odpowiedź na pytanie bezpieczeństwa', - badDate: 'Niepoprawna data', - lengthBadStart: 'Wprowadzona wartość musi być pomiędzy ', - lengthBadEnd: ' znaków', - lengthTooLongStart: 'Wprowadzona wartość jest większa niż ', - lengthTooShortStart: 'Wprowadzona wartość jest mniejsza niż ', - notConfirmed: 'Wprowadzone wartości nie zostały potwierdzone', - badDomain: 'Nieprawidłowa wartość domeny', - badUrl: 'Wprowadzono nieprawidłowy adres URL', - badCustomVal: 'Wprowadzona wartość jest niepoprawna', - andSpaces: ' i odstępy', - badInt: 'Wprowadzono nieprawidłowy numer', - badSecurityNumber: 'Wprowadzono niepoprawny numer ubezpieczenia społecznego', - badUKVatAnswer: 'Wprowadzono niepoprawny brytyjski numer VAT', - badUKNin: 'Wprowadzono niepoprawny brytyjski numer NIP', - badUKUtr: 'Wprowadzono niepoprawny brytyjski numer podatnika', - badStrength: 'Twoje hasło nie jest wystarczająco mocne', - badNumberOfSelectedOptionsStart: 'Musisz wybrać przynajmniej ', - badNumberOfSelectedOptionsEnd: ' odpowiedzi', - badAlphaNumeric: 'Wprowadzona wartość może zawierać tylko znaki alfanumeryczne ', - badAlphaNumericExtra: ' i ', - wrongFileSize: 'Wysyłany plik jest zbyt duży (max %s)', - wrongFileType: 'Dozwolone są tylko pliki typu %s', - groupCheckedRangeStart: 'Proszę wybrać pomiędzy ', - groupCheckedTooFewStart: 'Proszę wybrać przynajmniej ', - groupCheckedTooManyStart: 'Proszę wybrać maksymalnie ', - groupCheckedEnd: ' element(ów)', - badCreditCard: 'Podany numer karty kredytowej jest nieprawidłowy', - badCVV: 'Podany numer CVV jest nieprawidłowy', - wrongFileDim: 'Nieprawidłowe wymiary obrazu,', - imageTooTall: 'obraz nie może być wyższa niż', - imageTooWide: 'obraz nie może być szerszy niż', - imageTooSmall: 'obraz jest zbyt mały', - min: 'min', - max: 'max', - imageRatioNotAccepted: 'Proporcje obrazu są niepoprawne', - badBrazilTelephoneAnswer: 'Wprowadzono niepoprawny numer telefonu', - badBrazilCEPAnswer: 'Wprowadzono niepoprawny CEP', - badBrazilCPFAnswer: 'Wprowadzono niepoprawny CPF', - badPlPesel: 'Wprowadzono niepoprawny numer PESEL', - badPlNip: 'Wprowadzono niepoprawny numer NIP', - badPlRegon: 'Wprowadzono niepoprawny numer REGON', - badreCaptcha: 'Potwierdź że nie jesteś botem!' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/pl"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Złożenie formularza nie powiodło się!",requiredField:"To pole jest wymagane",requiredfields:"Nie wszystkie wymagane pola zostały wypełnione",badTime:"Wprowadzono niepoprawny czas",badEmail:"Wprowadzono niepoprawny adres e-mail",badTelephone:"Wprowadzono niepoprawny numeru telefonu",badSecurityAnswer:"Nieprawidłowa odpowiedź na pytanie bezpieczeństwa",badDate:"Niepoprawna data",lengthBadStart:"Wprowadzona wartość musi być pomiędzy ",lengthBadEnd:" znaków",lengthTooLongStart:"Wprowadzona wartość jest większa niż ",lengthTooShortStart:"Wprowadzona wartość jest mniejsza niż ",notConfirmed:"Wprowadzone wartości nie zostały potwierdzone",badDomain:"Nieprawidłowa wartość domeny",badUrl:"Wprowadzono nieprawidłowy adres URL",badCustomVal:"Wprowadzona wartość jest niepoprawna",andSpaces:" i odstępy",badInt:"Wprowadzono nieprawidłowy numer",badSecurityNumber:"Wprowadzono niepoprawny numer ubezpieczenia społecznego",badUKVatAnswer:"Wprowadzono niepoprawny brytyjski numer VAT",badUKNin:"Wprowadzono niepoprawny brytyjski numer NIP",badUKUtr:"Wprowadzono niepoprawny brytyjski numer podatnika",badStrength:"Twoje hasło nie jest wystarczająco mocne",badNumberOfSelectedOptionsStart:"Musisz wybrać przynajmniej ",badNumberOfSelectedOptionsEnd:" odpowiedzi",badAlphaNumeric:"Wprowadzona wartość może zawierać tylko znaki alfanumeryczne ",badAlphaNumericExtra:" i ",wrongFileSize:"Wysyłany plik jest zbyt duży (max %s)",wrongFileType:"Dozwolone są tylko pliki typu %s",groupCheckedRangeStart:"Proszę wybrać pomiędzy ",groupCheckedTooFewStart:"Proszę wybrać przynajmniej ",groupCheckedTooManyStart:"Proszę wybrać maksymalnie ",groupCheckedEnd:" element(ów)",badCreditCard:"Podany numer karty kredytowej jest nieprawidłowy",badCVV:"Podany numer CVV jest nieprawidłowy",wrongFileDim:"Nieprawidłowe wymiary obrazu,",imageTooTall:"obraz nie może być wyższa niż",imageTooWide:"obraz nie może być szerszy niż",imageTooSmall:"obraz jest zbyt mały",min:"min",max:"max",imageRatioNotAccepted:"Proporcje obrazu są niepoprawne",badBrazilTelephoneAnswer:"Wprowadzono niepoprawny numer telefonu",badBrazilCEPAnswer:"Wprowadzono niepoprawny CEP",badBrazilCPFAnswer:"Wprowadzono niepoprawny CPF",badPlPesel:"Wprowadzono niepoprawny numer PESEL",badPlNip:"Wprowadzono niepoprawny numer NIP",badPlRegon:"Wprowadzono niepoprawny numer REGON",badreCaptcha:"Potwierdź że nie jesteś botem!"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/pt.js b/form-validator/lang/pt.js index 354058b..089ab14 100644 --- a/form-validator/lang/pt.js +++ b/form-validator/lang/pt.js @@ -1,85 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Portuguese language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/pt'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'O formulário não pode ser enviado!', - requiredField: 'Campo de preenchimento obrigatório', - requiredFields: 'Você ainda não preencheu todos os campos obrigatórios', - badTime: 'A hora digitada não é válida', - badEmail: 'O e-mail digitado não é válido', - badTelephone: 'O telefone digitado não é válido', - badSecurityAnswer: 'A pergunta de segurança não foi respondida corretamente', - badDate: 'A data digitada não é válida', - lengthBadStart: 'Sua resposta deve incluir entre ', - lengthBadEnd: ' caracteres', - lengthTooLongStart: 'Sua resposta tem mais que ', - lengthTooShortStart: 'Sua resposta tem menos que', - notConfirmed: 'As informações digitadas não puderam ser confirmadas', - badDomain: 'O domínio digitado não é válido', - badUrl: 'A URL digitada não é válida', - badCustomVal: 'Os dados digitados não são válidos', - andSpaces: ' e espaços', - badInt: 'O número digitado não é válido', - badSecurityNumber: 'O número de seguro social digitado não é válido', - badUKVatAnswer: 'O número do VAT digitado não é válido para o Reino Unido', - badStrength: 'Senha muito fraca', - badNumberOfSelectedOptionsStart: 'Selecione pelo menos', - badNumberOfSelectedOptionsEnd: ' alternativa(s)', - badAlphaNumeric: 'Use somente caracteres alfanuméricos (letras a-z e números)', - badAlphaNumericExtra: ' e', - wrongFileSize: 'O arquivo selecionado é maior que o tamanho máximo permitido (%s)', - wrongFileType: 'Somente arquivos %s são permitidos', - groupCheckedRangeStart: 'Por favor, escolha entre ', - groupCheckedTooFewStart: 'Por favor, escolha pelo menos ', - groupCheckedTooManyStart: 'Por favor, escolhe no máximo ', - groupCheckedEnd: ' alternativa(s)', - badCreditCard: 'O número de cartão de crédito digitado não é válido', - badCVV: 'O código de segurança do cartão de crédito não é válido', - wrongFileDim: 'As dimensões da imagem não são válidas', - imageTooTall: 'a imagem não pode ser mais alta que ', - imageTooWide: 'a imagem não pode ser mais larga que ', - imageTooSmall: 'a imagem é muito pequena', - min: 'min', - max: 'max', - imageRatioNotAccepted : 'A proporção da imagem (largura x altura) não é válida', - badBrazilTelephoneAnswer: 'O número de telefone digitado é inválido', - badBrazilCEPAnswer: 'O CEP digitado é inválido', - badBrazilCPFAnswer: 'O CPF digitado é inválido' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/pt"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"O formulário não pode ser enviado!",requiredField:"Campo de preenchimento obrigatório",requiredFields:"Você ainda não preencheu todos os campos obrigatórios",badTime:"A hora digitada não é válida",badEmail:"O e-mail digitado não é válido",badTelephone:"O telefone digitado não é válido",badSecurityAnswer:"A pergunta de segurança não foi respondida corretamente",badDate:"A data digitada não é válida",lengthBadStart:"Sua resposta deve incluir entre ",lengthBadEnd:" caracteres",lengthTooLongStart:"Sua resposta tem mais que ",lengthTooShortStart:"Sua resposta tem menos que",notConfirmed:"As informações digitadas não puderam ser confirmadas",badDomain:"O domínio digitado não é válido",badUrl:"A URL digitada não é válida",badCustomVal:"Os dados digitados não são válidos",andSpaces:" e espaços",badInt:"O número digitado não é válido",badSecurityNumber:"O número de seguro social digitado não é válido",badUKVatAnswer:"O número do VAT digitado não é válido para o Reino Unido",badStrength:"Senha muito fraca",badNumberOfSelectedOptionsStart:"Selecione pelo menos",badNumberOfSelectedOptionsEnd:" alternativa(s)",badAlphaNumeric:"Use somente caracteres alfanuméricos (letras a-z e números)",badAlphaNumericExtra:" e",wrongFileSize:"O arquivo selecionado é maior que o tamanho máximo permitido (%s)",wrongFileType:"Somente arquivos %s são permitidos",groupCheckedRangeStart:"Por favor, escolha entre ",groupCheckedTooFewStart:"Por favor, escolha pelo menos ",groupCheckedTooManyStart:"Por favor, escolhe no máximo ",groupCheckedEnd:" alternativa(s)",badCreditCard:"O número de cartão de crédito digitado não é válido",badCVV:"O código de segurança do cartão de crédito não é válido",wrongFileDim:"As dimensões da imagem não são válidas",imageTooTall:"a imagem não pode ser mais alta que ",imageTooWide:"a imagem não pode ser mais larga que ",imageTooSmall:"a imagem é muito pequena",min:"min",max:"max",imageRatioNotAccepted:"A proporção da imagem (largura x altura) não é válida",badBrazilTelephoneAnswer:"O número de telefone digitado é inválido",badBrazilCEPAnswer:"O CEP digitado é inválido",badBrazilCPFAnswer:"O CPF digitado é inválido"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/ro.js b/form-validator/lang/ro.js index 1df78c1..b413e2e 100644 --- a/form-validator/lang/ro.js +++ b/form-validator/lang/ro.js @@ -1,85 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Romanian language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/ro'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'Nu sa reusit lansarea formularului!', - requiredField: 'Acest câmp este obligatoriu', - requiredfields: 'Nu toate câmpurile obligatorii au fost completate', - badTime: 'Timpul introdus este incorect', - badEmail: 'Adresa de e-mail este incorectă', - badTelephone: 'Numărul de telefon este incorect', - badSecurityAnswer: 'Răspuns incorect la întrebarea de siguran?ă', - badDate: 'Dară incorectă', - lengthBadStart: 'Valoarea introdusă trebuie să fie interval ', - lengthBadEnd: ' caractere', - lengthTooLongStart: 'Valoarea introdusă este mai mare decât ', - lengthTooShortStart: 'Valoarea introdusă este mai mică decât ', - notConfirmed: 'Valorile introduse nu au fost confirmate', - badDomain: 'Domeniul este incorect', - badUrl: 'Adresa URL este incorectă', - badCustomVal: 'Valoarea introdusă este incorectă', - andSpaces: ' şi spaţierea', - badInt: 'Numărul introdus este incorect', - badSecurityNumber: 'Numărul de asigurare introdus este incorect', - badUKVatAnswer: 'Numărul CIF introdus este incorect', - badStrength: 'Parola Dvs nu este suficient de sigură', - badNumberOfSelectedOptionsStart: 'Trebuie să alegi măcar ', - badNumberOfSelectedOptionsEnd: ' răspunsuri', - badAlphaNumeric: 'Valoarea introdusă trebuie să con însă doar caractere alfanumerice ', - badAlphaNumericExtra: ' și ', - wrongFileSize: 'Fisierul trimis este prea mare (max %s)', - wrongFileType: 'Se acceptă doar fisiere tip %s', - groupCheckedRangeStart: 'Te rog alege între ', - groupCheckedTooFewStart: 'Te rog alege măcar ', - groupCheckedTooManyStart: 'Te rog alege maxim ', - groupCheckedEnd: ' elemnt(e)', - badCreditCard: 'Numărul de card introdus este incorect', - badCVV: 'Numărul CVV introdus este incorect', - wrongFileDim: 'Dimensiunea imaginii este incorectă,', - imageTooTall: 'imaginea nu poate fi mai înaltă decât', - imageTooWide: 'imaginea nu poate fi mai lată decât', - imageTooSmall: 'imaginea este prea mică', - min: 'min', - max: 'max', - imageRatioNotAccepted: 'Proportiile imaginii sunt incorecte', - badBrazilTelephoneAnswer: 'Numărul de telefon introdus este incorect.', - badBrazilCEPAnswer: 'CEP incorect', - badBrazilCPFAnswer: 'CPF incorect' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/ro"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Nu sa reusit lansarea formularului!",requiredField:"Acest câmp este obligatoriu",requiredfields:"Nu toate câmpurile obligatorii au fost completate",badTime:"Timpul introdus este incorect",badEmail:"Adresa de e-mail este incorectă",badTelephone:"Numărul de telefon este incorect",badSecurityAnswer:"Răspuns incorect la întrebarea de siguran?ă",badDate:"Dară incorectă",lengthBadStart:"Valoarea introdusă trebuie să fie interval ",lengthBadEnd:" caractere",lengthTooLongStart:"Valoarea introdusă este mai mare decât ",lengthTooShortStart:"Valoarea introdusă este mai mică decât ",notConfirmed:"Valorile introduse nu au fost confirmate",badDomain:"Domeniul este incorect",badUrl:"Adresa URL este incorectă",badCustomVal:"Valoarea introdusă este incorectă",andSpaces:" şi spaţierea",badInt:"Numărul introdus este incorect",badSecurityNumber:"Numărul de asigurare introdus este incorect",badUKVatAnswer:"Numărul CIF introdus este incorect",badStrength:"Parola Dvs nu este suficient de sigură",badNumberOfSelectedOptionsStart:"Trebuie să alegi măcar ",badNumberOfSelectedOptionsEnd:" răspunsuri",badAlphaNumeric:"Valoarea introdusă trebuie să con însă doar caractere alfanumerice ",badAlphaNumericExtra:" și ",wrongFileSize:"Fisierul trimis este prea mare (max %s)",wrongFileType:"Se acceptă doar fisiere tip %s",groupCheckedRangeStart:"Te rog alege între ",groupCheckedTooFewStart:"Te rog alege măcar ",groupCheckedTooManyStart:"Te rog alege maxim ",groupCheckedEnd:" elemnt(e)",badCreditCard:"Numărul de card introdus este incorect",badCVV:"Numărul CVV introdus este incorect",wrongFileDim:"Dimensiunea imaginii este incorectă,",imageTooTall:"imaginea nu poate fi mai înaltă decât",imageTooWide:"imaginea nu poate fi mai lată decât",imageTooSmall:"imaginea este prea mică",min:"min",max:"max",imageRatioNotAccepted:"Proportiile imaginii sunt incorecte",badBrazilTelephoneAnswer:"Numărul de telefon introdus este incorect.",badBrazilCEPAnswer:"CEP incorect",badBrazilCPFAnswer:"CPF incorect"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/ru.js b/form-validator/lang/ru.js index f21f857..63f018c 100644 --- a/form-validator/lang/ru.js +++ b/form-validator/lang/ru.js @@ -1,86 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Russian language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/ru'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - - errorTitle: 'Ошибка отправки формы!', - requiredField: 'Это обязательное поле', - requiredFields: 'Вы задали не все обязательные поля', - badTime: 'Вы задали некорректное время', - badEmail: 'Вы задали некорректный e-mail', - badTelephone: 'Вы задали некорректный номер телефона', - badSecurityAnswer: 'Вы задали некорректный ответ на секретный вопрос', - badDate: 'Вы задали некорректную дату', - lengthBadStart: 'Значение должно быть в диапазоне', - lengthBadEnd: ' символов', - lengthTooLongStart: 'Значение длинее, чем ', - lengthTooShortStart: 'Значение меньше, чем ', - notConfirmed: 'Введённые значения не могут быть подтверждены', - badDomain: 'Некорректное значение домена', - badUrl: 'Некорретный URL', - badCustomVal: 'Введённое значение неверно', - andSpaces: ' и пробелы ', - badInt: 'Значение - не число', - badSecurityNumber: 'Введённый защитный номер - неправильный', - badUKVatAnswer: 'Некорректный UK VAT номер', - badStrength: 'Пароль не достаточно надёжен', - badNumberOfSelectedOptionsStart: 'Вы должны выбрать как минимум ', - badNumberOfSelectedOptionsEnd: ' ответов', - badAlphaNumeric: 'Значение должно содержать только числа и буквы ', - badAlphaNumericExtra: ' и ', - wrongFileSize: 'Загружаемый файл слишком велик (максимальный размер %s)', - wrongFileType: 'Принимаются файлы следующих типов %s', - groupCheckedRangeStart: 'Выберите между ', - groupCheckedTooFewStart: 'Выберите как минимум ', - groupCheckedTooManyStart: 'Выберите максимум из ', - groupCheckedEnd: ' элемент(ов)', - badCreditCard: 'Номер кредитной карты некорректен', - badCVV: 'CVV номер некорректно', - wrongFileDim : 'Неверные размеры графического файла,', - imageTooTall : 'изображение не может быть уже чем', - imageTooWide : 'изображение не может быть шире чем', - imageTooSmall : 'изображение слишком мало', - min : 'минимум', - max : 'максимум', - imageRatioNotAccepted : 'Изображение с таким соотношением сторон не принимается', - badBrazilTelephoneAnswer: 'Введённый номер телефона неправильный', - badBrazilCEPAnswer: 'CEP неправильный', - badBrazilCPFAnswer: 'CPF неправильный' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/ru"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Ошибка отправки формы!",requiredField:"Это обязательное поле",requiredFields:"Вы задали не все обязательные поля",badTime:"Вы задали некорректное время",badEmail:"Вы задали некорректный e-mail",badTelephone:"Вы задали некорректный номер телефона",badSecurityAnswer:"Вы задали некорректный ответ на секретный вопрос",badDate:"Вы задали некорректную дату",lengthBadStart:"Значение должно быть в диапазоне",lengthBadEnd:" символов",lengthTooLongStart:"Значение длинее, чем ",lengthTooShortStart:"Значение меньше, чем ",notConfirmed:"Введённые значения не могут быть подтверждены",badDomain:"Некорректное значение домена",badUrl:"Некорретный URL",badCustomVal:"Введённое значение неверно",andSpaces:" и пробелы ",badInt:"Значение - не число",badSecurityNumber:"Введённый защитный номер - неправильный",badUKVatAnswer:"Некорректный UK VAT номер",badStrength:"Пароль не достаточно надёжен",badNumberOfSelectedOptionsStart:"Вы должны выбрать как минимум ",badNumberOfSelectedOptionsEnd:" ответов",badAlphaNumeric:"Значение должно содержать только числа и буквы ",badAlphaNumericExtra:" и ",wrongFileSize:"Загружаемый файл слишком велик (максимальный размер %s)",wrongFileType:"Принимаются файлы следующих типов %s",groupCheckedRangeStart:"Выберите между ",groupCheckedTooFewStart:"Выберите как минимум ",groupCheckedTooManyStart:"Выберите максимум из ",groupCheckedEnd:" элемент(ов)",badCreditCard:"Номер кредитной карты некорректен",badCVV:"CVV номер некорректно",wrongFileDim:"Неверные размеры графического файла,",imageTooTall:"изображение не может быть уже чем",imageTooWide:"изображение не может быть шире чем",imageTooSmall:"изображение слишком мало",min:"минимум",max:"максимум",imageRatioNotAccepted:"Изображение с таким соотношением сторон не принимается",badBrazilTelephoneAnswer:"Введённый номер телефона неправильный",badBrazilCEPAnswer:"CEP неправильный",badBrazilCPFAnswer:"CPF неправильный"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/sv.js b/form-validator/lang/sv.js index debea3a..7f574af 100644 --- a/form-validator/lang/sv.js +++ b/form-validator/lang/sv.js @@ -1,83 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Swedish language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/sv'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'Formuläret kunde inte skickas!', - requiredField: 'Detta är ett obligtoriskt fält', - requiredFields: 'Du har inte besvarat alla frågor', - badTime: 'Du har inte angett en korrekt tidpunkt', - badEmail: 'Du har inte angett en korrekt e-postadress', - badTelephone: 'Du har inte angett ett korrekt telefonnummer', - badSecurityAnswer: 'Du har angett fel svar på säkerhetsfrågan', - badDate: 'Du har anget ett felaktigt datum', - lengthBadStart: 'Ditt svar måste innehålla mellan ', - lengthBadEnd: ' tecken', - lengthTooLongStart: 'Du har angett ett svar som är längre än ', - lengthTooShortStart: 'Du har angett ett svar som är kortare än ', - notConfirmed: 'Svaren kunde inte bekräfta varandra', - badDomain: 'Du har angett en inkorrekt domän', - badUrl: 'Du har inte angett en korrekt webbadress', - badCustomVal: 'Du har anget ett inkorrekt svar', - andSpaces: ' och mellanslag ', - badInt: 'Du har inte angett en siffra', - badSecurityNumber: 'Du har angett ett felaktigt personnummer', - badUKVatAnswer: 'Du har inte angett ett brittiskt moms-nummer', - badStrength: 'Du har angett ett lösenord som inte är nog säkert', - badNumberOfSelectedOptionsStart: 'Du måste åtminstone välja ', - badNumberOfSelectedOptionsEnd: ' svarsalternativ', - badAlphaNumeric: 'Du kan endast svara med alfanumersika tecken (a-z och siffror)', - badAlphaNumericExtra: ' och ', - wrongFileSize: 'Filen du försöker ladda upp är för stor (max %s)', - wrongFileType: 'Endast filer av typen %s är tillåtna', - groupCheckedRangeStart: 'Välj mellan ', - groupCheckedTooFewStart: 'Då måste göra minst ', - groupCheckedTooManyStart: 'Du får inte göra fler än ', - groupCheckedEnd: ' val', - badCreditCard: 'Du har angett ett felaktigt kreditkortsnummer', - badCVV: 'Du har angett ett felaktigt CVV-nummer', - wrongFileDim : 'Otillåten bildstorlek,', - imageTooTall : 'bilden får inte vara högre än', - imageTooWide : 'bilden får inte vara bredare än', - imageTooSmall : 'bilden är för liten', - genericBadInputValue : 'The input value can be accepted', - min : 'minst', - max : 'max', - imageRatioNotAccepted : 'Bildens dimensioner (förhållandet mellan höjd och längd) kan inte accepteras' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/sv"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Formuläret kunde inte skickas!",requiredField:"Detta är ett obligtoriskt fält",requiredFields:"Du har inte besvarat alla frågor",badTime:"Du har inte angett en korrekt tidpunkt",badEmail:"Du har inte angett en korrekt e-postadress",badTelephone:"Du har inte angett ett korrekt telefonnummer",badSecurityAnswer:"Du har angett fel svar på säkerhetsfrågan",badDate:"Du har anget ett felaktigt datum",lengthBadStart:"Ditt svar måste innehålla mellan ",lengthBadEnd:" tecken",lengthTooLongStart:"Du har angett ett svar som är längre än ",lengthTooShortStart:"Du har angett ett svar som är kortare än ",notConfirmed:"Svaren kunde inte bekräfta varandra",badDomain:"Du har angett en inkorrekt domän",badUrl:"Du har inte angett en korrekt webbadress",badCustomVal:"Du har anget ett inkorrekt svar",andSpaces:" och mellanslag ",badInt:"Du har inte angett en siffra",badSecurityNumber:"Du har angett ett felaktigt personnummer",badUKVatAnswer:"Du har inte angett ett brittiskt moms-nummer",badStrength:"Du har angett ett lösenord som inte är nog säkert",badNumberOfSelectedOptionsStart:"Du måste åtminstone välja ",badNumberOfSelectedOptionsEnd:" svarsalternativ",badAlphaNumeric:"Du kan endast svara med alfanumersika tecken (a-z och siffror)",badAlphaNumericExtra:" och ",wrongFileSize:"Filen du försöker ladda upp är för stor (max %s)",wrongFileType:"Endast filer av typen %s är tillåtna",groupCheckedRangeStart:"Välj mellan ",groupCheckedTooFewStart:"Då måste göra minst ",groupCheckedTooManyStart:"Du får inte göra fler än ",groupCheckedEnd:" val",badCreditCard:"Du har angett ett felaktigt kreditkortsnummer",badCVV:"Du har angett ett felaktigt CVV-nummer",wrongFileDim:"Otillåten bildstorlek,",imageTooTall:"bilden får inte vara högre än",imageTooWide:"bilden får inte vara bredare än",imageTooSmall:"bilden är för liten",genericBadInputValue:"The input value can be accepted",min:"minst",max:"max",imageRatioNotAccepted:"Bildens dimensioner (förhållandet mellan höjd och längd) kan inte accepteras"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/tr.js b/form-validator/lang/tr.js index 0e57561..4fc53d3 100644 --- a/form-validator/lang/tr.js +++ b/form-validator/lang/tr.js @@ -1,98 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Turkish language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/tr'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'Form gönderilemedi!', - requiredField: 'Boş bırakılamaz', - requiredFields: 'Gerekli tüm alanları cevaplamadınız', - badTime: 'Geçersiz zaman girdiniz', - badEmail: 'Geçersiz e-posta adresi girdiniz', - badTelephone: 'Geçersiz telefon numarası girdiniz', - badSecurityAnswer: 'Güvenlik sorusuna doğru cevap vermediniz', - badDate: 'Geçersiz tarih girdiniz', - lengthBadStart: 'Girilen değer ', - lengthBadEnd: ' karakter olmalıdır', - lengthTooLongStart: 'Girilen değer en fazla ', - lengthTooShortStart: 'Girilen değer en az ', - notConfirmed: 'Girilen değerler uyuşmuyor', - badDomain: 'Geçersiz alan adı girdiniz', - badUrl: 'Geçersiz bağlantı girdiniz', - badCustomVal: 'Geçersiz değer girdiniz', - andSpaces: ' ve boşluk ', - badInt: 'Girilen değer sayı olamlıdır', - badSecurityNumber: 'Geçersiz güvenlik kodu girdiniz', - badUKVatAnswer: 'Geçersiz İngiltere KDV numarası girdiniz', - badUKNin: 'Geçersiz İngiltere NIN numarası girdiniz', - badUKUtr: 'Geçersiz İngiltere UTR numarası girdiniz', - badStrength: 'Şifreniz yeterince güçlü değil', - badNumberOfSelectedOptionsStart: 'En az ', - badNumberOfSelectedOptionsEnd: ' cevap seçmeniz gerekiyor', - badAlphaNumeric: 'Kabul edilen değer sadece alfanümerik karakterler ', - badAlphaNumericExtra: ' ve ', - wrongFileSize: 'Yüklemeye çalıştığınız dosya (en fazla %s) çok büyük', - wrongFileType: 'Yalnızca %s türündeki dosyaları yükleyebilirsiniz', - groupCheckedRangeStart: 'Lütfen ', - groupCheckedTooFewStart: 'Lütfen en az ', - groupCheckedTooManyStart: 'Lütfen en fazla ', - groupCheckedEnd: ' adet seçiniz', - badCreditCard: 'Geçersiz kredi kartı numarası girdiniz', - badCVV: 'Geçersiz CVV numarası girdiniz', - wrongFileDim: 'Hatalı resim yüklediniz çünkü', - imageTooTall: 'resim daha uzun olamaz', - imageTooWide: 'resim daha geniş olamaz', - imageTooSmall: 'görüntü çok küçük', - min: 'min', - max: 'max', - imageRatioNotAccepted: 'Kabul edilmeye görüntü oranı', - badBrazilTelephoneAnswer: 'Geçersiz telefon numarası girdiniz', - badBrazilCEPAnswer: 'Geçersiz Brezilya posta kodu girdiniz', - badBrazilCPFAnswer: 'Geçersiz Brezilya mükellef kayıt kimliği girdiniz', - badPlPesel: 'Geçersiz Polonya kişisel kimlik numarası girdiniz', - badPlNip: 'Geçersiz DKV girdiniz', - badPlRegon: 'Geçersiz Polonya ticari kimlik numarası girdiniz', - badreCaptcha: 'Lütfen bot olmadığınızı doğrulayın', - passwordComplexityStart: 'Şifreniz en az ', - passwordComplexitySeparator: ', ', - passwordComplexityUppercaseInfo: ' büyük harf', - passwordComplexityLowercaseInfo: ' küçük harf', - passwordComplexitySpecialCharsInfo: ' özel karakter', - passwordComplexityNumericCharsInfo: ' sayısal karakter', - passwordComplexityEnd: ' içermelidir' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/tr"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Form gönderilemedi!",requiredField:"Boş bırakılamaz",requiredFields:"Gerekli tüm alanları cevaplamadınız",badTime:"Geçersiz zaman girdiniz",badEmail:"Geçersiz e-posta adresi girdiniz",badTelephone:"Geçersiz telefon numarası girdiniz",badSecurityAnswer:"Güvenlik sorusuna doğru cevap vermediniz",badDate:"Geçersiz tarih girdiniz",lengthBadStart:"Girilen değer ",lengthBadEnd:" karakter olmalıdır",lengthTooLongStart:"Girilen değer en fazla ",lengthTooShortStart:"Girilen değer en az ",notConfirmed:"Girilen değerler uyuşmuyor",badDomain:"Geçersiz alan adı girdiniz",badUrl:"Geçersiz bağlantı girdiniz",badCustomVal:"Geçersiz değer girdiniz",andSpaces:" ve boşluk ",badInt:"Girilen değer sayı olamlıdır",badSecurityNumber:"Geçersiz güvenlik kodu girdiniz",badUKVatAnswer:"Geçersiz İngiltere KDV numarası girdiniz",badUKNin:"Geçersiz İngiltere NIN numarası girdiniz",badUKUtr:"Geçersiz İngiltere UTR numarası girdiniz",badStrength:"Şifreniz yeterince güçlü değil",badNumberOfSelectedOptionsStart:"En az ",badNumberOfSelectedOptionsEnd:" cevap seçmeniz gerekiyor",badAlphaNumeric:"Kabul edilen değer sadece alfanümerik karakterler ",badAlphaNumericExtra:" ve ",wrongFileSize:"Yüklemeye çalıştığınız dosya (en fazla %s) çok büyük",wrongFileType:"Yalnızca %s türündeki dosyaları yükleyebilirsiniz",groupCheckedRangeStart:"Lütfen ",groupCheckedTooFewStart:"Lütfen en az ",groupCheckedTooManyStart:"Lütfen en fazla ",groupCheckedEnd:" adet seçiniz",badCreditCard:"Geçersiz kredi kartı numarası girdiniz",badCVV:"Geçersiz CVV numarası girdiniz",wrongFileDim:"Hatalı resim yüklediniz çünkü",imageTooTall:"resim daha uzun olamaz",imageTooWide:"resim daha geniş olamaz",imageTooSmall:"görüntü çok küçük",min:"min",max:"max",imageRatioNotAccepted:"Kabul edilmeye görüntü oranı",badBrazilTelephoneAnswer:"Geçersiz telefon numarası girdiniz",badBrazilCEPAnswer:"Geçersiz Brezilya posta kodu girdiniz",badBrazilCPFAnswer:"Geçersiz Brezilya mükellef kayıt kimliği girdiniz",badPlPesel:"Geçersiz Polonya kişisel kimlik numarası girdiniz",badPlNip:"Geçersiz DKV girdiniz",badPlRegon:"Geçersiz Polonya ticari kimlik numarası girdiniz",badreCaptcha:"Lütfen bot olmadığınızı doğrulayın",passwordComplexityStart:"Şifreniz en az ",passwordComplexitySeparator:", ",passwordComplexityUppercaseInfo:" büyük harf",passwordComplexityLowercaseInfo:" küçük harf",passwordComplexitySpecialCharsInfo:" özel karakter",passwordComplexityNumericCharsInfo:" sayısal karakter",passwordComplexityEnd:" içermelidir"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/lang/vi.js b/form-validator/lang/vi.js index 3815167..02f19f0 100644 --- a/form-validator/lang/vi.js +++ b/form-validator/lang/vi.js @@ -1,81 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator - * ------------------------------------------ +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * Vietnamese language package - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('lang/vi'); - - $(window).bind('validatorsLoaded', function() { - - $.formUtils.LANG = { - errorTitle: 'Có lỗi trong qua trình gửi dữ liệu!', - requiredFields: 'Bạn chưa nhập đủ các thông tin bắt buộc', - badTime: 'Thời gian chưa chính xác', - badEmail: 'Địa chỉ email chưa chính xác', - badTelephone: 'Số điện thoại chưa chính xác', - badSecurityAnswer: 'Câu hỏi bảo mật chưa chính xác', - badDate: 'Ngày tháng chưa chính xác', - lengthBadStart: 'Yêu cầu nhập từ ', - lengthBadEnd: ' ký tự', - lengthTooLongStart: 'Dữ liệu quá dài, yêu cầu ít hơn ', - lengthTooShortStart: 'Dữ liệu quá ngắn, yêu cầu nhiều hơn ', - notConfirmed: 'Dữ liệu không được xác nhận', - badDomain: 'Tên miền chưa chính xác', - badUrl: 'Địa chỉ website chưa chính xác', - badCustomVal: 'Dữ liệu chưa chính xác', - andSpaces: ' và các khoảng cách ', - badInt: 'Yêu cầu chỉ nhập số', - badSecurityNumber: 'Mã bảo mật chưa chính xác', - badUKVatAnswer: 'UK VAT chưa chính xác', - badStrength: 'Mật khẩu chưa đủ độ phức tạp', - badNumberOfSelectedOptionsStart: 'Bạn cần tích chọn ít nhất ', - badNumberOfSelectedOptionsEnd: ' lựa chọn', - badAlphaNumeric: 'Yêu cầu chỉ nhập chữ hoặc số ', - badAlphaNumericExtra: ' và ', - wrongFileSize: 'File của bạn quá lớn (chỉ chấp nhận file không quá %s)', - wrongFileType: 'Chỉ cho phép các định dạng file sau: %s', - groupCheckedRangeStart: 'Vui lòng tích chọn từ ', - groupCheckedTooFewStart: 'Vui lòng tích chọn ít nhất ', - groupCheckedTooManyStart: 'Vui lòng tích chọn nhiều nhất ', - groupCheckedEnd: ' lựa chọn', - badCreditCard: 'Mã thẻ chưa chính xác', - badCVV: 'Mã bảo mật (CVV) chưa chính xác', - wrongFileDim: 'Kích thước ảnh chưa chính xác,', - imageTooTall: 'Chiều cao ảnh không được vượt quá', - imageTooWide: 'Chiều rộng ảnh không được vượt quá', - imageTooSmall: 'Kích thước ảnh quá nhỏ', - min: 'nhỏ nhất', - max: 'lớn nhất', - imageRatioNotAccepted: 'Tỷ lệ ảnh chưa chính xác' - }; - - }); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("lang/vi"),a(b).bind("validatorsLoaded",function(){a.formUtils.LANG={errorTitle:"Có lỗi trong qua trình gửi dữ liệu!",requiredFields:"Bạn chưa nhập đủ các thông tin bắt buộc",badTime:"Thời gian chưa chính xác",badEmail:"Địa chỉ email chưa chính xác",badTelephone:"Số điện thoại chưa chính xác",badSecurityAnswer:"Câu hỏi bảo mật chưa chính xác",badDate:"Ngày tháng chưa chính xác",lengthBadStart:"Yêu cầu nhập từ ",lengthBadEnd:" ký tự",lengthTooLongStart:"Dữ liệu quá dài, yêu cầu ít hơn ",lengthTooShortStart:"Dữ liệu quá ngắn, yêu cầu nhiều hơn ",notConfirmed:"Dữ liệu không được xác nhận",badDomain:"Tên miền chưa chính xác",badUrl:"Địa chỉ website chưa chính xác",badCustomVal:"Dữ liệu chưa chính xác",andSpaces:" và các khoảng cách ",badInt:"Yêu cầu chỉ nhập số",badSecurityNumber:"Mã bảo mật chưa chính xác",badUKVatAnswer:"UK VAT chưa chính xác",badStrength:"Mật khẩu chưa đủ độ phức tạp",badNumberOfSelectedOptionsStart:"Bạn cần tích chọn ít nhất ",badNumberOfSelectedOptionsEnd:" lựa chọn",badAlphaNumeric:"Yêu cầu chỉ nhập chữ hoặc số ",badAlphaNumericExtra:" và ",wrongFileSize:"File của bạn quá lớn (chỉ chấp nhận file không quá %s)",wrongFileType:"Chỉ cho phép các định dạng file sau: %s",groupCheckedRangeStart:"Vui lòng tích chọn từ ",groupCheckedTooFewStart:"Vui lòng tích chọn ít nhất ",groupCheckedTooManyStart:"Vui lòng tích chọn nhiều nhất ",groupCheckedEnd:" lựa chọn",badCreditCard:"Mã thẻ chưa chính xác",badCVV:"Mã bảo mật (CVV) chưa chính xác",wrongFileDim:"Kích thước ảnh chưa chính xác,",imageTooTall:"Chiều cao ảnh không được vượt quá",imageTooWide:"Chiều rộng ảnh không được vượt quá",imageTooSmall:"Kích thước ảnh quá nhỏ",min:"nhỏ nhất",max:"lớn nhất",imageRatioNotAccepted:"Tỷ lệ ảnh chưa chính xác"}})}(a,window)}); \ No newline at end of file diff --git a/form-validator/location.js b/form-validator/location.js index 149d572..0598731 100644 --- a/form-validator/location.js +++ b/form-validator/location.js @@ -1,101 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator Module: Date - * ------------------------------------------ - * Created by Victor Jonsson +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * The following validators will be added by this module: - * - Country - * - US state - * - longitude and latitude - * - * @website http://formvalidator.net/#location-validators - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function ($) { - - $.formUtils.registerLoadedModule('location'); - - /* - * Validate that country exists - */ - $.formUtils.addValidator({ - name: 'country', - validatorFunction: function (str) { - return $.inArray(str.toLowerCase(), this.countries) > -1; - }, - countries: ['afghanistan', 'albania', 'algeria', 'american samoa', 'andorra', 'angola', 'anguilla', 'antarctica', 'antigua and barbuda', 'argentina', 'armenia', 'aruba', 'australia', 'austria', 'azerbaijan', 'bahamas', 'bahrain', 'bangladesh', 'barbados', 'belarus', 'belgium', 'belize', 'benin', 'bermuda', 'bhutan', 'bolivia', 'bonaire', 'bosnia and herzegovina', 'botswana', 'bouvet island', 'brazil', 'british indian ocean territory', 'brunei darussalam', 'bulgaria', 'burkina faso', 'burundi', 'cabo verde', 'cambodia', 'cameroon', 'canada', 'cayman islands', 'central african republic', 'chad', 'chile', 'china', 'christmas island', 'cocos islands', 'colombia', 'comoros', 'democratic republic of the congo', 'congo', 'cook islands', 'costa rica', 'côte d\'ivoire', 'croatia', 'cuba', 'curaçao', 'cyprus', 'czechia', 'denmark', 'djibouti', 'dominica', 'dominican republic', 'ecuador', 'egypt', 'el salvador', 'equatorial guinea', 'eritrea', 'estonia', 'ethiopia', 'falkland islands', 'faroe islands', 'fiji', 'finland', 'france', 'french guiana', 'french polynesia', 'french southern territories', 'gabon', 'gambia', 'georgia', 'germany', 'ghana', 'gibraltar', 'greece', 'greenland', 'grenada', 'guadeloupe', 'guam', 'guatemala', 'guernsey', 'guinea', 'guinea-bissau', 'guyana', 'haiti', 'heard island and mcdonald islands', 'honduras', 'hong kong', 'hungary', 'iceland', 'india', 'indonesia', 'iran', 'iraq', 'ireland', 'isle of man', 'israel', 'italy', 'jamaica', 'japan', 'jersey', 'jordan', 'kazakhstan', 'kenya', 'kiribati', 'north korea', 'south korea', 'kuwait', 'kyrgyzstan', 'laos', 'latvia', 'lebanon', 'lesotho', 'liberia', 'libya', 'liechtenstein', 'lithuania', 'luxembourg', 'macao', 'macedonia', 'madagascar', 'malawi', 'malaysia', 'maldives', 'mali', 'malta', 'marshall islands', 'martinique', 'mauritania', 'mauritius', 'mayotte', 'mexico', 'micronesia', 'moldova', 'monaco', 'mongolia', 'montenegro', 'montserrat', 'morocco', 'mozambique', 'myanmar', 'namibia', 'nauru', 'nepal', 'netherlands', 'new caledonia', 'new zealand', 'nicaragua', 'niger', 'nigeria', 'niue', 'norfolk island', 'northern mariana islands', 'norway', 'oman', 'pakistan', 'palau', 'palestine', 'panama', 'papua new guinea', 'paraguay', 'peru', 'philippines', 'pitcairn', 'poland', 'portugal', 'puerto rico', 'qatar', 'réunion', 'romania', 'russia', 'rwanda', 'saint barthélemy', 'saint helena', 'ascension and tristan da cunha', 'Ascension and tristan da cunha', 'saint kitts and nevis', 'saint lucia', 'saint martin', 'saint pierre and miquelon', 'saint vincent and the grenadines', 'samoa', 'san marino', 'sao tome and principe', 'saudi arabia', 'senegal', 'serbia', 'seychelles', 'sierra leone', 'singapore', 'sint maarten', 'slovakia', 'slovenia', 'solomon islands', 'somalia', 'south africa', 'south georgia and the south sandwich islands', 'south sudan', 'spain', 'sri lanka', 'sudan', 'suriname', 'svalbard and jan mayen', 'swaziland', 'sweden', 'switzerland', 'syria', 'taiwan', 'tajikistan', 'tanzania', 'thailand', 'timor-leste', 'togo', 'tokelau', 'tonga', 'trinidad and tobago', 'tunisia', 'turkey', 'turkmenistan', 'turks and caicos islands', 'tuvalu', 'uganda', 'ukraine', 'united arab emirates', 'united kingdom', 'united states minor outlying islands', 'united states', 'uruguay', 'uzbekistan', 'vanuatu', 'venezuela', 'vatican city', 'vietnam', 'virgin islands (british)', 'virgin islands (us)', 'wallis and futuna', 'western sahara', 'yemen', 'zambia', 'zimbabwe', 'åland islands'], - errorMessage: '', - errorMessageKey: 'badCustomVal' - }); - - /* - * Is this a valid federate state in the US - */ - $.formUtils.addValidator({ - name: 'federatestate', - validatorFunction: function (str) { - return $.inArray(str.toLowerCase(), this.states) > -1; - }, - states: ['alabama', 'alaska', 'arizona', 'arkansas', 'california', 'colorado', 'connecticut', 'delaware', 'florida', 'georgia', 'hawaii', 'idaho', 'illinois', 'indiana', 'iowa', 'kansas', 'kentucky', 'louisiana', 'maine', 'maryland', 'district of columbia', 'massachusetts', 'michigan', 'minnesota', 'mississippi', 'missouri', 'montana', 'nebraska', 'nevada', 'new hampshire', 'new jersey', 'new mexico', 'new york', 'north carolina', 'north dakota', 'ohio', 'oklahoma', 'oregon', 'pennsylvania', 'rhode island', 'south carolina', 'south dakota', 'tennessee', 'texas', 'utah', 'vermont', 'virginia', 'washington', 'west virginia', 'wisconsin', 'wyoming'], - errorMessage: '', - errorMessageKey: 'badCustomVal' - }); - - - $.formUtils.addValidator({ - name: 'longlat', - validatorFunction: function (str) { - var regexp = /^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/; - return regexp.test(str); - }, - errorMessage: '', - errorMessageKey: 'badCustomVal' - }); - - /** - * @private - * @param {Array} listItems - * @return {Array} - */ - var _makeSortedList = function (listItems) { - var newList = []; - $.each(listItems, function (i, value) { - newList.push(value.substr(0, 1).toUpperCase() + value.substr(1, value.length)); - }); - newList.sort(); - return newList; - }; - - $.fn.suggestCountry = function (settings) { - var countries = _makeSortedList($.formUtils.validators.validate_country.countries), - usaIndex = $.inArray(countries, 'Usa'); - - countries[usaIndex] = 'USA'; - return $.formUtils.suggest(this, countries, settings); - }; - - $.fn.suggestState = function (settings) { - var states = _makeSortedList($.formUtils.validators.validate_federatestate.states); - return $.formUtils.suggest(this, states, settings); - }; - -})(jQuery); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){a.formUtils.registerLoadedModule("location"),a.formUtils.addValidator({name:"country",validatorFunction:function(b){return a.inArray(b.toLowerCase(),this.countries)>-1},countries:["afghanistan","albania","algeria","american samoa","andorra","angola","anguilla","antarctica","antigua and barbuda","argentina","armenia","aruba","australia","austria","azerbaijan","bahamas","bahrain","bangladesh","barbados","belarus","belgium","belize","benin","bermuda","bhutan","bolivia","bonaire","bosnia and herzegovina","botswana","bouvet island","brazil","british indian ocean territory","brunei darussalam","bulgaria","burkina faso","burundi","cabo verde","cambodia","cameroon","canada","cayman islands","central african republic","chad","chile","china","christmas island","cocos islands","colombia","comoros","democratic republic of the congo","congo","cook islands","costa rica","côte d'ivoire","croatia","cuba","curaçao","cyprus","czechia","denmark","djibouti","dominica","dominican republic","ecuador","egypt","el salvador","equatorial guinea","eritrea","estonia","ethiopia","falkland islands","faroe islands","fiji","finland","france","french guiana","french polynesia","french southern territories","gabon","gambia","georgia","germany","ghana","gibraltar","greece","greenland","grenada","guadeloupe","guam","guatemala","guernsey","guinea","guinea-bissau","guyana","haiti","heard island and mcdonald islands","honduras","hong kong","hungary","iceland","india","indonesia","iran","iraq","ireland","isle of man","israel","italy","jamaica","japan","jersey","jordan","kazakhstan","kenya","kiribati","north korea","south korea","kuwait","kyrgyzstan","laos","latvia","lebanon","lesotho","liberia","libya","liechtenstein","lithuania","luxembourg","macao","macedonia","madagascar","malawi","malaysia","maldives","mali","malta","marshall islands","martinique","mauritania","mauritius","mayotte","mexico","micronesia","moldova","monaco","mongolia","montenegro","montserrat","morocco","mozambique","myanmar","namibia","nauru","nepal","netherlands","new caledonia","new zealand","nicaragua","niger","nigeria","niue","norfolk island","northern mariana islands","norway","oman","pakistan","palau","palestine","panama","papua new guinea","paraguay","peru","philippines","pitcairn","poland","portugal","puerto rico","qatar","réunion","romania","russia","rwanda","saint barthélemy","saint helena","ascension and tristan da cunha","Ascension and tristan da cunha","saint kitts and nevis","saint lucia","saint martin","saint pierre and miquelon","saint vincent and the grenadines","samoa","san marino","sao tome and principe","saudi arabia","senegal","serbia","seychelles","sierra leone","singapore","sint maarten","slovakia","slovenia","solomon islands","somalia","south africa","south georgia and the south sandwich islands","south sudan","spain","sri lanka","sudan","suriname","svalbard and jan mayen","swaziland","sweden","switzerland","syria","taiwan","tajikistan","tanzania","thailand","timor-leste","togo","tokelau","tonga","trinidad and tobago","tunisia","turkey","turkmenistan","turks and caicos islands","tuvalu","uganda","ukraine","united arab emirates","united kingdom","united states minor outlying islands","united states","uruguay","uzbekistan","vanuatu","venezuela","vatican city","vietnam","virgin islands (british)","virgin islands (us)","wallis and futuna","western sahara","yemen","zambia","zimbabwe","åland islands"],errorMessage:"",errorMessageKey:"badCustomVal"}),a.formUtils.addValidator({name:"federatestate",validatorFunction:function(b){return a.inArray(b.toLowerCase(),this.states)>-1},states:["alabama","alaska","arizona","arkansas","california","colorado","connecticut","delaware","florida","georgia","hawaii","idaho","illinois","indiana","iowa","kansas","kentucky","louisiana","maine","maryland","district of columbia","massachusetts","michigan","minnesota","mississippi","missouri","montana","nebraska","nevada","new hampshire","new jersey","new mexico","new york","north carolina","north dakota","ohio","oklahoma","oregon","pennsylvania","rhode island","south carolina","south dakota","tennessee","texas","utah","vermont","virginia","washington","west virginia","wisconsin","wyoming"],errorMessage:"",errorMessageKey:"badCustomVal"}),a.formUtils.addValidator({name:"longlat",validatorFunction:function(a){var b=/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/;return b.test(a)},errorMessage:"",errorMessageKey:"badCustomVal"});var b=function(b){var c=[];return a.each(b,function(a,b){c.push(b.substr(0,1).toUpperCase()+b.substr(1,b.length))}),c.sort(),c};a.fn.suggestCountry=function(c){var d=b(a.formUtils.validators.validate_country.countries),e=a.inArray(d,"Usa");return d[e]="USA",a.formUtils.suggest(this,d,c)},a.fn.suggestState=function(c){var d=b(a.formUtils.validators.validate_federatestate.states);return a.formUtils.suggest(this,d,c)}}(a)}); \ No newline at end of file diff --git a/form-validator/logic.js b/form-validator/logic.js index 3d57539..3656f0c 100644 --- a/form-validator/logic.js +++ b/form-validator/logic.js @@ -1,161 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator Module: Logic - * ------------------------------------------ - * Created by Victor Jonsson +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * - data-validation-depends-on - * - data-validation-if-answered - * - * @website http://formvalidator.net/#logic - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($) { - - 'use strict'; - - $.formUtils.registerLoadedModule('logic'); - - var setupValidationDependsOn = function($form, conf) { - - var dependingOnBeforeValidation = function() { - - var $input = $(this), - nameOfDependingInput = $input.valAttr('depends-on') || $input.valAttr('if-checked'); - - // Whether or not this input should be validated depends on if another input has a value - if (nameOfDependingInput) { - - // Set the boolean telling us that the validation depends - // on another input being checked - var valueOfDependingInput = $.formUtils.getValue('[name="' + nameOfDependingInput + '"]', $form), - listWithRequiredValues = $.split($input.valAttr('depends-on-value'), false, false), - dependingInputIsMissingValueOrHasIncorrectValue = !valueOfDependingInput || ( - listWithRequiredValues.length && - !valueIsInList(valueOfDependingInput, listWithRequiredValues) - ); - - if (dependingInputIsMissingValueOrHasIncorrectValue) { - $input.valAttr('skipped', '1'); - } - } - }, - valueIsInList = function(value, valueList) { - var isInList = false, - lowerCaseValue = value.toLocaleLowerCase(); - - $.each(valueList, function(i, otherValue) { - if (lowerCaseValue === otherValue.toLocaleLowerCase()) { - isInList = true; - return false; - } - }); - return isInList; - }, - dependingOnValueChanged = function() { - var $input = $(this), - inputValue = $.formUtils.getValue($input), - requiredValueOfDependingInput = $input.valAttr('depending-value'); - $.each(this.dependingInputs, function (i, $otherInput) { - var otherInputHasValue = $.formUtils.getValue($otherInput) ? true:false, - dependingInputIsMissingValueOrHasIncorrectValue = !inputValue || ( - requiredValueOfDependingInput && - requiredValueOfDependingInput !== inputValue - ); - - if (dependingInputIsMissingValueOrHasIncorrectValue && !otherInputHasValue) { - $.formUtils.dialogs.removeInputStylingAndMessage($otherInput, conf); - } - }); - }; - - $form.find('[data-validation-depends-on]') - .off('beforeValidation', dependingOnBeforeValidation) - .on('beforeValidation', dependingOnBeforeValidation) - .each(function() { - // Remove validation when on depending input - var $dependingInput = $(this); - $form.find('[name="'+$dependingInput.valAttr('depends-on')+'"]').each(function() { - $(this) - .off('change', dependingOnValueChanged) - .on('change', dependingOnValueChanged) - .valAttr('depending-value', $dependingInput.valAttr('depends-on-value')); - - this.dependingInputs = this.dependingInputs || []; - this.dependingInputs.push($dependingInput); - }); - }); - - }, - setupValidationTogetherWith = function($form, conf) { - - var optionalBeforeValidation = function() { - var $input = $(this), - dependingInputs = $input.valAttr('optional-if-answered'), - dependingInputsHasValue = false, - thisInputHasAnswer = $.formUtils.getValue($input) ? true:false; - - if (!thisInputHasAnswer) { - $.each($.split(dependingInputs), function(i, inputName) { - var $dependingInput = $form.find('[name="'+inputName+'"]'); - dependingInputsHasValue = $.formUtils.getValue($dependingInput) ? true:false; - if (dependingInputsHasValue) { - return false; - } - }); - - if (dependingInputsHasValue) { - $input.valAttr('skipped', 1); - } - } - }, - optionalInputOnChange = function() { - var $input = $(this), - dependingInputs = $input.valAttr('optional-if-answered'); - - $.each($.split(dependingInputs), function(i, inputName) { - var $dependingInput = $form.find('[name="'+inputName+'"]'), - dependingInputsHasValue = $.formUtils.getValue($dependingInput) ? true:false; - if (!dependingInputsHasValue) { - $.formUtils.dialogs.removeInputStylingAndMessage($dependingInput, conf); - } - }); - }; - - $form.find('[data-validation-optional-if-answered]') - .off('beforeValidation', optionalBeforeValidation) - .on('beforeValidation', optionalBeforeValidation) - .each(function() { - $(this) - .off('change', optionalInputOnChange) - .on('change', optionalInputOnChange); - }); - }; - - $.formUtils.$win.bind('validatorsLoaded formValidationSetup', function(evt, $form, conf) { - if( !$form ) { - $form = $('form'); - } - setupValidationDependsOn($form, conf); - setupValidationTogetherWith($form, conf); - }); - -})(jQuery); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){"use strict";a.formUtils.registerLoadedModule("logic");var b=function(b,c){var d=function(){var c=a(this),d=c.valAttr("depends-on")||c.valAttr("if-checked");if(d){var f=a.formUtils.getValue('[name="'+d+'"]',b),g=a.split(c.valAttr("depends-on-value"),!1,!1),h=!f||g.length&&!e(f,g);h&&c.valAttr("skipped","1")}},e=function(b,c){var d=!1,e=b.toLocaleLowerCase();return a.each(c,function(a,b){if(e===b.toLocaleLowerCase())return d=!0,!1}),d},f=function(){var b=a(this),d=a.formUtils.getValue(b),e=b.valAttr("depending-value");a.each(this.dependingInputs,function(b,f){var g=!!a.formUtils.getValue(f),h=!d||e&&e!==d;h&&!g&&a.formUtils.dialogs.removeInputStylingAndMessage(f,c)})};b.find("[data-validation-depends-on]").off("beforeValidation",d).on("beforeValidation",d).each(function(){var c=a(this);b.find('[name="'+c.valAttr("depends-on")+'"]').each(function(){a(this).off("change",f).on("change",f).valAttr("depending-value",c.valAttr("depends-on-value")),this.dependingInputs=this.dependingInputs||[],this.dependingInputs.push(c)})})},c=function(b,c){var d=function(){var c=a(this),d=c.valAttr("optional-if-answered"),e=!1,f=!!a.formUtils.getValue(c);f||(a.each(a.split(d),function(c,d){var f=b.find('[name="'+d+'"]');if(e=!!a.formUtils.getValue(f))return!1}),e&&c.valAttr("skipped",1))},e=function(){var d=a(this),e=d.valAttr("optional-if-answered");a.each(a.split(e),function(d,e){var f=b.find('[name="'+e+'"]'),g=!!a.formUtils.getValue(f);g||a.formUtils.dialogs.removeInputStylingAndMessage(f,c)})};b.find("[data-validation-optional-if-answered]").off("beforeValidation",d).on("beforeValidation",d).each(function(){a(this).off("change",e).on("change",e)})};a.formUtils.$win.bind("validatorsLoaded formValidationSetup",function(d,e,f){e||(e=a("form")),b(e,f),c(e,f)})}(a)}); \ No newline at end of file diff --git a/form-validator/poland.js b/form-validator/poland.js index 95e44cb..e66f470 100644 --- a/form-validator/poland.js +++ b/form-validator/poland.js @@ -1,136 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator Module: Poland - * ------------------------------------------ - * Created by simivar +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * This form validation module adds validators typically used on - * websites in Poland. This module adds the following validators: - * - plpesel - * - * @website http://formvalidator.net/#poland-validators - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($) { - - $.formUtils.registerLoadedModule('poland'); - - /** - * PL PESEL - polish personal identity number (in Polish identity cards) validator - */ - $.formUtils.addValidator({ - name: 'plpesel', - validatorFunction: function(pesel){ - var weights = [1, 3, 7, 9, 1, 3, 7, 9, 1, 3], - checkSum = 0, checkDigit = 0; - - if( /\d{11}/.test( pesel ) && pesel.length === 11 ){ - for (var i = 0; i < 10; i++) { - checkSum += pesel[ i ] * weights[ i ]; - } - - if( checkSum % 10 !== 0 ){ - checkDigit = 10 - (checkSum % 10); - } - - if( parseInt( pesel.charAt( 10 ) ) === checkDigit ){ - return true; - } - } - - return false; - }, - errorMessage: '', - errorMessageKey: 'badPlPesel' - }); - - /** - * PL NIP - polish VAT identification number validator - */ - $.formUtils.addValidator({ - name: 'plnip', - validatorFunction: function(nip){ - var weights = [6, 5, 7, 2, 3, 4, 5, 6, 7], - checkSum = 0; - - if( /\d{10}/.test( nip ) && nip.length === 10 ){ - for (var i = 0; i < 9; i++) { - checkSum += nip[ i ] * weights[ i ]; - } - - if( parseInt( nip.charAt( 9 ) ) === checkSum % 11 ){ - return true; - } - } - - return false; - }, - errorMessage: '', - errorMessageKey: 'badPlNip' - }); - - /** - * PL REGON - polish bussiness identity number validator - */ - $.formUtils.addValidator({ - name: 'plregon', - validatorFunction: function(regon){ - var weightsNine = [8, 9, 2, 3, 4, 5, 6, 7], - weightsFourteen = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8], - checkSum = 0, checkDigit = 0; - - if( /(\d{14}|\d{9})/.test( regon ) && ( regon.length === 9 || regon.length === 14 ) ){ - for (var i = 0; i < 8; i++) { - checkSum += regon[ i ] * weightsNine[ i ]; - } - - if( checkSum % 11 !== 10 ){ - checkDigit = checkSum % 11; - } - - if( parseInt( regon.charAt( 8 ) ) === checkDigit ){ - if( regon.length === 14 ){ - checkSum = 0; - - for (i = 0; i < 13; i++) { - checkSum += regon[ i ] * weightsFourteen[ i ]; - } - - if( checkSum % 11 !== 10 ){ - checkDigit = checkSum % 11; - } - - if( parseInt( regon.charAt( 13 ) ) === checkDigit ){ - return true; - } - } else { - return true; - } - } - } - - return false; - }, - errorMessage: '', - errorMessageKey: 'badPlRegon' - }); - -})(jQuery); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){a.formUtils.registerLoadedModule("poland"),a.formUtils.addValidator({name:"plpesel",validatorFunction:function(a){var b=[1,3,7,9,1,3,7,9,1,3],c=0,d=0;if(/\d{11}/.test(a)&&11===a.length){for(var e=0;e<10;e++)c+=a[e]*b[e];if(c%10!==0&&(d=10-c%10),parseInt(a.charAt(10))===d)return!0}return!1},errorMessage:"",errorMessageKey:"badPlPesel"}),a.formUtils.addValidator({name:"plnip",validatorFunction:function(a){var b=[6,5,7,2,3,4,5,6,7],c=0;if(/\d{10}/.test(a)&&10===a.length){for(var d=0;d<9;d++)c+=a[d]*b[d];if(parseInt(a.charAt(9))===c%11)return!0}return!1},errorMessage:"",errorMessageKey:"badPlNip"}),a.formUtils.addValidator({name:"plregon",validatorFunction:function(a){var b=[8,9,2,3,4,5,6,7],c=[2,4,8,5,0,9,7,3,6,1,2,4,8],d=0,e=0;if(/(\d{14}|\d{9})/.test(a)&&(9===a.length||14===a.length)){for(var f=0;f<8;f++)d+=a[f]*b[f];if(d%11!==10&&(e=d%11),parseInt(a.charAt(8))===e){if(14!==a.length)return!0;for(d=0,f=0;f<13;f++)d+=a[f]*c[f];if(d%11!==10&&(e=d%11),parseInt(a.charAt(13))===e)return!0}}return!1},errorMessage:"",errorMessageKey:"badPlRegon"})}(a)}); \ No newline at end of file diff --git a/form-validator/sanitize.js b/form-validator/sanitize.js index e65f9b1..3bfc959 100644 --- a/form-validator/sanitize.js +++ b/form-validator/sanitize.js @@ -1,242 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator Module: sanitize - * ------------------------------------------ - * Created by Victor Jonsson +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * This module makes it possible to add sanitation functions to - * inputs. The functions is triggered on blur. Example: - * - * - * - * Available functions are: - * - uppercase - * - lowercase - * - capitalize - * - trim - * - trimLeft - * - trimRight - * - numberFormat - * - insertLeft - * - insertRight - * - strip - * - escape (replace <, >, &, ' and " with HTML entities) - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window) { - - 'use strict'; - - $.formUtils.addSanitizer({ - name : 'upper', - sanitizerFunction : function(val) { - return val.toLocaleUpperCase(); - } - }); - - $.formUtils.addSanitizer({ - name : 'lower', - sanitizerFunction : function(val) { - return val.toLocaleLowerCase(); - } - }); - - $.formUtils.addSanitizer({ - name : 'trim', - sanitizerFunction : function(val) { - return $.trim(val); - } - }); - - $.formUtils.addSanitizer({ - name : 'trimLeft', - sanitizerFunction : function(val) { - return val.replace(/^\s+/,''); - } - }); - - $.formUtils.addSanitizer({ - name : 'trimRight', - sanitizerFunction : function(val) { - return val.replace(/\s+$/,''); - } - }); - - $.formUtils.addSanitizer({ - name : 'capitalize', - sanitizerFunction : function(val) { - var words = val.split(' '); - $.each(words, function(i, word) { - words[i] = word.substr(0,1).toUpperCase() + word.substr(1, word.length); - }); - return words.join(' '); - } - }); - - $.formUtils.addSanitizer({ - name : 'insert', - sanitizerFunction : function(val, $input, pos) { - var extra = ($input.attr('data-sanitize-insert-'+pos) || '').replace(/\[SPACE\]/g, ' '); - if ( (pos === 'left' && val.indexOf(extra) === 0) || (pos === 'right' && val.substring(val.length - extra.length) === extra)) { - return val; - } - return (pos === 'left' ? extra:'') + val + (pos === 'right' ? extra : ''); - } - }); - - $.formUtils.addSanitizer({ - name : 'insertRight', - sanitizerFunction : function(val, $input) { - return $.formUtils.sanitizers.insert.sanitizerFunction(val, $input, 'right'); - } - }); - - $.formUtils.addSanitizer({ - name : 'insertLeft', - sanitizerFunction : function(val, $input) { - return $.formUtils.sanitizers.insert.sanitizerFunction(val, $input, 'left'); - } - }); - - $.formUtils.addSanitizer({ - name : 'numberFormat', - sanitizerFunction : function(val, $input) { - if (val.length === 0) { - return val; - } - if ( 'numeral' in window ) { - //If this has been previously formatted, it needs to be unformatted first before being reformatted. - //Else numeral will fail - val = numeral().unformat(val); - val = numeral(val).format( $input.attr('data-sanitize-number-format') ); - } - else { - throw new ReferenceError('Using sanitation function "numberFormat" requires that you include numeral.js ' + - '(http://numeraljs.com/)'); - } - return val; - } - }); - - $.formUtils.addSanitizer({ - name : 'strip', - sanitizerFunction : function(val, $input) { - var toRemove = $input.attr('data-sanitize-strip') || ''; - $.split(toRemove, function(char) { - var regex = new RegExp($.isNumeric(char) ? char : '\\'+char, 'g'); - val = val.replace(regex, ''); - }); - return val; - } - }); - - $.formUtils.addSanitizer({ - name : 'escape', - sanitizerFunction : function(val, $input) { - var isEscaped = $input.valAttr('is-escaped'), - entities = { - '<' : '__%AMP%__lt;', - '>' : '__%AMP%__gt;', - '&' : '__%AMP%__amp;', - '\'': '__%AMP%__#8217;', - '"' : '__%AMP%__quot;' - }; - - if (isEscaped === 'yes') { - return val; - } - - $input.valAttr('is-escaped', 'yes'); - $input.one('keyup', function(evt) { - if(evt.keyCode !== 9) { - $input.valAttr('is-escaped', 'no'); - } - }); - - $.each(entities, function(symbol, replacement) { - val = val.replace(new RegExp(symbol, 'g'), replacement); - }); - - return val.replace(new RegExp('__\%AMP\%__', 'g'), '&'); - } - }); - - $.formUtils.registerLoadedModule('sanitize'); - - var inputsThatCantBeSanitized = '[type="button"], [type="submit"], [type="radio"], [type="checkbox"], [type="reset"], [type="search"]', - setupSanitation = function(evt, $forms, config) { - - if ( !$forms ) { - $forms = $('form'); - } - if ( !$forms.each ) { - $forms = $($forms); - } - - var execSanitationCommands = function() { - - var $input = $(this), - value = $input.val(); - $.split($input.attr('data-sanitize'), function(command) { - - var sanitizer = $.formUtils.sanitizers[command]; - - if (sanitizer) { - value = sanitizer.sanitizerFunction(value, $input, config); - } else { - throw new Error('Use of unknown sanitize command "'+command+'"'); - } - - }); - $input - .val(value) - .trigger('keyup.validation'); // we need to re-validate in case it gets validated on blur - }; - - $forms.each(function() { - var $form = $(this); - if( config.sanitizeAll ) { - $form.find('input,textarea').not(inputsThatCantBeSanitized).each(function() { - var $input = $(this), - sanitation = $input.attr('data-sanitize') || ''; - $input.attr('data-sanitize', config.sanitizeAll +' '+ sanitation); - }); - } - - $form.find('[data-sanitize]') - .unbind('blur.sanitation', execSanitationCommands) - .bind('blur.sanitation', execSanitationCommands); - - $(function() { - $form.trigger('blur.sanitation'); - }); - - }); - }; - - $(window).on('validatorsLoaded formValidationSetup', setupSanitation); - - // Only for unit testing - $.formUtils.setupSanitation = setupSanitation; - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.addSanitizer({name:"upper",sanitizerFunction:function(a){return a.toLocaleUpperCase()}}),a.formUtils.addSanitizer({name:"lower",sanitizerFunction:function(a){return a.toLocaleLowerCase()}}),a.formUtils.addSanitizer({name:"trim",sanitizerFunction:function(b){return a.trim(b)}}),a.formUtils.addSanitizer({name:"trimLeft",sanitizerFunction:function(a){return a.replace(/^\s+/,"")}}),a.formUtils.addSanitizer({name:"trimRight",sanitizerFunction:function(a){return a.replace(/\s+$/,"")}}),a.formUtils.addSanitizer({name:"capitalize",sanitizerFunction:function(b){var c=b.split(" ");return a.each(c,function(a,b){c[a]=b.substr(0,1).toUpperCase()+b.substr(1,b.length)}),c.join(" ")}}),a.formUtils.addSanitizer({name:"insert",sanitizerFunction:function(a,b,c){var d=(b.attr("data-sanitize-insert-"+c)||"").replace(/\[SPACE\]/g," ");return"left"===c&&0===a.indexOf(d)||"right"===c&&a.substring(a.length-d.length)===d?a:("left"===c?d:"")+a+("right"===c?d:"")}}),a.formUtils.addSanitizer({name:"insertRight",sanitizerFunction:function(b,c){return a.formUtils.sanitizers.insert.sanitizerFunction(b,c,"right")}}),a.formUtils.addSanitizer({name:"insertLeft",sanitizerFunction:function(b,c){return a.formUtils.sanitizers.insert.sanitizerFunction(b,c,"left")}}),a.formUtils.addSanitizer({name:"numberFormat",sanitizerFunction:function(a,c){if(0===a.length)return a;if(!("numeral"in b))throw new ReferenceError('Using sanitation function "numberFormat" requires that you include numeral.js (http://numeraljs.com/)');return a=numeral().unformat(a),a=numeral(a).format(c.attr("data-sanitize-number-format"))}}),a.formUtils.addSanitizer({name:"strip",sanitizerFunction:function(b,c){var d=c.attr("data-sanitize-strip")||"";return a.split(d,function(c){var d=new RegExp(a.isNumeric(c)?c:"\\"+c,"g");b=b.replace(d,"")}),b}}),a.formUtils.addSanitizer({name:"escape",sanitizerFunction:function(b,c){var d=c.valAttr("is-escaped"),e={"<":"__%AMP%__lt;",">":"__%AMP%__gt;","&":"__%AMP%__amp;","'":"__%AMP%__#8217;",'"':"__%AMP%__quot;"};return"yes"===d?b:(c.valAttr("is-escaped","yes"),c.one("keyup",function(a){9!==a.keyCode&&c.valAttr("is-escaped","no")}),a.each(e,function(a,c){b=b.replace(new RegExp(a,"g"),c)}),b.replace(new RegExp("__%AMP%__","g"),"&"))}}),a.formUtils.registerLoadedModule("sanitize");var c='[type="button"], [type="submit"], [type="radio"], [type="checkbox"], [type="reset"], [type="search"]',d=function(b,d,e){d||(d=a("form")),d.each||(d=a(d));var f=function(){var b=a(this),c=b.val();a.split(b.attr("data-sanitize"),function(d){var f=a.formUtils.sanitizers[d];if(!f)throw new Error('Use of unknown sanitize command "'+d+'"');c=f.sanitizerFunction(c,b,e)}),b.val(c).trigger("keyup.validation")};d.each(function(){var b=a(this);e.sanitizeAll&&b.find("input,textarea").not(c).each(function(){var b=a(this),c=b.attr("data-sanitize")||"";b.attr("data-sanitize",e.sanitizeAll+" "+c)}),b.find("[data-sanitize]").unbind("blur.sanitation",f).bind("blur.sanitation",f),a(function(){b.trigger("blur.sanitation")})})};a(b).on("validatorsLoaded formValidationSetup",d),a.formUtils.setupSanitation=d}(a,window)}); \ No newline at end of file diff --git a/form-validator/security.js b/form-validator/security.js index f16d729..c1fd315 100644 --- a/form-validator/security.js +++ b/form-validator/security.js @@ -1,625 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator Module: Security - * ------------------------------------------ - * Created by Victor Jonsson +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * This module adds validators typically used in registration forms. - * This module adds the following validators: - * - spamcheck - * - confirmation - * - strength - * - backend - * - credit card - * - cvv - * - * @website http://formvalidator.net/#security-validators - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function ($, window) { - - 'use strict'; - - $.formUtils.registerLoadedModule('security'); - - /* - * Simple spam check - */ - $.formUtils.addValidator({ - name: 'spamcheck', - validatorFunction: function (val, $el) { - var attr = $el.valAttr('captcha'); - return attr === val; - }, - errorMessage: '', - errorMessageKey: 'badSecurityAnswer' - }); - - /* - * Validate confirmation (tests that two inputs are identical; usually used for - * passwords) - */ - $.formUtils.addValidator({ - name: 'confirmation', - validatorFunction: function (value, $el, config, language, $form) { - var password, - passwordInputName = $el.valAttr('confirm') || - ($el.attr('name') + '_confirmation'), - $passwordInput = $form.find('[name="' + passwordInputName + '"]'); - if (!$passwordInput.length) { - $.formUtils.warn('Password confirmation validator: could not find an input ' + - 'with name "' + passwordInputName + '"', true); - return false; - } - - password = $passwordInput.val(); - if (config.validateOnBlur && !$passwordInput[0].hasValidationCallback) { - $passwordInput[0].hasValidationCallback = true; - var keyUpCallback = function () { - $el.validate(); - }; - $passwordInput.on('keyup', keyUpCallback); - $form.one('formValidationSetup', function () { - $passwordInput[0].hasValidationCallback = false; - $passwordInput.off('keyup', keyUpCallback); - }); - } - - return value === password; - }, - errorMessage: '', - errorMessageKey: 'notConfirmed' - }); - - var creditCards = { - 'amex': [15, 15], - 'diners_club': [14, 14], - 'cjb': [16, 16], - 'laser': [16, 19], - 'visa': [16, 16], - 'mastercard': [16, 16], - 'maestro': [12, 19], - 'discover': [16, 16] - }, - checkOnlyAmex = false, - allowsAmex = false; - - /* - * Credit card - */ - $.formUtils.addValidator({ - name: 'creditcard', - validatorFunction: function (value, $el) { - var allowing = $.split($el.valAttr('allowing') || ''); - - // Setup for cvv validation - allowsAmex = $.inArray('amex', allowing) > -1; - checkOnlyAmex = allowsAmex && allowing.length === 1; - - // Correct length - if (allowing.length > 0) { - var hasValidLength = false; - $.each(allowing, function (i, cardName) { - if (cardName in creditCards) { - if (value.length >= creditCards[cardName][0] && value.length <= creditCards[cardName][1]) { - hasValidLength = true; - return false; - } - } else { - $.formUtils.warn('Use of unknown credit card "' + cardName + '"', true); - } - }); - - if (!hasValidLength) { - return false; - } - } - - // only numbers - if (value.replace(new RegExp('[0-9]', 'g'), '') !== '') { - return false; - } - - // http://en.wikipedia.org/wiki/Luhn_algorithm - // http://www.brainjar.com/js/validation/default2.asp - var checkSum = 0; - $.each(value.split('').reverse(), function (i, digit) { - digit = parseInt(digit, 10); - if (i % 2 === 0) { - checkSum += digit; - } else { - digit *= 2; - if (digit < 10) { - checkSum += digit; - } else { - checkSum += digit - 9; - } - } - }); - return checkSum % 10 === 0; - }, - errorMessage: '', - errorMessageKey: 'badCreditCard' - }); - - /* - * Credit card number - */ - $.formUtils.addValidator({ - name: 'cvv', - validatorFunction: function (val) { - if (val.replace(/[0-9]/g, '') === '') { - val = val + ''; - if (checkOnlyAmex) { - return val.length === 4; - } else if (allowsAmex) { - return val.length === 3 || val.length === 4; - } else { - return val.length === 3; - } - } - return false; - }, - errorMessage: '', - errorMessageKey: 'badCVV' - }); - - /* - * Validate password strength - */ - $.formUtils.addValidator({ - name: 'strength', - validatorFunction: function (val, $el) { - var requiredStrength = $el.valAttr('strength') || 2; - if (requiredStrength && requiredStrength > 3) { - requiredStrength = 3; - } - - return $.formUtils.validators.validate_strength.calculatePasswordStrength(val) >= requiredStrength; - }, - errorMessage: '', - errorMessageKey: 'badStrength', - - /** - * Code more or less borrowed from jQuery plugin "Password Strength Meter" - * written by Darren Mason (djmason9@gmail.com), myPocket technologies (www.mypocket-technologies.com) - * @param {String} password - * @return {Number} - */ - calculatePasswordStrength: function (password) { - - if (password.length < 4) { - return 0; - } - - var score = 0; - - var checkRepetition = function (pLen, str) { - var res = ''; - for (var i = 0; i < str.length; i++) { - var repeated = true; - - for (var j = 0; j < pLen && (j + i + pLen) < str.length; j++) { - repeated = repeated && (str.charAt(j + i) === str.charAt(j + i + pLen)); - } - if (j < pLen) { - repeated = false; - } - if (repeated) { - i += pLen - 1; - repeated = false; - } - else { - res += str.charAt(i); - } - } - return res; - }; - - //password length - score += password.length * 4; - score += ( checkRepetition(1, password).length - password.length ) * 1; - score += ( checkRepetition(2, password).length - password.length ) * 1; - score += ( checkRepetition(3, password).length - password.length ) * 1; - score += ( checkRepetition(4, password).length - password.length ) * 1; - - //password has 3 numbers - if (password.match(/(.*[0-9].*[0-9].*[0-9])/)) { - score += 5; - } - - //password has 2 symbols - if (password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) { - score += 5; - } - - //password has Upper and Lower chars - if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) { - score += 10; - } - - //password has number and chars - if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) { - score += 15; - } - // - //password has number and symbol - if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([0-9])/)) { - score += 15; - } - - //password has char and symbol - if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([a-zA-Z])/)) { - score += 15; - } - - //password is just a numbers or chars - if (password.match(/^\w+$/) || password.match(/^\d+$/)) { - score -= 10; - } - - //verifying 0 < score < 100 - if (score < 0) { - score = 0; - } - if (score > 100) { - score = 100; - } - - if (score < 20) { - return 0; - } - else if (score < 40) { - return 1; - } - else if (score <= 60) { - return 2; - } - else { - return 3; - } - }, - - strengthDisplay: function ($el, options) { - var config = { - fontSize: '12pt', - padding: '4px', - bad: 'Very bad', - weak: 'Weak', - good: 'Good', - strong: 'Strong' - }; - - if (options) { - $.extend(config, options); - } - - $el.bind('keyup', function () { - var val = $(this).val(), - $parent = typeof config.parent === 'undefined' ? $(this).parent() : $(config.parent), - $displayContainer = $parent.find('.strength-meter'), - strength = $.formUtils.validators.validate_strength.calculatePasswordStrength(val), - css = { - background: 'pink', - color: '#FF0000', - fontWeight: 'bold', - border: 'red solid 1px', - borderWidth: '0px 0px 4px', - display: 'inline-block', - fontSize: config.fontSize, - padding: config.padding - }, - text = config.bad; - - if ($displayContainer.length === 0) { - $displayContainer = $(''); - $displayContainer - .addClass('strength-meter') - .appendTo($parent); - } - - if (!val) { - $displayContainer.hide(); - } else { - $displayContainer.show(); - } - - if (strength === 1) { - text = config.weak; - } - else if (strength === 2) { - css.background = 'lightyellow'; - css.borderColor = 'yellow'; - css.color = 'goldenrod'; - text = config.good; - } - else if (strength >= 3) { - css.background = 'lightgreen'; - css.borderColor = 'darkgreen'; - css.color = 'darkgreen'; - text = config.strong; - } - - $displayContainer - .css(css) - .text(text); - }); - } - }); - - var requestServer = function (serverURL, $element, val, conf, callback) { - var reqParams = $element.valAttr('req-params') || $element.data('validation-req-params') || {}, - inputName = $element.valAttr('param-name') || $element.attr('name'), - handleResponse = function (response, callback) { - callback(response); - }; - - if (!inputName) { - throw new Error('Missing input name used for http requests made by server validator'); - } - if (!reqParams) { - reqParams = {}; - } - if (typeof reqParams === 'string') { - reqParams = $.parseJSON(reqParams); - } - reqParams[inputName] = val; - - $.ajax({ - url: serverURL, - type: 'POST', - cache: false, - data: reqParams, - dataType: 'json', - error: function (error) { - handleResponse({valid: false, message: 'Connection failed with status: ' + error.statusText}, callback); - return false; - }, - success: function (response) { - handleResponse(response, callback); - } - }); - }; - - /* - * Server validation - */ - $.formUtils.addAsyncValidator({ - name: 'server', - validatorFunction: function (done, val, $input, conf, lang, $form) { - var serverURL = $input.valAttr('url') || conf.backendUrl || document.location.href; - // @todo: deprecated class names that should be removed when moving up to 3.0 - $form.addClass('validating-server-side'); - $input.addClass('validating-server-side'); - requestServer(serverURL, $input, val, conf, function (response) { - $form.removeClass('validating-server-side'); - $input.removeClass('validating-server-side'); - if (response.message) { - $input.attr(conf.validationErrorMsgAttribute, response.message); - } - done(response.valid); - }); - }, - errorMessage: '', - errorMessageKey: 'badBackend' - }); - - /* - * Check for only letters and numbers - * - * http://www.slovo.info/testuni.htm - */ - $.formUtils.addValidator({ - name: 'letternumeric', - validatorFunction: function (val, $el, config, language) { - var patternStart = '^([a-zA-Z0-9\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', - patternEnd = ']+)$', - additionalChars = $el.valAttr('allowing'), - pattern = ''; - - if (additionalChars) { - pattern = patternStart + additionalChars + patternEnd; - var extra = additionalChars.replace(/\\/g, ''); - if (extra.indexOf(' ') > -1) { - extra = extra.replace(' ', ''); - extra += language.andSpaces || $.formUtils.LANG.andSpaces; - } - this.errorMessage = language.badAlphaNumeric + language.badAlphaNumericExtra + extra; - } else { - pattern = patternStart + patternEnd; - this.errorMessage = language.badAlphaNumeric; - } - - return new RegExp(pattern).test(val); - }, - errorMessage: '', - errorMessageKey: 'requiredFields' - }); - - /* - * Check password content depending on following parameters: - * data-validation-require-uc-letter, - * data-validation-require-lc-letter, - * data-validation-require-special-char, - * data-validation-require-numeral - */ - $.formUtils.addValidator({ - name : 'complexity', - validatorFunction : function(value, $input, config, language) { - var numRequiredUppercaseChars = $input.valAttr('require-uc-letter') || '0', - numRequiredLowercaseChars = $input.valAttr('require-lc-letter') || '0', - numRequiredSpecialChars = $input.valAttr('require-special-char') || '0', - numRequiredNumericChars = $input.valAttr('require-numeral') || '0', - numRequiredCharsTotal = $input.valAttr('require-length') || '0', - subValidators = { - 'uc-letter': { - pattern: '^(?=(?:.*[A-Z]){'+numRequiredUppercaseChars+',}).+', - numRequired: numRequiredUppercaseChars, - dialogEnd: language.passwordComplexityUppercaseInfo - }, - 'lc-letter': { - pattern: '^(?=(?:.*[a-z]){'+numRequiredLowercaseChars+',}).+', - numRequired: numRequiredLowercaseChars, - dialogEnd: language.passwordComplexityLowercaseInfo - }, - 'special-char': { - pattern: '^(?=(?:.*(_|[!"#$%&\'()*+\\\\,-./:;<=>?@[\\]^_`{|}~])){'+numRequiredSpecialChars+',}).+', - numRequired: numRequiredSpecialChars, - dialogEnd: language.passwordComplexitySpecialCharsInfo - }, - 'numeral': { - pattern: '^(?=(?:.*\\d){'+numRequiredNumericChars+',}).+', - numRequired: numRequiredNumericChars, - dialogEnd: language.passwordComplexityNumericCharsInfo - }, - 'length': { - callback: function(val) { - return val.length >= numRequiredCharsTotal; - }, - numRequired: numRequiredCharsTotal, - dialogEnd: language.lengthBadEnd - } - }, - errorMessage = ''; - - $.each(subValidators, function(name, subValidator) { - var numRequired = parseInt(subValidator.numRequired, 10); - if (numRequired) { - var regexp = new RegExp(subValidator.pattern), - valid = false; - - if (subValidator.callback) { - valid = subValidator.callback(value); - } else { - valid = regexp.test(value); - } - - if (!valid) { - if (errorMessage === '') { - errorMessage = language.passwordComplexityStart; - } - errorMessage += language.passwordComplexitySeparator + numRequired + subValidator.dialogEnd; - $input.trigger('complexityRequirementValidation', [false, name]); - } else { - $input.trigger('complexityRequirementValidation', [true, name]); - } - } - }); - if (errorMessage) { - this.errorMessage = errorMessage + language.passwordComplexityEnd; - return false; - } else { - return true; - } - }, - errorMessage : '', - errorMessageKey: '' - }); - - /* - * Google reCaptcha 2 - */ - $.formUtils.addValidator({ - name: 'recaptcha', - validatorFunction: function (val, $el) { - return grecaptcha.getResponse($el.valAttr('recaptcha-widget-id')) !== ''; - }, - errorMessage: '', - errorMessageKey: 'badreCaptcha' - }); - - $.fn.displayPasswordStrength = function (conf) { - new $.formUtils.validators.validate_strength.strengthDisplay(this, conf); - return this; - }; - - var setupGooglereCaptcha = function (evt, $forms, config) { - if (!$forms) { - $forms = $('form'); - } - if (typeof grecaptcha !== 'undefined' && !$.formUtils.hasLoadedGrecaptcha) { - throw new Error('reCaptcha API can not be loaded by hand, delete reCaptcha API snippet.'); - } else if (!$.formUtils.hasLoadedGrecaptcha && $('[data-validation~="recaptcha"]', $forms).length) { - $.formUtils.hasLoadedGrecaptcha = true; - - var src = '//www.google.com/recaptcha/api.js?onload=reCaptchaLoaded&render=explicit' + (config.lang ? '&hl=' + config.lang : ''); - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.async = true; - script.defer = true; - script.src = src; - document.getElementsByTagName('body')[0].appendChild(script); - } - }; - - window.reCaptchaLoaded = function ($forms) { - if (!$forms || typeof $forms !== 'object' || !$forms.length) { - $forms = $('form'); - } - - $forms.each(function () { - var $form = $(this), - config = $form.get(0).validationConfig || $form.context.validationConfig || false; - - if (config) { - $('[data-validation~="recaptcha"]', $form).each(function () { - var $input = $(this), - div = document.createElement('DIV'), - siteKey = config.reCaptchaSiteKey || $input.valAttr('recaptcha-sitekey'), - theme = config.reCaptchaTheme || $input.valAttr('recaptcha-theme') || 'light', - size = config.reCaptchaSize || $input.valAttr('recaptcha-size') || 'normal', - type = config.reCaptchaType || $input.valAttr('recaptcha-type') || 'image'; - - if (!siteKey) { - throw new Error('Google reCaptcha site key is required.'); - } - - var widgetId = grecaptcha.render(div, { - sitekey: siteKey, - theme: theme, - size: size, - type: type, - callback: function (result) { - $form.find('[data-validation~="recaptcha"]') - .trigger('validation', (result && result !== '')); - - }, - 'expired-callback': function() { - $form.find('[data-validation~="recaptcha"]').trigger('validation', false); - } - }); - $input - .valAttr('recaptcha-widget-id', widgetId) - .hide() - .on('beforeValidation', function (evt) { - // prevent validator from skipping this input because its hidden - evt.stopImmediatePropagation(); - }) - .parent() - .append(div); - }); - } - }); - }; - - $(window).on('validatorsLoaded formValidationSetup', setupGooglereCaptcha); - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.registerLoadedModule("security"),a.formUtils.addValidator({name:"spamcheck",validatorFunction:function(a,b){var c=b.valAttr("captcha");return c===a},errorMessage:"",errorMessageKey:"badSecurityAnswer"}),a.formUtils.addValidator({name:"confirmation",validatorFunction:function(b,c,d,e,f){var g,h=c.valAttr("confirm")||c.attr("name")+"_confirmation",i=f.find('[name="'+h+'"]');if(!i.length)return a.formUtils.warn('Password confirmation validator: could not find an input with name "'+h+'"',!0),!1;if(g=i.val(),d.validateOnBlur&&!i[0].hasValidationCallback){i[0].hasValidationCallback=!0;var j=function(){c.validate()};i.on("keyup",j),f.one("formValidationSetup",function(){i[0].hasValidationCallback=!1,i.off("keyup",j)})}return b===g},errorMessage:"",errorMessageKey:"notConfirmed"});var c={amex:[15,15],diners_club:[14,14],cjb:[16,16],laser:[16,19],visa:[16,16],mastercard:[16,16],maestro:[12,19],discover:[16,16]},d=!1,e=!1;a.formUtils.addValidator({name:"creditcard",validatorFunction:function(b,f){var g=a.split(f.valAttr("allowing")||"");if(e=a.inArray("amex",g)>-1,d=e&&1===g.length,g.length>0){var h=!1;if(a.each(g,function(d,e){if(e in c){if(b.length>=c[e][0]&&b.length<=c[e][1])return h=!0,!1}else a.formUtils.warn('Use of unknown credit card "'+e+'"',!0)}),!h)return!1}if(""!==b.replace(new RegExp("[0-9]","g"),""))return!1;var i=0;return a.each(b.split("").reverse(),function(a,b){b=parseInt(b,10),a%2===0?i+=b:(b*=2,i+=b<10?b:b-9)}),i%10===0},errorMessage:"",errorMessageKey:"badCreditCard"}),a.formUtils.addValidator({name:"cvv",validatorFunction:function(a){return""===a.replace(/[0-9]/g,"")&&(a+="",d?4===a.length:e?3===a.length||4===a.length:3===a.length)},errorMessage:"",errorMessageKey:"badCVV"}),a.formUtils.addValidator({name:"strength",validatorFunction:function(b,c){var d=c.valAttr("strength")||2;return d&&d>3&&(d=3),a.formUtils.validators.validate_strength.calculatePasswordStrength(b)>=d},errorMessage:"",errorMessageKey:"badStrength",calculatePasswordStrength:function(a){if(a.length<4)return 0;var b=0,c=function(a,b){for(var c="",d=0;d100&&(b=100),b<20?0:b<40?1:b<=60?2:3},strengthDisplay:function(b,c){var d={fontSize:"12pt",padding:"4px",bad:"Very bad",weak:"Weak",good:"Good",strong:"Strong"};c&&a.extend(d,c),b.bind("keyup",function(){var b=a(this).val(),c="undefined"==typeof d.parent?a(this).parent():a(d.parent),e=c.find(".strength-meter"),f=a.formUtils.validators.validate_strength.calculatePasswordStrength(b),g={background:"pink",color:"#FF0000",fontWeight:"bold",border:"red solid 1px",borderWidth:"0px 0px 4px",display:"inline-block",fontSize:d.fontSize,padding:d.padding},h=d.bad;0===e.length&&(e=a(""),e.addClass("strength-meter").appendTo(c)),b?e.show():e.hide(),1===f?h=d.weak:2===f?(g.background="lightyellow",g.borderColor="yellow",g.color="goldenrod",h=d.good):f>=3&&(g.background="lightgreen",g.borderColor="darkgreen",g.color="darkgreen",h=d.strong),e.css(g).text(h)})}});var f=function(b,c,d,e,f){var g=c.valAttr("req-params")||c.data("validation-req-params")||{},h=c.valAttr("param-name")||c.attr("name"),i=function(a,b){b(a)};if(!h)throw new Error("Missing input name used for http requests made by server validator");g||(g={}),"string"==typeof g&&(g=a.parseJSON(g)),g[h]=d,a.ajax({url:b,type:"POST",cache:!1,data:g,dataType:"json",error:function(a){return i({valid:!1,message:"Connection failed with status: "+a.statusText},f),!1},success:function(a){i(a,f)}})};a.formUtils.addAsyncValidator({name:"server",validatorFunction:function(a,b,c,d,e,g){var h=c.valAttr("url")||d.backendUrl||document.location.href;g.addClass("validating-server-side"),c.addClass("validating-server-side"),f(h,c,b,d,function(b){g.removeClass("validating-server-side"),c.removeClass("validating-server-side"),b.message&&c.attr(d.validationErrorMsgAttribute,b.message),a(b.valid)})},errorMessage:"",errorMessageKey:"badBackend"}),a.formUtils.addValidator({name:"letternumeric",validatorFunction:function(b,c,d,e){var f="^([a-zA-Z0-9ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",g="]+)$",h=c.valAttr("allowing"),i="";if(h){i=f+h+g;var j=h.replace(/\\/g,"");j.indexOf(" ")>-1&&(j=j.replace(" ",""),j+=e.andSpaces||a.formUtils.LANG.andSpaces),this.errorMessage=e.badAlphaNumeric+e.badAlphaNumericExtra+j}else i=f+g,this.errorMessage=e.badAlphaNumeric;return new RegExp(i).test(b)},errorMessage:"",errorMessageKey:"requiredFields"}),a.formUtils.addValidator({name:"complexity",validatorFunction:function(b,c,d,e){var f=c.valAttr("require-uc-letter")||"0",g=c.valAttr("require-lc-letter")||"0",h=c.valAttr("require-special-char")||"0",i=c.valAttr("require-numeral")||"0",j=c.valAttr("require-length")||"0",k={"uc-letter":{pattern:"^(?=(?:.*[A-Z]){"+f+",}).+",numRequired:f,dialogEnd:e.passwordComplexityUppercaseInfo},"lc-letter":{pattern:"^(?=(?:.*[a-z]){"+g+",}).+",numRequired:g,dialogEnd:e.passwordComplexityLowercaseInfo},"special-char":{pattern:"^(?=(?:.*(_|[!\"#$%&'()*+\\\\,-./:;<=>?@[\\]^_`{|}~])){"+h+",}).+",numRequired:h,dialogEnd:e.passwordComplexitySpecialCharsInfo},numeral:{pattern:"^(?=(?:.*\\d){"+i+",}).+",numRequired:i,dialogEnd:e.passwordComplexityNumericCharsInfo},length:{callback:function(a){return a.length>=j},numRequired:j,dialogEnd:e.lengthBadEnd}},l="";return a.each(k,function(a,d){var f=parseInt(d.numRequired,10);if(f){var g=new RegExp(d.pattern),h=!1;h=d.callback?d.callback(b):g.test(b),h?c.trigger("complexityRequirementValidation",[!0,a]):(""===l&&(l=e.passwordComplexityStart),l+=e.passwordComplexitySeparator+f+d.dialogEnd,c.trigger("complexityRequirementValidation",[!1,a]))}}),!l||(this.errorMessage=l+e.passwordComplexityEnd,!1)},errorMessage:"",errorMessageKey:""}),a.formUtils.addValidator({name:"recaptcha",validatorFunction:function(a,b){return""!==grecaptcha.getResponse(b.valAttr("recaptcha-widget-id"))},errorMessage:"",errorMessageKey:"badreCaptcha"}),a.fn.displayPasswordStrength=function(b){return new a.formUtils.validators.validate_strength.strengthDisplay(this,b),this};var g=function(b,c,d){if(c||(c=a("form")),"undefined"!=typeof grecaptcha&&!a.formUtils.hasLoadedGrecaptcha)throw new Error("reCaptcha API can not be loaded by hand, delete reCaptcha API snippet.");if(!a.formUtils.hasLoadedGrecaptcha&&a('[data-validation~="recaptcha"]',c).length){a.formUtils.hasLoadedGrecaptcha=!0;var e="//www.google.com/recaptcha/api.js?onload=reCaptchaLoaded&render=explicit"+(d.lang?"&hl="+d.lang:""),f=document.createElement("script");f.type="text/javascript",f.async=!0,f.defer=!0,f.src=e,document.getElementsByTagName("body")[0].appendChild(f)}};b.reCaptchaLoaded=function(b){b&&"object"==typeof b&&b.length||(b=a("form")),b.each(function(){var b=a(this),c=b.get(0).validationConfig||b.context.validationConfig||!1;c&&a('[data-validation~="recaptcha"]',b).each(function(){var d=a(this),e=document.createElement("DIV"),f=c.reCaptchaSiteKey||d.valAttr("recaptcha-sitekey"),g=c.reCaptchaTheme||d.valAttr("recaptcha-theme")||"light",h=c.reCaptchaSize||d.valAttr("recaptcha-size")||"normal",i=c.reCaptchaType||d.valAttr("recaptcha-type")||"image";if(!f)throw new Error("Google reCaptcha site key is required.");var j=grecaptcha.render(e,{sitekey:f,theme:g,size:h,type:i,callback:function(a){b.find('[data-validation~="recaptcha"]').trigger("validation",a&&""!==a)},"expired-callback":function(){b.find('[data-validation~="recaptcha"]').trigger("validation",!1)}});d.valAttr("recaptcha-widget-id",j).hide().on("beforeValidation",function(a){a.stopImmediatePropagation()}).parent().append(e)})})},a(b).on("validatorsLoaded formValidationSetup",g)}(a,window)}); \ No newline at end of file diff --git a/form-validator/sepa.js b/form-validator/sepa.js index 567dcb9..5b60f92 100644 --- a/form-validator/sepa.js +++ b/form-validator/sepa.js @@ -1,218 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -// jQuery Form Validator Module: SEPA -// Author: PispalanIT, Joni Saarinen -// -// Code based on https://github.com/arhs/iban.js/blob/master/iban.js - -(function($) { - - 'use strict'; - - $.formUtils.registerLoadedModule('sepa'); - - var ibanCountryList = [ - ['AD', 24, 'F04F04A12'], - ['AE', 23, 'F03F16'], - ['AL', 28, 'F08A16'], - ['AT', 20, 'F05F11'], - ['AZ', 28, 'U04A20'], - ['BA', 20, 'F03F03F08F02'], - ['BE', 16, 'F03F07F02'], - ['BG', 22, 'U04F04F02A08'], - ['BH', 22, 'U04A14'], - ['BR', 29, 'F08F05F10U01A01'], - ['CH', 21, 'F05A12'], - ['CR', 21, 'F03F14'], - ['CY', 28, 'F03F05A16'], - ['CZ', 24, 'F04F06F10'], - ['DE', 22, 'F08F10'], - ['DK', 18, 'F04F09F01'], - ['DO', 28, 'U04F20'], - ['EE', 20, 'F02F02F11F01'], - ['ES', 24, 'F04F04F01F01F10'], - ['FI', 18, 'F06F07F01'], - ['FO', 18, 'F04F09F01'], - ['FR', 27, 'F05F05A11F02'], - ['GB', 22, 'U04F06F08'], - ['GE', 22, 'U02F16'], - ['GI', 23, 'U04A15'], - ['GL', 18, 'F04F09F01'], - ['GR', 27, 'F03F04A16'], - ['GT', 28, 'A04A20'], - ['HR', 21, 'F07F10'], - ['HU', 28, 'F03F04F01F15F01'], - ['IE', 22, 'U04F06F08'], - ['IL', 23, 'F03F03F13'], - ['IS', 26, 'F04F02F06F10'], - ['IT', 27, 'U01F05F05A12'], - ['KW', 30, 'U04A22'], - ['KZ', 20, 'F03A13'], - ['LB', 28, 'F04A20'], - ['LC', 32, 'U04F24'], - ['LI', 21, 'F05A12'], - ['LT', 20, 'F05F11'], - ['LU', 20, 'F03A13'], - ['LV', 21, 'U04A13'], - ['MC', 27, 'F05F05A11F02'], - ['MD', 24, 'U02A18'], - ['ME', 22, 'F03F13F02'], - ['MK', 19, 'F03A10F02'], - ['MR', 27, 'F05F05F11F02'], - ['MT', 31, 'U04F05A18'], - ['MU', 30, 'U04F02F02F12F03U03'], - ['NL', 18, 'U04F10'], - ['NO', 15, 'F04F06F01'], - ['PK', 24, 'U04A16'], - ['PL', 28, 'F08F16'], - ['PS', 29, 'U04A21'], - ['PT', 25, 'F04F04F11F02'], - ['RO', 24, 'U04A16'], - ['RS', 22, 'F03F13F02'], - ['SA', 24, 'F02A18'], - ['SE', 24, 'F03F16F01'], - ['SI', 19, 'F05F08F02'], - ['SK', 24, 'F04F06F10'], - ['SM', 27, 'U01F05F05A12'], - ['ST', 25, 'F08F11F02'], - ['TL', 23, 'F03F14F02'], - ['TN', 24, 'F02F03F13F02'], - ['TR', 26, 'F05F01A16'], - ['VG', 24, 'U04F16'], - ['XK', 20, 'F04F10F02'], - ['AO', 25, 'F21'], - ['BF', 27, 'F23'], - ['BI', 16, 'F12'], - ['BJ', 28, 'F24'], - ['CI', 28, 'U01F23'], - ['CM', 27, 'F23'], - ['CV', 25, 'F21'], - ['DZ', 24, 'F20'], - ['IR', 26, 'F22'], - ['JO', 30, 'A04F22'], - ['MG', 27, 'F23'], - ['ML', 28, 'U01F23'], - ['MZ', 25, 'F21'], - ['QA', 29, 'U04A21'], - ['SN', 28, 'U01F23'], - ['UA', 29, 'F25'] - ]; - - var generalValidatorFunction = function (sepa) { - sepa = sepa.replace(/\s+/g, ''); - sepa = sepa.substr(4) + sepa.substr(0,4); - - sepa = sepa.split('').map(function(n){ - var code = n.charCodeAt(0); - if (code >= 'A'.charCodeAt(0) && code <= 'Z'.charCodeAt(0)){ - //A = 10, B = 11, ... Z = 35 - return code - 'A'.charCodeAt(0) + 10; - } else { - return n; - } - }).join(''); - - var remainder = sepa; - var block; - - while (remainder.length > 2) { - block = remainder.slice(0, 9); - remainder = (parseInt(block, 10) % 97).toString() + remainder.slice(block.length); - } - - if (parseInt(remainder, 10) % 97 === 1){ - return true; - } else { - return false; - } - }; - - var countryIBAN = function(sepa) { - sepa = sepa.toUpperCase(); - sepa = sepa.replace(/\s+/g, ''); - - var countryCode = sepa.slice(0,2); - var i = 0; - var structure = ''; - - for (i = 0; i < ibanCountryList.length; ++i){ - if (ibanCountryList[i][0] === countryCode){ - structure = ibanCountryList[i][2]; - break; - } - } - - if (structure === ''){ - return false; - } - - var regex = structure.match(/(.{3})/g).map(function(block){ - - // parse each structure block (1-char + 2-digits) - var format; - var pattern = block.slice(0, 1); - var repeats = parseInt(block.slice(1), 10); - - switch (pattern){ - case 'A': format = '0-9A-Za-z'; break; - case 'B': format = '0-9A-Z'; break; - case 'C': format = 'A-Za-z'; break; - case 'F': format = '0-9'; break; - case 'L': format = 'a-z'; break; - case 'U': format = 'A-Z'; break; - case 'W': format = '0-9a-z'; break; - } - - return '([' + format + ']{' + repeats + '})'; - }); - - var regextest = new RegExp('^' + regex.join('') + '$'); - - return sepa.length === ibanCountryList[i][1] && regextest.test(sepa.slice(4)); - }; - - - $.formUtils.addValidator({ - name: 'sepa', - validatorFunction: generalValidatorFunction, - errorMessage: '', - errorMessageKey:'badSepa' - }); - - $.formUtils.addValidator({ - name: 'iban', - validatorFunction: function(sepa) { - return countryIBAN(sepa) && generalValidatorFunction(sepa); - }, - errorMessage: '', - errorMessageKey:'badIban' - }); - - $.formUtils.addValidator({ - name: 'bic', - validatorFunction: function(bic) { - var regextest = new RegExp('^[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}$'); - return regextest.test(bic); - }, - errorMessage: '', - errorMessageKey:'badBic' - }); - -})(jQuery); - - -})); +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR + * + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT + */ +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){"use strict";a.formUtils.registerLoadedModule("sepa");var b=[["AD",24,"F04F04A12"],["AE",23,"F03F16"],["AL",28,"F08A16"],["AT",20,"F05F11"],["AZ",28,"U04A20"],["BA",20,"F03F03F08F02"],["BE",16,"F03F07F02"],["BG",22,"U04F04F02A08"],["BH",22,"U04A14"],["BR",29,"F08F05F10U01A01"],["CH",21,"F05A12"],["CR",21,"F03F14"],["CY",28,"F03F05A16"],["CZ",24,"F04F06F10"],["DE",22,"F08F10"],["DK",18,"F04F09F01"],["DO",28,"U04F20"],["EE",20,"F02F02F11F01"],["ES",24,"F04F04F01F01F10"],["FI",18,"F06F07F01"],["FO",18,"F04F09F01"],["FR",27,"F05F05A11F02"],["GB",22,"U04F06F08"],["GE",22,"U02F16"],["GI",23,"U04A15"],["GL",18,"F04F09F01"],["GR",27,"F03F04A16"],["GT",28,"A04A20"],["HR",21,"F07F10"],["HU",28,"F03F04F01F15F01"],["IE",22,"U04F06F08"],["IL",23,"F03F03F13"],["IS",26,"F04F02F06F10"],["IT",27,"U01F05F05A12"],["KW",30,"U04A22"],["KZ",20,"F03A13"],["LB",28,"F04A20"],["LC",32,"U04F24"],["LI",21,"F05A12"],["LT",20,"F05F11"],["LU",20,"F03A13"],["LV",21,"U04A13"],["MC",27,"F05F05A11F02"],["MD",24,"U02A18"],["ME",22,"F03F13F02"],["MK",19,"F03A10F02"],["MR",27,"F05F05F11F02"],["MT",31,"U04F05A18"],["MU",30,"U04F02F02F12F03U03"],["NL",18,"U04F10"],["NO",15,"F04F06F01"],["PK",24,"U04A16"],["PL",28,"F08F16"],["PS",29,"U04A21"],["PT",25,"F04F04F11F02"],["RO",24,"U04A16"],["RS",22,"F03F13F02"],["SA",24,"F02A18"],["SE",24,"F03F16F01"],["SI",19,"F05F08F02"],["SK",24,"F04F06F10"],["SM",27,"U01F05F05A12"],["ST",25,"F08F11F02"],["TL",23,"F03F14F02"],["TN",24,"F02F03F13F02"],["TR",26,"F05F01A16"],["VG",24,"U04F16"],["XK",20,"F04F10F02"],["AO",25,"F21"],["BF",27,"F23"],["BI",16,"F12"],["BJ",28,"F24"],["CI",28,"U01F23"],["CM",27,"F23"],["CV",25,"F21"],["DZ",24,"F20"],["IR",26,"F22"],["JO",30,"A04F22"],["MG",27,"F23"],["ML",28,"U01F23"],["MZ",25,"F21"],["QA",29,"U04A21"],["SN",28,"U01F23"],["UA",29,"F25"]],c=function(a){a=a.replace(/\s+/g,""),a=a.substr(4)+a.substr(0,4),a=a.split("").map(function(a){var b=a.charCodeAt(0);return b>="A".charCodeAt(0)&&b<="Z".charCodeAt(0)?b-"A".charCodeAt(0)+10:a}).join("");for(var b,c=a;c.length>2;)b=c.slice(0,9),c=(parseInt(b,10)%97).toString()+c.slice(b.length);return parseInt(c,10)%97===1},d=function(a){a=a.toUpperCase(),a=a.replace(/\s+/g,"");var c=a.slice(0,2),d=0,e="";for(d=0;d +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * This form validation module adds validators typically used on swedish - * websites. This module adds the following validators: - * - validate_swesec (Social security number) - * - validate_swemobile - * - validate_validate_municipality - * - validate_county - * - validate_swephone - * - * @website http://formvalidator.net/#swedish-validators - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function ($, window) { - - $.formUtils.registerLoadedModule('sweden'); - - - /* - * Validate swedish social security number yyyymmddXXXX - */ - $.formUtils.addValidator({ - name: 'swesec', - validatorFunction: function (securityNumber, $input) { - - var year, month, day, ssnParts; - - if ($input.valAttr('use-hyphen')) { - ssnParts = securityNumber.split('-'); - if (ssnParts.length !== 2) { - return false; - } - securityNumber = ssnParts.join(''); - } - - if (!securityNumber.match(/^(\d{4})(\d{2})(\d{2})(\d{4})$/)) { - return false; - } - - year = RegExp.$1; - month = $.formUtils.parseDateInt(RegExp.$2); - day = $.formUtils.parseDateInt(RegExp.$3); - - var ssnGender = ( parseInt((RegExp.$4).substring(2, 3)) % 2 ) === 0 ? 'female' : 'male'; - $input.trigger('genderDerived', [ssnGender]); - - // todo: remove when moving to version 3.0 - window.ssnGender = ssnGender; - - var months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - if (year % 400 === 0 || year % 4 === 0 && year % 100 !== 0) { - months[1] = 29; - } - if (month < 1 || month > 12 || day < 1 || day > months[month - 1]) { - return false; - } - - securityNumber = securityNumber.substring(2, securityNumber.length); - var check = ''; - for (var i = 0; i < securityNumber.length; i++) { - check += ((((i + 1) % 2) + 1) * securityNumber.substring(i, i + 1)); - } - var checksum = 0; - for (i = 0; i < check.length; i++) { - checksum += parseInt(check.substring(i, i + 1), 10); - } - - return checksum % 10 === 0; - }, - errorMessage: '', - errorMessageKey: 'badSecurityNumber' - }); - - $.formUtils.addValidator({ - name: 'swecounty', - validatorFunction: function (str) { - str = str.toLowerCase(); - if ($.inArray(str, this.counties) === -1) { - if (str.substr(-3).toLocaleLowerCase() !== 'län') { - return $.inArray(str + 's län', this.counties) > -1; - } - - return false; - } - else { - return true; - } - }, - errorMessage: '', - errorMessageKey: 'badCustomVal', - counties: ['stockholms län', - 'uppsala län', - 'södermanlands län', - 'östergötlands län', - 'jönköpings län', - 'kronobergs län', - 'kalmar län', - 'gotlands län', - 'blekinge län', - 'skåne län', - 'hallands län', - 'västra götalands län', - 'värmlands län', - 'örebro län', - 'västmanlands län', - 'dalarnas län', - 'gävleborgs län', - 'västernorrlands län', - 'jämtlands län', - 'västerbottens län', - 'norrbottens län'] - }); - - $.formUtils.addValidator({ - name: 'swemunicipality', - validatorFunction: function (str) { - str = str.toLowerCase(); - if ($.inArray(str, this.municipalities) === -1) { - - // First check (dont return) - if (str.substr(-8) === 's kommun') { - if ($.inArray(str.substr(0, str.length - 8), this.municipalities) > -1) { - return true; - } - } - - // Second check - if (str.substr(-7) === ' kommun') { - return $.inArray(str.substr(0, str.length - 7), this.municipalities) > -1; - } - - return false; - } - else { - return true; - } - }, - errorMessage: '', - errorMessageKey: 'badCustomVal', - municipalities: ['ale', 'alingsås', 'alvesta', 'aneby', 'arboga', 'arjeplog', 'arvidsjaur', 'arvika', 'askersund', 'avesta', 'bengtsfors', 'berg', 'bjurholm', 'bjuv', 'boden', 'bollebygd', 'bollnäs', 'borgholm', 'borlänge', 'borås', 'botkyrka', 'boxholm', 'bromölla', 'bräcke', 'burlöv', 'båstad', 'dals-ed', 'danderyd', 'degerfors', 'dorotea', 'eda', 'ekerö', 'eksjö', 'emmaboda', 'enköpings', 'eskilstuna', 'eslövs', 'essunga', 'fagersta', 'falkenberg', 'falköping', 'falu', 'filipstad', 'finspång', 'flen', 'forshaga', 'färgelanda', 'gagnef', 'gislaved', 'gnesta', 'gnosjö', 'gotland', 'grum', 'grästorp', 'gullspång', 'gällivare', 'gävle', 'göteborg', 'götene', 'habo', 'hagfor', 'hallsberg', 'hallstahammar', 'halmstad', 'hammarö', 'haninge', 'haparanda', 'heby', 'hedemora', 'helsingborg', 'herrljunga', 'hjo', 'hofor', 'huddinge', 'hudiksvall', 'hultsfred', 'hylte', 'håbo', 'hällefor', 'härjedalen', 'härnösand', 'härryda', 'hässleholm', 'höganäs', 'högsby', 'hörby', 'höör', 'jokkmokk', 'järfälla', 'jönköping', 'kalix', 'kalmar', 'karlsborg', 'karlshamn', 'karlskoga', 'karlskrona', 'karlstad', 'katrineholm', 'kil', 'kinda', 'kiruna', 'klippan', 'knivsta', 'kramfors', 'kristianstad', 'kristinehamn', 'krokoms', 'kumla', 'kungsbacka', 'kungsör', 'kungälv', 'kävlinge', 'köping', 'laholm', 'landskrona', 'laxå', 'lekeberg', 'leksand', 'lerum', 'lessebo', 'lidingö', 'lidköping', 'lilla edets', 'lindesbergs', 'linköpings', 'ljungby', 'ljusdals', 'ljusnarsbergs', 'lomma', 'ludvika', 'luleå', 'lunds', 'lycksele', 'lysekil', 'malmö', 'malung-sälen', 'malå', 'mariestad', 'marks', 'markaryd', 'mellerud', 'mjölby', 'mora', 'motala', 'mullsjö', 'munkedal', 'munkfors', 'mölndal', 'mönsterås', 'mörbylånga', 'nacka', 'nora', 'norberg', 'nordanstig', 'nordmaling', 'norrköping', 'norrtälje', 'norsjö', 'nybro', 'nykvarn', 'nyköping', 'nynäshamn', 'nässjö', 'ockelbo', 'olofström', 'orsa', 'orust', 'osby', 'oskarshamn', 'ovanåker', 'oxelösund', 'pajala', 'partille', 'perstorp', 'piteå', 'ragunda', 'robertsfors', 'ronneby', 'rättvik', 'sala', 'salem', 'sandviken', 'sigtuna', 'simrishamn', 'sjöbo', 'skara', 'skellefteå', 'skinnskatteberg', 'skurup', 'skövde', 'smedjebacken', 'sollefteå', 'sollentuna', 'solna', 'sorsele', 'sotenäs', 'staffanstorp', 'stenungsund', 'stockholm', 'storfors', 'storuman', 'strängnäs', 'strömstad', 'strömsund', 'sundbyberg', 'sundsvall', 'sunne', 'surahammar', 'svalöv', 'svedala', 'svenljunga', 'säffle', 'säter', 'sävsjö', 'söderhamns', 'söderköping', 'södertälje', 'sölvesborg', 'tanum', 'tibro', 'tidaholm', 'tierp', 'timrå', 'tingsryd', 'tjörn', 'tomelilla', 'torsby', 'torså', 'tranemo', 'tranå', 'trelleborg', 'trollhättan', 'trosa', 'tyresö', 'täby', 'töreboda', 'uddevalla', 'ulricehamns', 'umeå', 'upplands väsby', 'upplands-bro', 'uppsala', 'uppvidinge', 'vadstena', 'vaggeryd', 'valdemarsvik', 'vallentuna', 'vansbro', 'vara', 'varberg', 'vaxholm', 'vellinge', 'vetlanda', 'vilhelmina', 'vimmerby', 'vindeln', 'vingåker', 'vårgårda', 'vänersborg', 'vännäs', 'värmdö', 'värnamo', 'västervik', 'västerås', 'växjö', 'ydre', 'ystad', 'åmål', 'ånge', 'åre', 'årjäng', 'åsele', 'åstorp', 'åtvidaberg', 'älmhult', 'älvdalen', 'älvkarleby', 'älvsbyn', 'ängelholm', 'öckerö', 'ödeshög', 'örebro', 'örkelljunga', 'örnsköldsvik', 'östersund', 'österåker', 'östhammar', 'östra göinge', 'överkalix', 'övertorneå'] - }); - - - /* - * Validate phone number, at least 7 digits only one hyphen and plus allowed - */ - $.formUtils.addValidator({ - name: 'swephone', - validatorFunction: function (tele) { - var numPlus = tele.match(/\+/g); - var numHifen = tele.match(/-/g); - - if ((numPlus !== null && numPlus.length > 1) || (numHifen !== null && numHifen.length > 1)) { - return false; - } - if (numPlus !== null && tele.indexOf('+') !== 0) { - return false; - } - - tele = tele.replace(/([-|\+])/g, ''); - return tele.length > 8 && tele.match(/[^0-9]/g) === null; - }, - errorMessage: '', - errorMessageKey: 'badTelephone' - }); - - - /* - * Validate that string is a swedish telephone number - */ - $.formUtils.addValidator({ - name: 'swemobile', - validatorFunction: function (number) { - if (!$.formUtils.validators.validate_swephone.validatorFunction(number)) { - return false; - } - - number = number.replace(/[^0-9]/g, ''); - var begin = number.substring(0, 3); - - if (number.length !== 10 && begin !== '467') { - return false; - } else if (number.length !== 11 && begin === '467') { - return false; - } - return (/07[0-9{1}]/).test(begin) || begin === '467'; - }, - errorMessage: '', - errorMessageKey: 'badTelephone' - }); - - /** - * @private - * @param {Array} listItems - * @return {Array} - */ - var _makeSortedList = function (listItems) { - var newList = []; - $.each(listItems, function (i, v) { - newList.push(v.substr(0, 1).toUpperCase() + v.substr(1, v.length)); - }); - newList.sort(); - return newList; - }; - - $.fn.suggestSwedishCounty = function (settings) { - var counties = _makeSortedList($.formUtils.validators.validate_swecounty.counties); - return $.formUtils.suggest(this, counties, settings); - }; - - $.fn.suggestSwedishMunicipality = function (settings) { - var municipalities = _makeSortedList($.formUtils.validators.validate_swemunicipality.municipalities); - return $.formUtils.suggest(this, municipalities, settings); - }; - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b){a.formUtils.registerLoadedModule("sweden"),a.formUtils.addValidator({name:"swesec",validatorFunction:function(c,d){var e,f,g,h;if(d.valAttr("use-hyphen")){if(h=c.split("-"),2!==h.length)return!1;c=h.join("")}if(!c.match(/^(\d{4})(\d{2})(\d{2})(\d{4})$/))return!1;e=RegExp.$1,f=a.formUtils.parseDateInt(RegExp.$2),g=a.formUtils.parseDateInt(RegExp.$3);var i=parseInt(RegExp.$4.substring(2,3))%2===0?"female":"male";d.trigger("genderDerived",[i]),b.ssnGender=i;var j=[31,28,31,30,31,30,31,31,30,31,30,31];if((e%400===0||e%4===0&&e%100!==0)&&(j[1]=29),f<1||f>12||g<1||g>j[f-1])return!1;c=c.substring(2,c.length);for(var k="",l=0;l-1},errorMessage:"",errorMessageKey:"badCustomVal",counties:["stockholms län","uppsala län","södermanlands län","östergötlands län","jönköpings län","kronobergs län","kalmar län","gotlands län","blekinge län","skåne län","hallands län","västra götalands län","värmlands län","örebro län","västmanlands län","dalarnas län","gävleborgs län","västernorrlands län","jämtlands län","västerbottens län","norrbottens län"]}),a.formUtils.addValidator({name:"swemunicipality",validatorFunction:function(b){return b=b.toLowerCase(),a.inArray(b,this.municipalities)!==-1||("s kommun"===b.substr(-8)&&a.inArray(b.substr(0,b.length-8),this.municipalities)>-1||" kommun"===b.substr(-7)&&a.inArray(b.substr(0,b.length-7),this.municipalities)>-1)},errorMessage:"",errorMessageKey:"badCustomVal",municipalities:["ale","alingsås","alvesta","aneby","arboga","arjeplog","arvidsjaur","arvika","askersund","avesta","bengtsfors","berg","bjurholm","bjuv","boden","bollebygd","bollnäs","borgholm","borlänge","borås","botkyrka","boxholm","bromölla","bräcke","burlöv","båstad","dals-ed","danderyd","degerfors","dorotea","eda","ekerö","eksjö","emmaboda","enköpings","eskilstuna","eslövs","essunga","fagersta","falkenberg","falköping","falu","filipstad","finspång","flen","forshaga","färgelanda","gagnef","gislaved","gnesta","gnosjö","gotland","grum","grästorp","gullspång","gällivare","gävle","göteborg","götene","habo","hagfor","hallsberg","hallstahammar","halmstad","hammarö","haninge","haparanda","heby","hedemora","helsingborg","herrljunga","hjo","hofor","huddinge","hudiksvall","hultsfred","hylte","håbo","hällefor","härjedalen","härnösand","härryda","hässleholm","höganäs","högsby","hörby","höör","jokkmokk","järfälla","jönköping","kalix","kalmar","karlsborg","karlshamn","karlskoga","karlskrona","karlstad","katrineholm","kil","kinda","kiruna","klippan","knivsta","kramfors","kristianstad","kristinehamn","krokoms","kumla","kungsbacka","kungsör","kungälv","kävlinge","köping","laholm","landskrona","laxå","lekeberg","leksand","lerum","lessebo","lidingö","lidköping","lilla edets","lindesbergs","linköpings","ljungby","ljusdals","ljusnarsbergs","lomma","ludvika","luleå","lunds","lycksele","lysekil","malmö","malung-sälen","malå","mariestad","marks","markaryd","mellerud","mjölby","mora","motala","mullsjö","munkedal","munkfors","mölndal","mönsterås","mörbylånga","nacka","nora","norberg","nordanstig","nordmaling","norrköping","norrtälje","norsjö","nybro","nykvarn","nyköping","nynäshamn","nässjö","ockelbo","olofström","orsa","orust","osby","oskarshamn","ovanåker","oxelösund","pajala","partille","perstorp","piteå","ragunda","robertsfors","ronneby","rättvik","sala","salem","sandviken","sigtuna","simrishamn","sjöbo","skara","skellefteå","skinnskatteberg","skurup","skövde","smedjebacken","sollefteå","sollentuna","solna","sorsele","sotenäs","staffanstorp","stenungsund","stockholm","storfors","storuman","strängnäs","strömstad","strömsund","sundbyberg","sundsvall","sunne","surahammar","svalöv","svedala","svenljunga","säffle","säter","sävsjö","söderhamns","söderköping","södertälje","sölvesborg","tanum","tibro","tidaholm","tierp","timrå","tingsryd","tjörn","tomelilla","torsby","torså","tranemo","tranå","trelleborg","trollhättan","trosa","tyresö","täby","töreboda","uddevalla","ulricehamns","umeå","upplands väsby","upplands-bro","uppsala","uppvidinge","vadstena","vaggeryd","valdemarsvik","vallentuna","vansbro","vara","varberg","vaxholm","vellinge","vetlanda","vilhelmina","vimmerby","vindeln","vingåker","vårgårda","vänersborg","vännäs","värmdö","värnamo","västervik","västerås","växjö","ydre","ystad","åmål","ånge","åre","årjäng","åsele","åstorp","åtvidaberg","älmhult","älvdalen","älvkarleby","älvsbyn","ängelholm","öckerö","ödeshög","örebro","örkelljunga","örnsköldsvik","östersund","österåker","östhammar","östra göinge","överkalix","övertorneå"]}),a.formUtils.addValidator({name:"swephone",validatorFunction:function(a){var b=a.match(/\+/g),c=a.match(/-/g);return!(null!==b&&b.length>1||null!==c&&c.length>1)&&((null===b||0===a.indexOf("+"))&&(a=a.replace(/([-|\+])/g,""),a.length>8&&null===a.match(/[^0-9]/g)))},errorMessage:"",errorMessageKey:"badTelephone"}),a.formUtils.addValidator({name:"swemobile",validatorFunction:function(b){if(!a.formUtils.validators.validate_swephone.validatorFunction(b))return!1;b=b.replace(/[^0-9]/g,"");var c=b.substring(0,3);return(10===b.length||"467"===c)&&((11===b.length||"467"!==c)&&(/07[0-9{1}]/.test(c)||"467"===c))},errorMessage:"",errorMessageKey:"badTelephone"});var c=function(b){var c=[];return a.each(b,function(a,b){c.push(b.substr(0,1).toUpperCase()+b.substr(1,b.length))}),c.sort(),c};a.fn.suggestSwedishCounty=function(b){var d=c(a.formUtils.validators.validate_swecounty.counties);return a.formUtils.suggest(this,d,b)},a.fn.suggestSwedishMunicipality=function(b){var d=c(a.formUtils.validators.validate_swemunicipality.municipalities);return a.formUtils.suggest(this,d,b)}}(a,window)}); \ No newline at end of file diff --git a/form-validator/toggleDisabled.js b/form-validator/toggleDisabled.js index ed777f0..38bd9aa 100644 --- a/form-validator/toggleDisabled.js +++ b/form-validator/toggleDisabled.js @@ -1,138 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator Module: Toggle Disabled - * ------------------------------------------ - * Created by Victor Jonsson +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * This module will take care of disabling/enabling submit buttons - * in forms, depending on if the inputs of the form is valid or not. - * - * @website http://formvalidator.net/ - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($, window, undefined) { - - 'use strict'; - - $.formUtils.registerLoadedModule('toggleDisabled'); - - // Function that can enable/disable form - var toggleFormState = function($form, state) { - if( state === 'disabled' ) { - $form.find('*[type="submit"]') - .addClass('disabled') - .attr('disabled', 'disabled'); - } else { - $form.find('*[type="submit"]') - .removeClass('disabled') - .removeAttr('disabled'); - } - }, - isCheckingIfFormValid = false; - - $.formUtils.$win.bind('validatorsLoaded formValidationSetup', function(evt, $forms, conf) { - - var $formsToDisable = conf.disabledFormFilter ? $forms.filter(conf.disabledFormFilter) : $forms, - showErrorDialogs = conf.showErrorDialogs === undefined || conf.showErrorDialogs, - afterValidationCallback = function(evt, result, evtContext) { - var $this = $(this); - if (evtContext && evtContext.indexOf('blur') > -1) { - $this.unbind('afterValidation', afterValidationCallback); - } else { - if (result.isValid) { - $this.unbind('afterValidation', afterValidationCallback); - } else if (!$this.valAttr('have-been-blurred')) { - result.shouldChangeDisplay = false; - } - } - }; - - // Toggle form state depending on if it has only valid inputs or not. - $formsToDisable - .addClass(showErrorDialogs ? 'disabled-with-errors' : 'disabled-without-errors') - .on('reset', function() { - toggleFormState($(this), 'disabled'); - }) - .find('*[data-validation]') - .valAttr('event','keyup change') - .on('validation', function(evt, valid) { - if (!isCheckingIfFormValid) { - isCheckingIfFormValid = true; - var $form = $(this).closest('form'); - if(valid && peekIfFormIsSuccessfullyValidated($form, this, conf)) { - toggleFormState($form, 'enabled'); - } else { - toggleFormState($form, 'disabled'); - } - isCheckingIfFormValid = false; - } - }) - .on('afterValidation', afterValidationCallback) - .on('blur', function() { - $(this).valAttr('have-been-blurred', 1); - }) - .each(function() { - var $input = $(this), - validationRules = $input.attr('data-validation'); - if (validationRules.indexOf('checkbox_group') > -1) { - $input.closest('form').find('input[name="'+$input.attr('name')+'"]').each(function() { - $(this).on('change', function() { - $input.validate(); - }); - }); - } - }); - - // Notice! Async validator can't be validated onkeyup - $formsToDisable.find('[data-validation-async]').valAttr('event', 'change'); - - // Make all inputs validated on keyup, require validateOnEvent in validation config - toggleFormState($formsToDisable, 'disabled'); - - $formsToDisable.validateOnEvent(conf.language, conf); - - }) - .on('validationErrorDisplay', function(evt, $input, $elem) { - if ( $input.closest('form').hasClass('disabled-without-errors') ) { - $elem.hide(); - } - }); - - // We want to peek at the form to check if all is valid, we don't want to trigger - // the validators since that seems to cause unwanted side effects, that's hard to foresee - function peekIfFormIsSuccessfullyValidated($form, excludeInputElement, config) { - var allValid = true; - $form.find('[data-validation]').each(function() { - if (this !== excludeInputElement) { - var $elem = $(this), - hasSuccessfullyValidated = $elem.hasClass(config.successElementClass), - isOptional = $elem.valAttr('optional') === 'true', - isInvalid = $elem.hasClass(config.errorElementClass); - if (isInvalid || (!hasSuccessfullyValidated && !isOptional)) { - allValid = false; - return false; - } - } - }); - return allValid; - } - -})(jQuery, window); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b,c){"use strict";function d(b,c,d){var e=!0;return b.find("[data-validation]").each(function(){if(this!==c){var b=a(this),f=b.hasClass(d.successElementClass),g="true"===b.valAttr("optional"),h=b.hasClass(d.errorElementClass);if(h||!f&&!g)return e=!1,!1}}),e}a.formUtils.registerLoadedModule("toggleDisabled");var e=function(a,b){"disabled"===b?a.find('*[type="submit"]').addClass("disabled").attr("disabled","disabled"):a.find('*[type="submit"]').removeClass("disabled").removeAttr("disabled")},f=!1;a.formUtils.$win.bind("validatorsLoaded formValidationSetup",function(b,g,h){var i=h.disabledFormFilter?g.filter(h.disabledFormFilter):g,j=h.showErrorDialogs===c||h.showErrorDialogs,k=function(b,c,d){var e=a(this);d&&d.indexOf("blur")>-1?e.unbind("afterValidation",k):c.isValid?e.unbind("afterValidation",k):e.valAttr("have-been-blurred")||(c.shouldChangeDisplay=!1)};i.addClass(j?"disabled-with-errors":"disabled-without-errors").on("reset",function(){e(a(this),"disabled")}).find("*[data-validation]").valAttr("event","keyup change").on("validation",function(b,c){if(!f){f=!0;var g=a(this).closest("form");c&&d(g,this,h)?e(g,"enabled"):e(g,"disabled"),f=!1}}).on("afterValidation",k).on("blur",function(){a(this).valAttr("have-been-blurred",1)}).each(function(){var b=a(this),c=b.attr("data-validation");c.indexOf("checkbox_group")>-1&&b.closest("form").find('input[name="'+b.attr("name")+'"]').each(function(){a(this).on("change",function(){b.validate()})})}),i.find("[data-validation-async]").valAttr("event","change"),e(i,"disabled"),i.validateOnEvent(h.language,h)}).on("validationErrorDisplay",function(a,b,c){b.closest("form").hasClass("disabled-without-errors")&&c.hide()})}(a,window)}); \ No newline at end of file diff --git a/form-validator/uk.js b/form-validator/uk.js index 2b3b8e7..ad5cd17 100644 --- a/form-validator/uk.js +++ b/form-validator/uk.js @@ -1,162 +1,9 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -}(this, function (jQuery) { - -/** - * jQuery Form Validator Module: UK - * ------------------------------------------ - * Created by Victor Jonsson +/** File generated by Grunt -- do not modify + * JQUERY-FORM-VALIDATOR * - * This form validation module adds validators typically used on - * websites in the UK. This module adds the following validators: - * - ukvatnumber - * - ukutr - * - uknin - * - * @website http://formvalidator.net/#uk-validators - * @license MIT + * @version 2.3.79 + * @website http://formvalidator.net/ + * @author Victor Jonsson, http://victorjonsson.se + * @license MIT */ -(function($) { - - 'use strict'; - - - $.formUtils.registerLoadedModule('uk'); - - /** - * UK VAT Validator - */ - $.formUtils.addValidator({ - name : 'ukvatnumber', - validatorFunction : function(number) { - - // Code Adapted from http://www.codingforums.com/showthread.php?t=211967 - // TODO: Extra Checking for other VAT Numbers (Other countries and UK Government/Health Authorities) - - number = number.replace(/[^0-9]/g, ''); - - //Check Length - if(number.length < 9) { - return false; - } - - var valid = false; - - var VATsplit = []; - VATsplit = number.split(''); - - var checkDigits = Number(VATsplit[7] + VATsplit[8]); // two final digits as a number - - var firstDigit = VATsplit[0]; - var secondDigit = VATsplit[1]; - if ((firstDigit === 0) && (secondDigit > 0)) { - return false; - } - - var total = 0; - for (var i = 0; i < 7; i++) { // first 7 digits - total += VATsplit[i]* (8-i); // sum weighted cumulative total - } - - var c = 0; - var j = 0; - - for (var m = 8; m >= 2; m--) { - c += VATsplit[j] * m; - j++; - } - - // Traditional Algorithm for VAT numbers issued before 2010 - - while (total > 0) { - total -= 97; // deduct 97 repeatedly until total is negative - } - total = Math.abs(total); // make positive - - if (checkDigits === total) { - valid = true; - } - - // If not valid try the new method (introduced November 2009) by subtracting 55 from the mod 97 check digit if we can - else add 42 - - if (!valid) { - total = total%97; // modulus 97 - - if (total >= 55) { - total = total - 55; - } else { - total = total + 42; - } - - if (total === checkDigits) { - valid = true; - } - } - - return valid; - }, - errorMessage : '', - errorMessageKey: 'badUKVatAnswer' -}); - - /** - * UK Unique Taxpayer Reference Validator - */ - $.formUtils.addValidator({ - name: 'ukutr', - validatorFunction: function (utr) - { - var weights = [0, 6, 7, 8, 9, 10, 5, 4, 3, 2], - checkDigits = [2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1], - checkSum = 0; - - if (/\d{10}/.test(utr) && utr.length === 10) - { - for (var i = 0; i < 10; i++) { - checkSum += utr[ i ] * weights[ i ]; - } - - if (parseInt(utr.charAt(0)) === checkDigits[checkSum % 11]) - { - return true; - } - } - - return false; - }, - errorMessage: '', - errorMessageKey: 'badUkUtr' - }); - - /** - * UK National Insurance number Validator - */ - $.formUtils.addValidator({ - name: 'uknin', - validatorFunction: function(val){ - if( /^(?!BG)(?!GB)(?!NK)(?!KN)(?!TN)(?!NT)(?!ZZ)(?:[A-CEGHJ-PR-TW-Z][A-CEGHJ-NPR-TW-Z])(?:\s*\d\s*){6}([A-D]|\s)$/i.test( val ) ){ - return true; - } - - return false; - }, - errorMessage: '', - errorMessageKey: 'badUkNin' - }); - -})(jQuery); - - -})); +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){"use strict";a.formUtils.registerLoadedModule("uk"),a.formUtils.addValidator({name:"ukvatnumber",validatorFunction:function(a){if(a=a.replace(/[^0-9]/g,""),a.length<9)return!1;var b=!1,c=[];c=a.split("");var d=Number(c[7]+c[8]),e=c[0],f=c[1];if(0===e&&f>0)return!1;for(var g=0,h=0;h<7;h++)g+=c[h]*(8-h);for(var i=0,j=0,k=8;k>=2;k--)i+=c[j]*k,j++;for(;g>0;)g-=97;return g=Math.abs(g),d===g&&(b=!0),b||(g%=97,g>=55?g-=55:g+=42,g===d&&(b=!0)),b},errorMessage:"",errorMessageKey:"badUKVatAnswer"}),a.formUtils.addValidator({name:"ukutr",validatorFunction:function(a){var b=[0,6,7,8,9,10,5,4,3,2],c=[2,1,9,8,7,6,5,4,3,2,1],d=0;if(/\d{10}/.test(a)&&10===a.length){for(var e=0;e<10;e++)d+=a[e]*b[e];if(parseInt(a.charAt(0))===c[d%11])return!0}return!1},errorMessage:"",errorMessageKey:"badUkUtr"}),a.formUtils.addValidator({name:"uknin",validatorFunction:function(a){return!!/^(?!BG)(?!GB)(?!NK)(?!KN)(?!TN)(?!NT)(?!ZZ)(?:[A-CEGHJ-PR-TW-Z][A-CEGHJ-NPR-TW-Z])(?:\s*\d\s*){6}([A-D]|\s)$/i.test(a)},errorMessage:"",errorMessageKey:"badUkNin"})}(a)}); \ No newline at end of file diff --git a/package.json b/package.json index e732e6b..dd540de 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jquery-form-validator", "description": "With this feature rich jQuery plugin it becomes easy to validate user input while keeping your HTML markup clean from javascript code. Even though this plugin has a wide range of validation functions it's designed to require as little bandwidth as possible. This is achieved by grouping together validation functions in \"modules\", making it possible for the programmer to load only those functions that's needed to validate a particular form.", - "version": "2.3.78", + "version": "2.3.79", "main": "./form-validator/jquery.form-validator.min.js", "keywords": [ "form", From 6a97cd9241bb202bff87b3ee74d9da8e60646ac2 Mon Sep 17 00:00:00 2001 From: Victor Jonsson Date: Wed, 22 Aug 2018 07:54:00 +0200 Subject: [PATCH 11/15] version bump --- formvalidator.jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formvalidator.jquery.json b/formvalidator.jquery.json index 1f277cc..3507aa1 100644 --- a/formvalidator.jquery.json +++ b/formvalidator.jquery.json @@ -7,7 +7,7 @@ "validation", "validator" ], - "version": "2.3.78", + "version": "2.3.79", "author": { "name": "Victor Jonsson", "url": "http://victorjonsson.se", From 851c4afb5816a2fe3f4975ebd8f04735ed7755d3 Mon Sep 17 00:00:00 2001 From: Victor Jonsson Date: Sat, 2 Feb 2019 08:48:03 +0100 Subject: [PATCH 12/15] Update README.md --- README.md | 244 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 241 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e02a533..d3002ae 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# jQuery Form Validator +# jQuery Form Validator [DISCONTINUED] *Validation framework that let's you configure, rather than code, your validation logic.* I started writing this plugin back in 2009 and it has given me much joy over the years. But all good things must come to an end and now it's time for this plugin to pull in its oars and go down with history. -**NOTICE!** This plugin is no longer being developed! It supports jQuery v. 1.8 >= 2.2.4. No pull requests will become merged in but feel free to fork and do whatever you like! +**This plugin is no longer being developed!** It supports jQuery v. 1.8 >= 2.2.4. No pull requests will become merged in but feel free to fork and do whatever you like! [![Travis](https://travis-ci.org/victorjonsson/jQuery-Form-Validator.svg)](https://travis-ci.org/victorjonsson/jQuery-Form-Validator/builds/) @@ -82,7 +82,7 @@ Read the documentation for the default features at [#default-validators](#defaul * **letternumeric** — *Validate that the input value consists out of only letters and/or numbers* * **recaptcha** - *Validate Google [reCaptcha 2](https://www.google.com/recaptcha/intro/index.html)* -Read the documentation for the security module at [http://formvalidator.net/#security-validators](http://formvalidator.net/#security-validators) +Read the documentation for the security module at [#security-validators](#security-validators) ### Module: date * **time** — *hh:mm* @@ -487,6 +487,244 @@ You can tell any validator to ignore certain characters by using the attribute d

    ``` +## Security validators< + +### Password confirmation + +This validator can be used to validate that the values of two inputs are the same. The first input should have a name suffixed with _confirmation and the second should have the same name but without the suffix. + +``` +

    + Password (at least 8 characters) + + + Confirm password + +

    +``` + +``` +

    + E-mail + + + Repeat e-mail + +

    +``` + +### Password strength + +Use this validator to make sure that your user has a strong enough password. Set attribute data-validation-strength to 1, 2 or 3 depending on how strong password you require. + +If you want the strength of the password to be displayed while the user types you call displayPasswordStrength() in the end of the form. + +``` +
    +

    + Password: + +

    + ... +
    + + + + +``` + +### Server side validation + +By using this validator you can validate the value given by the user on the server before the form gets submitted. The validation function will send a POST request to the URL declared in data-validation-url. The argument posted to the URL will have the same name as the input being validated. + +The form will get the class validating-server-side while the server is being requested. + +The response from the validation script must be a JSON formatted object, containing the properties "valid" and "message". + +``` +{ + "valid" : true|false, + "message" : "String with text that should be displayed as error message" +} +``` + +#### Form + +``` +
    +

    + User name: + +

    + ... +
    +``` + +#### /validate-input.php + +``` + false, + 'message' => 'Post argument "user" is missing.' +); + +if( isset($_POST['user']) ) { + $userRepo = new UserRepository( DataStorage::instance() ); + $user = $userRepo->loadUser( $_POST['user'] ); + + if( $user ) { + // User name is registered on another account + $response = array('valid' => false, 'message' => 'This user name is already registered.'); + } else { + // User name is available + $response = array('valid' => true); + } +} +echo json_encode($response); +``` + +**Modifying the server request** + +The parameter containing the input value, sent to the server, will by default have the same name as the input. You can however set your own parameter name by using the attribute data-validation-param-name. You can also send along other parameters to the server by using the attribute data-validation-req-params. + +``` +$user->get('ID'))); +?> +

    + E-mail: + +

    +``` + +### Credit card validation + +This validator makes it possible to validate any of the credit cards VISA, Mastercard, Diners club, Maestro, CJB, Discover and American express + +``` +<-- Accept credit card number from Visa, Mastercard and American Express --> +

    + Credit card number + +

    +

    + Security code (cvv) + +

    +``` + +You can also let the user choose a credit card and programmatically change the allowed credit card on the input of the card number. + +``` +

    + Credit card + +

    +

    + Credit card number + +

    +... +
    + +``` + +### Simple captcha + +``` + +
    +

    + What is the sum of + ? + (security question) + +

    +

    +
    +``` + +### Google reCAPTCHA + +Use this validator if wanting to integrate the Google service reCAPTCHA. + +``` +

    + +

    +``` + +You can also use the setup function to configure the recaptcha service. + +``` +$.validate({ + reCaptchaSiteKey: '...', + reCaptchaTheme: 'light' +}); +``` + +### Letters and numbers + +By using the validator letternumeric you can validate that given input value only contains letters and/or numbers. This validator allows any type of character in contrast to the alphanumeric validator, which only allows letters A-Z. + +``` + + + + + +``` + ## Changelog #### 2.3.19 From fb8b52f3792c152c13c59975abb8eac8e3a6809b Mon Sep 17 00:00:00 2001 From: Victor Jonsson Date: Sat, 2 Feb 2019 08:53:27 +0100 Subject: [PATCH 13/15] Update README.md --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d3002ae..78defb0 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ Read the documentation for the security module at [#security-validators](#securi * **time** — *hh:mm* * **birthdate** — *yyyy-mm-dd, not allowing dates in the future or dates that's older than 122 years (format can be customized, more information below)* -Read the documentation for the date module at [http://formvalidator.net/#date-validators](http://formvalidator.net/#date-validators) +Read the documentation for the date module at [#date-validators](#date-validators) ### Module: location * **country** @@ -725,6 +725,30 @@ By using the validator letternumeric you can validate that given in ``` +## Date validators + +### Birthdate + +This validator is the same as the default date validator except that it only allows past dates and dates that is not older than 120 years. + +``` + + + + + + + + +``` + +## Time + +``` + + +``` + ## Changelog #### 2.3.19 From a4c458fb0b52be9e474156f81aad527af24def8a Mon Sep 17 00:00:00 2001 From: Victor Jonsson Date: Sat, 2 Feb 2019 09:02:15 +0100 Subject: [PATCH 14/15] Update README.md --- README.md | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 129 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78defb0..7d25e02 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Read the documentation for the date module at [#date-validators](#date-validator * Suggest countries (english only) * Suggest states in the US -Read the documentation for the location module at [http://formvalidator.net/#location-validators](http://formvalidator.net/#location-validators) +Read the documentation for the location module at [#location-validators](/#location-validators) ### Module: file * **mime** @@ -105,7 +105,7 @@ Read the documentation for the location module at [http://formvalidator.net/#loc * **size** (file size) * **dimension** (size dimension and ratio) -Read the documentation for the file module at [http://formvalidator.net/#file-validators](http://formvalidator.net/#file-validators) +Read the documentation for the file module at [#file-validators](#file-validators) ### Module: logic @@ -749,6 +749,133 @@ This validator is the same as the default da ``` + +## Location validators + +### Country + +``` + + +``` + +### State (US) + +``` + + +``` + +### Longitude and Latitude + +``` + + +``` + +### Suggest country/state + +By using this function you'll make it easier for your visitor to input a country or state. + +``` +
    + ... +

    + Which country are you from? + +

    +

    + Which state do you live in? + +

    +
    + + + + +``` + +## File validators + +### File size + +This validation is only supported by Internet Explorer 10, Mozilla FireFox v >= 3.6 and any of the later versions of webkit based browsers. + +``` + + + + + +``` + +### File type + +This validation will fall back on checking the file extension in older browsers. In modern browsers the validation will check that any of the extensions in data-validation-allowing exists in the mime type declaration of the file. This means that data-validation-allowing="pdf" will work in both modern browsers (checking against "application/pdf") and older browsers (checking the file extension ".pdf"). + +``` + + + + + +``` + +Validating multiple files (with separate error messages depending on failed validation): + +``` + +``` + +### Image dimension and ratio + +Use the validator dimension to check the dimension of an image (jpg, gif or png). + +``` + + + + + + + + + + + + + + +``` + +Use the attribute data-validation-ratio to validate that the uploaded image has a certain ratio + +``` + + + + + +``` + + ## Changelog #### 2.3.19 From cac6a2790498bf13d12f21618706dcfb7b010f76 Mon Sep 17 00:00:00 2001 From: Victor Jonsson Date: Sat, 2 Feb 2019 09:09:20 +0100 Subject: [PATCH 15/15] Update README.md --- README.md | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d25e02..e1e957b 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ Read the documentation for the file module at [#file-validators](#file-validator * **Dependent validation** * **Require "one-of"** -Read the documentation for this module at [http://formvalidator.net/#logic](http://www.formvalidator.net/#logic) +Read the documentation for this module at [/#logic](#logic) ### Module: sepa @@ -875,6 +875,88 @@ Use the attribute data-validation-ratio to validate that the upload ``` +## Logic + +### Validators depending on each other + +Use the attributes data-validation-depends-on to configure that an input is optional as long as another input is left without an answer. + +``` + +

    + Contact me: + +

    +

    + E-mail: + +

    +``` + +``` + +

    + Country: + +

    + +

    + State: + +

    + +... + + + +``` + +### Require only one out of several inputs + +Use the attribute data-validation-optional-if-answered to tell the validator that only one, out of a group of inputs, requires an answer. + +``` +

    + Home phone number: + +

    +

    + Cell phone number: + +

    +

    + Work phone number: + +

    + +``` ## Changelog