jquery-validation
Advanced tools
Comparing version 1.16.0 to 1.17.0
@@ -0,1 +1,30 @@ | ||
1.16.0 / 2016-12-01 | ||
================== | ||
## Additional | ||
* Refine cifES and nieES algorithms. Closes #1826 | ||
## Build | ||
* Include Minified Version in NPM Package | ||
* Bump dev-dependencies to latest versions | ||
## Core | ||
* Add binding for input with button type. Closes #1891 | ||
* Support jquery3. Closes #1866 | ||
* Change jQuery alias 'expr[":"]' to 'expr.pseudos' | ||
## Localisation | ||
* Add Urdu translation. Closes #1873. | ||
## Localization | ||
* Fixed wrong file-extension for az translation. Closes #1890. | ||
* Added missing translation in pt-BR (Closes #1897) | ||
* Fixed typo in arabien language file. | ||
## Tests | ||
* Upgrade QUnit to 2.0. | ||
## UMD | ||
* Better support for CommonJS. | ||
1.15.1 / 2016-07-22 | ||
@@ -27,3 +56,3 @@ ================== | ||
* Added regression unit tests for PR #1760 | ||
1.15.0 / 2016-02-24 | ||
@@ -77,3 +106,3 @@ ================== | ||
* Improving pt_BR translation and fixing a typo on the 'cifES' key. | ||
1.14.0 / 2015-06-30 | ||
@@ -80,0 +109,0 @@ ================== |
/*! | ||
* jQuery Validation Plugin v1.16.0 | ||
* jQuery Validation Plugin v1.17.0 | ||
* | ||
* http://jqueryvalidation.org/ | ||
* https://jqueryvalidation.org/ | ||
* | ||
* Copyright (c) 2016 Jörn Zaefferer | ||
* Copyright (c) 2017 Jörn Zaefferer | ||
* Released under the MIT license | ||
@@ -62,3 +62,3 @@ */ | ||
// Escape string to be used in the regex | ||
// see: http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex | ||
// see: https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex | ||
// Escape also "/*" as "/.*" as a wildcard | ||
@@ -195,5 +195,9 @@ typeParam = typeParam | ||
*/ | ||
$.validator.addMethod( "cifES", function( value ) { | ||
$.validator.addMethod( "cifES", function( value, element ) { | ||
"use strict"; | ||
if ( this.optional( element ) ) { | ||
return true; | ||
} | ||
var cifRegEx = new RegExp( /^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi ); | ||
@@ -250,10 +254,7 @@ var letter = value.substring( 0, 1 ), // [ T ] | ||
return control === control_letter; | ||
} | ||
// Can be either | ||
} else { | ||
return control === control_digit || control === control_letter; | ||
} | ||
return control === control_digit || control === control_letter; | ||
return false; | ||
}, "Please specify a valid CIF number." ); | ||
@@ -322,4 +323,4 @@ | ||
// http://jqueryvalidation.org/creditcard-method/ | ||
// based on http://en.wikipedia.org/wiki/Luhn_algorithm | ||
// https://jqueryvalidation.org/creditcard-method/ | ||
// based on https://en.wikipedia.org/wiki/Luhn_algorithm | ||
$.validator.addMethod( "creditcard", function( value, element ) { | ||
@@ -343,3 +344,3 @@ if ( this.optional( element ) ) { | ||
// Basing min and max length on | ||
// http://developer.ean.com/general_info/Valid_Credit_Card_Types | ||
// https://developer.ean.com/general_info/Valid_Credit_Card_Types | ||
if ( value.length < 13 || value.length > 19 ) { | ||
@@ -713,2 +714,6 @@ return false; | ||
$.validator.addMethod( "netmask", function( value, element ) { | ||
return this.optional( element ) || /^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test( value ); | ||
}, "Please enter a valid netmask." ); | ||
/* | ||
@@ -722,5 +727,9 @@ * The NIE (Número de Identificación de Extranjero) is a Spanish tax identification number assigned by the Spanish | ||
*/ | ||
$.validator.addMethod( "nieES", function( value ) { | ||
$.validator.addMethod( "nieES", function( value, element ) { | ||
"use strict"; | ||
if ( this.optional( element ) ) { | ||
return true; | ||
} | ||
var nieRegEx = new RegExp( /^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi ); | ||
@@ -754,5 +763,9 @@ var validChars = "TRWAGMYFPDXBNJZSQVHLCKET", | ||
*/ | ||
$.validator.addMethod( "nifES", function( value ) { | ||
$.validator.addMethod( "nifES", function( value, element ) { | ||
"use strict"; | ||
if ( this.optional( element ) ) { | ||
return true; | ||
} | ||
value = value.toUpperCase(); | ||
@@ -772,3 +785,3 @@ | ||
if ( /^[KLM]{1}/.test( value ) ) { | ||
return ( value[ 8 ] === String.fromCharCode( 64 ) ); | ||
return ( value[ 8 ] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 1 ) % 23 ) ); | ||
} | ||
@@ -780,2 +793,25 @@ | ||
/* | ||
* Numer identyfikacji podatkowej ( NIP ) is the way tax identification used in Poland for companies | ||
*/ | ||
$.validator.addMethod( "nipPL", function( value ) { | ||
"use strict"; | ||
value = value.replace( /[^0-9]/g, "" ); | ||
if ( value.length !== 10 ) { | ||
return false; | ||
} | ||
var arrSteps = [ 6, 5, 7, 2, 3, 4, 5, 6, 7 ]; | ||
var intSum = 0; | ||
for ( var i = 0; i < 9; i++ ) { | ||
intSum += arrSteps[ i ] * value[ i ]; | ||
} | ||
var int2 = intSum % 11; | ||
var intControlNr = ( int2 === 10 ) ? 0 : int2; | ||
return ( intControlNr === parseInt( value[ 9 ], 10 ) ); | ||
}, "Please specify a valid NIP number." ); | ||
$.validator.addMethod( "notEqualTo", function( value, element, param ) { | ||
@@ -827,2 +863,18 @@ return this.optional( element ) || !$.validator.methods.equalTo.call( this, value, element, param ); | ||
*/ | ||
// Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers | ||
$.validator.addMethod( "phonesUK", function( phone_number, element ) { | ||
phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); | ||
return this.optional( element ) || phone_number.length > 9 && | ||
phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/ ); | ||
}, "Please specify a valid uk phone number" ); | ||
/* For UK phone functions, do the following server side processing: | ||
* Compare original input with this RegEx pattern: | ||
* ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ | ||
* Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' | ||
* Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. | ||
* A number of very detailed GB telephone number RegEx patterns can also be found at: | ||
* http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers | ||
*/ | ||
$.validator.addMethod( "phoneUK", function( phone_number, element ) { | ||
@@ -856,18 +908,14 @@ phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); | ||
/* For UK phone functions, do the following server side processing: | ||
* Compare original input with this RegEx pattern: | ||
* ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ | ||
* Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' | ||
* Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. | ||
* A number of very detailed GB telephone number RegEx patterns can also be found at: | ||
* http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers | ||
*/ | ||
/* | ||
* Valida CEPs do brasileiros: | ||
* | ||
* Formatos aceitos: | ||
* 99999-999 | ||
* 99.999-999 | ||
* 99999999 | ||
*/ | ||
$.validator.addMethod( "postalcodeBR", function( cep_value, element ) { | ||
return this.optional( element ) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test( cep_value ); | ||
}, "Informe um CEP válido." ); | ||
// Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers | ||
$.validator.addMethod( "phonesUK", function( phone_number, element ) { | ||
phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); | ||
return this.optional( element ) || phone_number.length > 9 && | ||
phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/ ); | ||
}, "Please specify a valid uk phone number" ); | ||
/** | ||
@@ -890,14 +938,2 @@ * Matches a valid Canadian Postal Code | ||
/* | ||
* Valida CEPs do brasileiros: | ||
* | ||
* Formatos aceitos: | ||
* 99999-999 | ||
* 99.999-999 | ||
* 99999999 | ||
*/ | ||
$.validator.addMethod( "postalcodeBR", function( cep_value, element ) { | ||
return this.optional( element ) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test( cep_value ); | ||
}, "Informe um CEP válido." ); | ||
/* Matches Italian postcode (CAP) */ | ||
@@ -904,0 +940,0 @@ $.validator.addMethod( "postalcodeIT", function( value, element ) { |
/*! | ||
* jQuery Validation Plugin v1.16.0 | ||
* jQuery Validation Plugin v1.17.0 | ||
* | ||
* http://jqueryvalidation.org/ | ||
* https://jqueryvalidation.org/ | ||
* | ||
* Copyright (c) 2016 Jörn Zaefferer | ||
* Copyright (c) 2017 Jörn Zaefferer | ||
* Released under the MIT license | ||
@@ -21,3 +21,3 @@ */ | ||
// http://jqueryvalidation.org/validate/ | ||
// https://jqueryvalidation.org/validate/ | ||
validate: function( options ) { | ||
@@ -48,6 +48,7 @@ | ||
this.on( "click.validate", ":submit", function( event ) { | ||
if ( validator.settings.submitHandler ) { | ||
validator.submitButton = event.target; | ||
} | ||
// Track the used submit button to properly handle scripted | ||
// submits later. | ||
validator.submitButton = event.currentTarget; | ||
// Allow suppressing validation by adding a cancel class to the submit button | ||
@@ -73,13 +74,18 @@ if ( $( this ).hasClass( "cancel" ) ) { | ||
var hidden, result; | ||
// Insert a hidden input as a replacement for the missing submit button | ||
// The hidden input is inserted in two cases: | ||
// - A user defined a `submitHandler` | ||
// - There was a pending request due to `remote` method and `stopRequest()` | ||
// was called to submit the form in case it's valid | ||
if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) ) { | ||
hidden = $( "<input type='hidden'/>" ) | ||
.attr( "name", validator.submitButton.name ) | ||
.val( $( validator.submitButton ).val() ) | ||
.appendTo( validator.currentForm ); | ||
} | ||
if ( validator.settings.submitHandler ) { | ||
if ( validator.submitButton ) { | ||
// Insert a hidden input as a replacement for the missing submit button | ||
hidden = $( "<input type='hidden'/>" ) | ||
.attr( "name", validator.submitButton.name ) | ||
.val( $( validator.submitButton ).val() ) | ||
.appendTo( validator.currentForm ); | ||
} | ||
result = validator.settings.submitHandler.call( validator, validator.currentForm, event ); | ||
if ( validator.submitButton ) { | ||
if ( hidden ) { | ||
@@ -118,3 +124,3 @@ // And clean up afterwards; thanks to no-block-scope, hidden can be referenced | ||
// http://jqueryvalidation.org/valid/ | ||
// https://jqueryvalidation.org/valid/ | ||
valid: function() { | ||
@@ -140,3 +146,3 @@ var valid, validator, errorList; | ||
// http://jqueryvalidation.org/rules/ | ||
// https://jqueryvalidation.org/rules/ | ||
rules: function( command, argument ) { | ||
@@ -147,6 +153,15 @@ var element = this[ 0 ], | ||
// If nothing is selected, return empty object; can't chain anyway | ||
if ( element == null || element.form == null ) { | ||
if ( element == null ) { | ||
return; | ||
} | ||
if ( !element.form && element.hasAttribute( "contenteditable" ) ) { | ||
element.form = this.closest( "form" )[ 0 ]; | ||
element.name = this.attr( "name" ); | ||
} | ||
if ( element.form == null ) { | ||
return; | ||
} | ||
if ( command ) { | ||
@@ -176,5 +191,2 @@ settings = $.data( element.form, "validator" ).settings; | ||
delete existingRules[ method ]; | ||
if ( method === "required" ) { | ||
$( element ).removeAttr( "aria-required" ); | ||
} | ||
} ); | ||
@@ -199,3 +211,2 @@ return filtered; | ||
data = $.extend( { required: param }, data ); | ||
$( element ).attr( "aria-required", "true" ); | ||
} | ||
@@ -217,3 +228,3 @@ | ||
// http://jqueryvalidation.org/blank-selector/ | ||
// https://jqueryvalidation.org/blank-selector/ | ||
blank: function( a ) { | ||
@@ -223,3 +234,3 @@ return !$.trim( "" + $( a ).val() ); | ||
// http://jqueryvalidation.org/filled-selector/ | ||
// https://jqueryvalidation.org/filled-selector/ | ||
filled: function( a ) { | ||
@@ -230,3 +241,3 @@ var val = $( a ).val(); | ||
// http://jqueryvalidation.org/unchecked-selector/ | ||
// https://jqueryvalidation.org/unchecked-selector/ | ||
unchecked: function( a ) { | ||
@@ -244,3 +255,3 @@ return !$( a ).prop( "checked" ); | ||
// http://jqueryvalidation.org/jQuery.validator.format/ | ||
// https://jqueryvalidation.org/jQuery.validator.format/ | ||
$.validator.format = function( source, params ) { | ||
@@ -358,3 +369,3 @@ if ( arguments.length === 1 ) { | ||
// http://jqueryvalidation.org/jQuery.validator.setDefaults/ | ||
// https://jqueryvalidation.org/jQuery.validator.setDefaults/ | ||
setDefaults: function( settings ) { | ||
@@ -418,2 +429,3 @@ $.extend( $.validator.defaults, settings ); | ||
this.form = $( this ).closest( "form" )[ 0 ]; | ||
this.name = $( this ).attr( "name" ); | ||
} | ||
@@ -443,9 +455,5 @@ | ||
} | ||
// Add aria-required to any Static/Data/Class required fields before first validation | ||
// Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html | ||
$( this.currentForm ).find( "[required], [data-rule-required], .required" ).attr( "aria-required", "true" ); | ||
}, | ||
// http://jqueryvalidation.org/Validator.form/ | ||
// https://jqueryvalidation.org/Validator.form/ | ||
form: function() { | ||
@@ -470,3 +478,3 @@ this.checkForm(); | ||
// http://jqueryvalidation.org/Validator.element/ | ||
// https://jqueryvalidation.org/Validator.element/ | ||
element: function( element ) { | ||
@@ -522,3 +530,3 @@ var cleanElement = this.clean( element ), | ||
// http://jqueryvalidation.org/Validator.showErrors/ | ||
// https://jqueryvalidation.org/Validator.showErrors/ | ||
showErrors: function( errors ) { | ||
@@ -549,3 +557,3 @@ if ( errors ) { | ||
// http://jqueryvalidation.org/Validator.resetForm/ | ||
// https://jqueryvalidation.org/Validator.resetForm/ | ||
resetForm: function() { | ||
@@ -591,3 +599,6 @@ if ( $.fn.resetForm ) { | ||
for ( i in obj ) { | ||
if ( obj[ i ] ) { | ||
// This check allows counting elements with empty error | ||
// message as invalid elements | ||
if ( obj[ i ] !== undefined && obj[ i ] !== null && obj[ i ] !== false ) { | ||
count++; | ||
@@ -657,2 +668,3 @@ } | ||
this.form = $( this ).closest( "form" )[ 0 ]; | ||
this.name = name; | ||
} | ||
@@ -758,10 +770,17 @@ | ||
val = this.elementValue( element ), | ||
result, method, rule; | ||
result, method, rule, normalizer; | ||
// If a normalizer is defined for this element, then | ||
// call it to retreive the changed value instead | ||
// Prioritize the local normalizer defined for this element over the global one | ||
// if the former exists, otherwise user the global one in case it exists. | ||
if ( typeof rules.normalizer === "function" ) { | ||
normalizer = rules.normalizer; | ||
} else if ( typeof this.settings.normalizer === "function" ) { | ||
normalizer = this.settings.normalizer; | ||
} | ||
// If normalizer is defined, then call it to retreive the changed value instead | ||
// of using the real one. | ||
// Note that `this` in the normalizer is `element`. | ||
if ( typeof rules.normalizer === "function" ) { | ||
val = rules.normalizer.call( element, val ); | ||
if ( normalizer ) { | ||
val = normalizer.call( element, val ); | ||
@@ -772,4 +791,3 @@ if ( typeof val !== "string" ) { | ||
// Delete the normalizer from rules to avoid treating | ||
// it as a pre-defined method. | ||
// Delete the normalizer from rules to avoid treating it as a pre-defined method. | ||
delete rules.normalizer; | ||
@@ -1114,2 +1132,11 @@ } | ||
$( this.currentForm ).submit(); | ||
// Remove the hidden input that was used as a replacement for the | ||
// missing submit button. The hidden input is added by `handle()` | ||
// to ensure that the value of the used submit button is passed on | ||
// for scripted submits triggered by this method | ||
if ( this.submitButton ) { | ||
$( "input:hidden[name='" + this.submitButton.name + "']", this.currentForm ).remove(); | ||
} | ||
this.formSubmitted = false; | ||
@@ -1342,3 +1369,3 @@ } else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) { | ||
// http://jqueryvalidation.org/jQuery.validator.addMethod/ | ||
// https://jqueryvalidation.org/jQuery.validator.addMethod/ | ||
addMethod: function( name, method, message ) { | ||
@@ -1352,6 +1379,6 @@ $.validator.methods[ name ] = method; | ||
// http://jqueryvalidation.org/jQuery.validator.methods/ | ||
// https://jqueryvalidation.org/jQuery.validator.methods/ | ||
methods: { | ||
// http://jqueryvalidation.org/required-method/ | ||
// https://jqueryvalidation.org/required-method/ | ||
required: function( value, element, param ) { | ||
@@ -1375,3 +1402,3 @@ | ||
// http://jqueryvalidation.org/email-method/ | ||
// https://jqueryvalidation.org/email-method/ | ||
email: function( value, element ) { | ||
@@ -1386,3 +1413,3 @@ | ||
// http://jqueryvalidation.org/url-method/ | ||
// https://jqueryvalidation.org/url-method/ | ||
url: function( value, element ) { | ||
@@ -1397,3 +1424,3 @@ | ||
// http://jqueryvalidation.org/date-method/ | ||
// https://jqueryvalidation.org/date-method/ | ||
date: function( value, element ) { | ||
@@ -1403,3 +1430,3 @@ return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() ); | ||
// http://jqueryvalidation.org/dateISO-method/ | ||
// https://jqueryvalidation.org/dateISO-method/ | ||
dateISO: function( value, element ) { | ||
@@ -1409,3 +1436,3 @@ return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value ); | ||
// http://jqueryvalidation.org/number-method/ | ||
// https://jqueryvalidation.org/number-method/ | ||
number: function( value, element ) { | ||
@@ -1415,3 +1442,3 @@ return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value ); | ||
// http://jqueryvalidation.org/digits-method/ | ||
// https://jqueryvalidation.org/digits-method/ | ||
digits: function( value, element ) { | ||
@@ -1421,3 +1448,3 @@ return this.optional( element ) || /^\d+$/.test( value ); | ||
// http://jqueryvalidation.org/minlength-method/ | ||
// https://jqueryvalidation.org/minlength-method/ | ||
minlength: function( value, element, param ) { | ||
@@ -1428,3 +1455,3 @@ var length = $.isArray( value ) ? value.length : this.getLength( value, element ); | ||
// http://jqueryvalidation.org/maxlength-method/ | ||
// https://jqueryvalidation.org/maxlength-method/ | ||
maxlength: function( value, element, param ) { | ||
@@ -1435,3 +1462,3 @@ var length = $.isArray( value ) ? value.length : this.getLength( value, element ); | ||
// http://jqueryvalidation.org/rangelength-method/ | ||
// https://jqueryvalidation.org/rangelength-method/ | ||
rangelength: function( value, element, param ) { | ||
@@ -1442,3 +1469,3 @@ var length = $.isArray( value ) ? value.length : this.getLength( value, element ); | ||
// http://jqueryvalidation.org/min-method/ | ||
// https://jqueryvalidation.org/min-method/ | ||
min: function( value, element, param ) { | ||
@@ -1448,3 +1475,3 @@ return this.optional( element ) || value >= param; | ||
// http://jqueryvalidation.org/max-method/ | ||
// https://jqueryvalidation.org/max-method/ | ||
max: function( value, element, param ) { | ||
@@ -1454,3 +1481,3 @@ return this.optional( element ) || value <= param; | ||
// http://jqueryvalidation.org/range-method/ | ||
// https://jqueryvalidation.org/range-method/ | ||
range: function( value, element, param ) { | ||
@@ -1460,3 +1487,3 @@ return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] ); | ||
// http://jqueryvalidation.org/step-method/ | ||
// https://jqueryvalidation.org/step-method/ | ||
step: function( value, element, param ) { | ||
@@ -1499,3 +1526,3 @@ var type = $( element ).attr( "type" ), | ||
// http://jqueryvalidation.org/equalTo-method/ | ||
// https://jqueryvalidation.org/equalTo-method/ | ||
equalTo: function( value, element, param ) { | ||
@@ -1513,3 +1540,3 @@ | ||
// http://jqueryvalidation.org/remote-method/ | ||
// https://jqueryvalidation.org/remote-method/ | ||
remote: function( value, element, param, method ) { | ||
@@ -1516,0 +1543,0 @@ if ( this.optional( element ) ) { |
@@ -1,4 +0,4 @@ | ||
/*! jQuery Validation Plugin - v1.16.0 - 12/2/2016 | ||
* http://jqueryvalidation.org/ | ||
* Copyright (c) 2016 Jörn Zaefferer; Licensed MIT */ | ||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return!c.settings.submitHandler||(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),e=c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(null!=j&&null!=j.form){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}}),a.extend(a.expr.pseudos||a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){var c=a(b).val();return null!==c&&!!a.trim(""+c)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){!this.form&&this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0]);var c=a.data(this.form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!a(this).is(e.ignore)&&e[d].call(c,this,b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)a[b]&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0]),!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type;return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=b.hasAttribute("contenteditable")?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);if("function"==typeof f.normalizer){if(i=f.normalizer.call(b,i),"string"!=typeof i)throw new TypeError("The normalizer should return a string value.");delete f.normalizer}for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j instanceof TypeError&&(j.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){"string"==typeof c&&(c={method:c});var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return a.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(d,e){b[d]=a.isFunction(e)&&"normalizer"!==d?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e<=d},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var b,c={};return a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a}); | ||
/*! jQuery Validation Plugin - v1.17.0 - 7/29/2017 | ||
* https://jqueryvalidation.org/ | ||
* Copyright (c) 2017 Jörn Zaefferer; Licensed MIT */ | ||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.submitButton=b.currentTarget,a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.submitButton&&(c.settings.submitHandler||c.formSubmitted)&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),!c.settings.submitHandler||(e=c.settings.submitHandler.call(c,c.currentForm,b),d&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(null!=j&&(!j.form&&j.hasAttribute("contenteditable")&&(j.form=this.closest("form")[0],j.name=this.attr("name")),null!=j.form)){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(a,b){i[b]=f[b],delete f[b]}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g)),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}}),a.extend(a.expr.pseudos||a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){var c=a(b).val();return null!==c&&!!a.trim(""+c)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){!this.form&&this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0],this.name=a(this).attr("name"));var c=a.data(this.form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!a(this).is(e.ignore)&&e[d].call(c,this,b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)void 0!==a[b]&&null!==a[b]&&a[b]!==!1&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0],this.name=d),!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type;return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=b.hasAttribute("contenteditable")?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f,g=a(b).rules(),h=a.map(g,function(a,b){return b}).length,i=!1,j=this.elementValue(b);if("function"==typeof g.normalizer?f=g.normalizer:"function"==typeof this.settings.normalizer&&(f=this.settings.normalizer),f){if(j=f.call(b,j),"string"!=typeof j)throw new TypeError("The normalizer should return a string value.");delete g.normalizer}for(d in g){e={method:d,parameters:g[d]};try{if(c=a.validator.methods[d].call(this,j,b,e.parameters),"dependency-mismatch"===c&&1===h){i=!0;continue}if(i=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(k){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",k),k instanceof TypeError&&(k.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),k}}if(!i)return this.objectLength(g)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){"string"==typeof c&&(c={method:c});var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return a.replace(/([\\!"#$%&'()*+,.\/:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.submitButton&&a("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(d,e){b[d]=a.isFunction(e)&&"normalizer"!==d?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e<=d},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var b,c={};return a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a}); |
@@ -26,2 +26,3 @@ (function( factory ) { | ||
equalTo: "Veuillez fournir encore la même valeur.", | ||
notEqualTo: "Veuillez fournir une valeur différente, les valeurs ne doivent pas être identiques.", | ||
extension: "Veuillez fournir une valeur avec une extension valide.", | ||
@@ -34,2 +35,3 @@ maxlength: $.validator.format( "Veuillez fournir au plus {0} caractères." ), | ||
min: $.validator.format( "Veuillez fournir une valeur supérieure ou égale à {0}." ), | ||
step: $.validator.format( "Veuillez fournir une valeur multiple de {0}." ), | ||
maxWords: $.validator.format( "Veuillez fournir au plus {0} mots." ), | ||
@@ -36,0 +38,0 @@ minWords: $.validator.format( "Veuillez fournir au moins {0} mots." ), |
@@ -31,5 +31,6 @@ (function( factory ) { | ||
remote: "Kérem javítsa ki ezt a mezőt.", | ||
dateISO: "Kérem írjon be egy érvényes dátumot (ISO)." | ||
dateISO: "Kérem írjon be egy érvényes dátumot (ISO).", | ||
step: $.validator.format( "A {0} egyik többszörösét adja meg." ) | ||
} ); | ||
return $; | ||
})); |
@@ -31,2 +31,3 @@ (function( factory ) { | ||
range: $.validator.format( "{0} から {1} までの値を入力してください。" ), | ||
step: $.validator.format( "{0} の倍数を入力してください。" ), | ||
max: $.validator.format( "{0} 以下の値を入力してください。" ), | ||
@@ -33,0 +34,0 @@ min: $.validator.format( "{0} 以上の値を入力してください。" ) |
@@ -33,2 +33,3 @@ (function( factory ) { | ||
min: $.validator.format( "Vul hier een waarde in groter dan of gelijk aan {0}." ), | ||
step: $.validator.format( "Vul hier een veelvoud van {0} in." ), | ||
@@ -35,0 +36,0 @@ // For validations in additional-methods.js |
@@ -32,2 +32,3 @@ (function( factory ) { | ||
min: $.validator.format( "Angi en verdi som er større eller lik {0}." ), | ||
step: $.validator.format( "Angi en verdi ganger {0}." ), | ||
creditcard: "Angi et gyldig kredittkortnummer." | ||
@@ -34,0 +35,0 @@ } ); |
@@ -27,2 +27,3 @@ (function( factory ) { | ||
extension: "Proszę o podanie wartości z prawidłowym rozszerzeniem.", | ||
nipPL: "Proszę o podanie prawidłowego numeru NIP.", | ||
maxlength: $.validator.format( "Proszę o podanie nie więcej niż {0} znaków." ), | ||
@@ -29,0 +30,0 @@ minlength: $.validator.format( "Proszę o podanie przynajmniej {0} znaków." ), |
@@ -18,2 +18,5 @@ (function( factory ) { | ||
return this.optional( element ) || /^\d\d?[\.\/\-]\d\d?[\.\/\-]\d\d\d?\d?$/.test( value ); | ||
}, | ||
number: function( value, element ) { | ||
return this.optional( element ) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test( value ); | ||
} | ||
@@ -20,0 +23,0 @@ } ); |
@@ -5,4 +5,4 @@ { | ||
"description": "Client-side form validation made easy", | ||
"version": "1.16.0", | ||
"homepage": "http://jqueryvalidation.org/", | ||
"version": "1.17.0", | ||
"homepage": "https://jqueryvalidation.org/", | ||
"license": "MIT", | ||
@@ -16,6 +16,6 @@ "author": { | ||
"type": "git", | ||
"url": "git://github.com/jzaefferer/jquery-validation.git" | ||
"url": "git://github.com/jquery-validation/jquery-validation.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/jzaefferer/jquery-validation/issues" | ||
"url": "https://github.com/jquery-validation/jquery-validation/issues" | ||
}, | ||
@@ -25,3 +25,3 @@ "licenses": [ | ||
"type": "MIT", | ||
"url": "http://www.opensource.org/licenses/MIT" | ||
"url": "https://www.opensource.org/licenses/MIT" | ||
} | ||
@@ -55,3 +55,3 @@ ], | ||
"grunt-text-replace": "0.4.0", | ||
"qunitjs": "2.0.0" | ||
"qunitjs": "2.3.3" | ||
}, | ||
@@ -58,0 +58,0 @@ "keywords": [ |
@@ -1,7 +0,6 @@ | ||
[jQuery Validation Plugin](http://jqueryvalidation.org/) - Form validation made easy | ||
[jQuery Validation Plugin](https://jqueryvalidation.org/) - Form validation made easy | ||
================================ | ||
[![Build Status](https://secure.travis-ci.org/jzaefferer/jquery-validation.svg)](http://travis-ci.org/jzaefferer/jquery-validation) | ||
[![devDependency Status](https://david-dm.org/jzaefferer/jquery-validation/dev-status.svg?theme=shields.io)](https://david-dm.org/jzaefferer/jquery-validation#info=devDependencies) | ||
[![Join the chat at https://gitter.im/jzaefferer/jquery-validation](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jzaefferer/jquery-validation) | ||
[![Build Status](https://secure.travis-ci.org/jquery-validation/jquery-validation.svg)](https://travis-ci.org/jquery-validation/jquery-validation) | ||
[![devDependency Status](https://david-dm.org/jquery-validation/jquery-validation/dev-status.svg?theme=shields.io)](https://david-dm.org/jquery-validation/jquery-validation#info=devDependencies) | ||
@@ -14,3 +13,3 @@ The jQuery Validation Plugin provides drop-in validation for your existing forms, while making all kinds of customizations to fit your application really easy. | ||
Prebuilt files can be downloaded from http://jqueryvalidation.org/ | ||
Prebuilt files can be downloaded from https://jqueryvalidation.org/ | ||
@@ -21,3 +20,3 @@ ### Downloading the latest changes | ||
1. [Downloading](https://github.com/jzaefferer/jquery-validation/archive/master.zip) or Forking this repository | ||
1. [Downloading](https://github.com/jquery-validation/jquery-validation/archive/master.zip) or Forking this repository | ||
2. [Setup the build](CONTRIBUTING.md#build-setup) | ||
@@ -49,3 +48,3 @@ 3. Run `grunt` to create the built files in the "dist" directory | ||
For more information on how to setup a rules and customizations, [check the documentation](http://jqueryvalidation.org/documentation/). | ||
For more information on how to setup a rules and customizations, [check the documentation](https://jqueryvalidation.org/documentation/). | ||
@@ -56,7 +55,26 @@ ## Reporting issues and contributing code | ||
**IMPORTANT NOTE ABOUT EMAIL VALIDATION**. As of version 1.12.0 this plugin is using the same regular expression that the [HTML5 specification suggests for browsers to use](https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address). We will follow their lead and use the same check. If you think the specification is wrong, please report the issue to them. If you have different requirements, consider [using a custom method](http://jqueryvalidation.org/jQuery.validator.addMethod/). | ||
In case you need to adjust the built-in validation regular expression patterns, please [follow the documentation](http://jqueryvalidation.org/jQuery.validator.methods/). | ||
**IMPORTANT NOTE ABOUT EMAIL VALIDATION**. As of version 1.12.0 this plugin is using the same regular expression that the [HTML5 specification suggests for browsers to use](https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address). We will follow their lead and use the same check. If you think the specification is wrong, please report the issue to them. If you have different requirements, consider [using a custom method](https://jqueryvalidation.org/jQuery.validator.addMethod/). | ||
In case you need to adjust the built-in validation regular expression patterns, please [follow the documentation](https://jqueryvalidation.org/jQuery.validator.methods/). | ||
**IMPORTANT NOTE ABOUT REQUIRED METHOD**. As of version 1.14.0 this plugin stops trimming white spaces from the value of the attached element. If you want to achieve the same result, you can use the [`normalizer`](https://jqueryvalidation.org/normalizer/) that can be used to transform the value of an element before validation. This feature was available since `v1.15.0`. In other words, you can do something like this: | ||
``` js | ||
$("#myForm").validate({ | ||
rules: { | ||
username: { | ||
required: true, | ||
// Using the normalizer to trim the value of the element | ||
// before validating it. | ||
// | ||
// The value of `this` inside the `normalizer` is the corresponding | ||
// DOMElement. In this example, `this` references the `username` element. | ||
normalizer: function(value) { | ||
return $.trim(value); | ||
} | ||
} | ||
} | ||
}); | ||
``` | ||
## License | ||
Copyright © Jörn Zaefferer<br> | ||
Licensed under the MIT license. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
268268
4458
77