Commit 0aa2a433 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

jquery validation plugin 1.11.0.

parent cbb03748
......@@ -12,7 +12,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts52798239.63</string> </value>
<value> <string>ts63959068.92</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -26,9 +26,9 @@
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*! jQuery Validation Plugin - v1.10.0 - 9/7/2012\n
/*! jQuery Validation Plugin - v1.11.0 - 2/4/2013\n
* https://github.com/jzaefferer/jquery-validation\n
* Copyright (c) 2012 Jörn Zaefferer; Licensed MIT, GPL */\n
* Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */\n
\n
(function($) {\n
\n
......@@ -37,33 +37,33 @@ $.extend($.fn, {\n
\tvalidate: function( options ) {\n
\n
\t\t// if nothing is selected, return nothing; can\'t chain anyway\n
\t\tif (!this.length) {\n
\t\t\tif (options && options.debug && window.console) {\n
\t\t\t\tconsole.warn( "nothing selected, can\'t validate, returning nothing" );\n
\t\tif ( !this.length ) {\n
\t\t\tif ( options && options.debug && window.console ) {\n
\t\t\t\tconsole.warn( "Nothing selected, can\'t validate, returning nothing." );\n
\t\t\t}\n
\t\t\treturn;\n
\t\t}\n
\n
\t\t// check if a validator for this form was already created\n
\t\tvar validator = $.data(this[0], \'validator\');\n
\t\tvar validator = $.data( this[0], "validator" );\n
\t\tif ( validator ) {\n
\t\t\treturn validator;\n
\t\t}\n
\n
\t\t// Add novalidate tag if HTML5.\n
\t\tthis.attr(\'novalidate\', \'novalidate\');\n
\t\tthis.attr( "novalidate", "novalidate" );\n
\n
\t\tvalidator = new $.validator( options, this[0] );\n
\t\t$.data(this[0], \'validator\', validator);\n
\t\t$.data( this[0], "validator", validator );\n
\n
\t\tif ( validator.settings.onsubmit ) {\n
\n
\t\t\tthis.validateDelegate( ":submit", "click", function(ev) {\n
\t\t\tthis.validateDelegate( ":submit", "click", function( event ) {\n
\t\t\t\tif ( validator.settings.submitHandler ) {\n
\t\t\t\t\tvalidator.submitButton = ev.target;\n
\t\t\t\t\tvalidator.submitButton = event.target;\n
\t\t\t\t}\n
\t\t\t\t// allow suppressing validation by adding a cancel class to the submit button\n
\t\t\t\tif ( $(ev.target).hasClass(\'cancel\') ) {\n
\t\t\t\tif ( $(event.target).hasClass("cancel") ) {\n
\t\t\t\t\tvalidator.cancelSubmit = true;\n
\t\t\t\t}\n
\t\t\t});\n
......@@ -77,12 +77,12 @@ $.extend($.fn, {\n
\t\t\t\tfunction handle() {\n
\t\t\t\t\tvar hidden;\n
\t\t\t\t\tif ( validator.settings.submitHandler ) {\n
\t\t\t\t\t\tif (validator.submitButton) {\n
\t\t\t\t\t\tif ( validator.submitButton ) {\n
\t\t\t\t\t\t\t// insert a hidden input as a replacement for the missing submit button\n
\t\t\t\t\t\t\thidden = $("<input type=\'hidden\'/>").attr("name", validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);\n
\t\t\t\t\t\t}\n
\t\t\t\t\t\tvalidator.settings.submitHandler.call( validator, validator.currentForm, event );\n
\t\t\t\t\t\tif (validator.submitButton) {\n
\t\t\t\t\t\tif ( validator.submitButton ) {\n
\t\t\t\t\t\t\t// and clean up afterwards; thanks to no-block-scope, hidden can be referenced\n
\t\t\t\t\t\t\thidden.remove();\n
\t\t\t\t\t\t}\n
......@@ -113,7 +113,7 @@ $.extend($.fn, {\n
\t},\n
\t// http://docs.jquery.com/Plugins/Validation/valid\n
\tvalid: function() {\n
\t\tif ( $(this[0]).is(\'form\')) {\n
\t\tif ( $(this[0]).is("form")) {\n
\t\t\treturn this.validate().form();\n
\t\t} else {\n
\t\t\tvar valid = true;\n
......@@ -125,38 +125,38 @@ $.extend($.fn, {\n
\t\t}\n
\t},\n
\t// attributes: space seperated list of attributes to retrieve and remove\n
\tremoveAttrs: function(attributes) {\n
\tremoveAttrs: function( attributes ) {\n
\t\tvar result = {},\n
\t\t\t$element = this;\n
\t\t$.each(attributes.split(/\\s/), function(index, value) {\n
\t\t$.each(attributes.split(/\\s/), function( index, value ) {\n
\t\t\tresult[value] = $element.attr(value);\n
\t\t\t$element.removeAttr(value);\n
\t\t});\n
\t\treturn result;\n
\t},\n
\t// http://docs.jquery.com/Plugins/Validation/rules\n
\trules: function(command, argument) {\n
\trules: function( command, argument ) {\n
\t\tvar element = this[0];\n
\n
\t\tif (command) {\n
\t\t\tvar settings = $.data(element.form, \'validator\').settings;\n
\t\tif ( command ) {\n
\t\t\tvar settings = $.data(element.form, "validator").settings;\n
\t\t\tvar staticRules = settings.rules;\n
\t\t\tvar existingRules = $.validator.staticRules(element);\n
\t\t\tswitch(command) {\n
\t\t\tcase "add":\n
\t\t\t\t$.extend(existingRules, $.validator.normalizeRule(argument));\n
\t\t\t\tstaticRules[element.name] = existingRules;\n
\t\t\t\tif (argument.messages) {\n
\t\t\t\tif ( argument.messages ) {\n
\t\t\t\t\tsettings.messages[element.name] = $.extend( settings.messages[element.name], argument.messages );\n
\t\t\t\t}\n
\t\t\t\tbreak;\n
\t\t\tcase "remove":\n
\t\t\t\tif (!argument) {\n
\t\t\t\tif ( !argument ) {\n
\t\t\t\t\tdelete staticRules[element.name];\n
\t\t\t\t\treturn existingRules;\n
\t\t\t\t}\n
\t\t\t\tvar filtered = {};\n
\t\t\t\t$.each(argument.split(/\\s/), function(index, method) {\n
\t\t\t\t$.each(argument.split(/\\s/), function( index, method ) {\n
\t\t\t\t\tfiltered[method] = existingRules[method];\n
\t\t\t\t\tdelete existingRules[method];\n
\t\t\t\t});\n
......@@ -167,14 +167,14 @@ $.extend($.fn, {\n
\t\tvar data = $.validator.normalizeRules(\n
\t\t$.extend(\n
\t\t\t{},\n
\t\t\t$.validator.metadataRules(element),\n
\t\t\t$.validator.classRules(element),\n
\t\t\t$.validator.attributeRules(element),\n
\t\t\t$.validator.dataRules(element),\n
\t\t\t$.validator.staticRules(element)\n
\t\t), element);\n
\n
\t\t// make sure required is at front\n
\t\tif (data.required) {\n
\t\tif ( data.required ) {\n
\t\t\tvar param = data.required;\n
\t\t\tdelete data.required;\n
\t\t\tdata = $.extend({required: param}, data);\n
......@@ -187,11 +187,11 @@ $.extend($.fn, {\n
// Custom selectors\n
$.extend($.expr[":"], {\n
\t// http://docs.jquery.com/Plugins/Validation/blank\n
\tblank: function(a) {return !$.trim("" + a.value);},\n
\tblank: function( a ) { return !$.trim("" + a.value); },\n
\t// http://docs.jquery.com/Plugins/Validation/filled\n
\tfilled: function(a) {return !!$.trim("" + a.value);},\n
\tfilled: function( a ) { return !!$.trim("" + a.value); },\n
\t// http://docs.jquery.com/Plugins/Validation/unchecked\n
\tunchecked: function(a) {return !a.checked;}\n
\tunchecked: function( a ) { return !a.checked; }\n
});\n
\n
// constructor for validator\n
......@@ -201,7 +201,7 @@ $.validator = function( options, form ) {\n
\tthis.init();\n
};\n
\n
$.validator.format = function(source, params) {\n
$.validator.format = function( source, params ) {\n
\tif ( arguments.length === 1 ) {\n
\t\treturn function() {\n
\t\t\tvar args = $.makeArray(arguments);\n
......@@ -215,8 +215,10 @@ $.validator.format = function(source, params) {\n
\tif ( params.constructor !== Array ) {\n
\t\tparams = [ params ];\n
\t}\n
\t$.each(params, function(i, n) {\n
\t\tsource = source.replace(new RegExp("\\\\{" + i + "\\\\}", "g"), n);\n
\t$.each(params, function( i, n ) {\n
\t\tsource = source.replace( new RegExp("\\\\{" + i + "\\\\}", "g"), function() {\n
\t\t\treturn n;\n
\t\t});\n
\t});\n
\treturn source;\n
};\n
......@@ -231,12 +233,12 @@ $.extend($.validator, {\n
\t\tvalidClass: "valid",\n
\t\terrorElement: "label",\n
\t\tfocusInvalid: true,\n
\t\terrorContainer: $( [] ),\n
\t\terrorLabelContainer: $( [] ),\n
\t\terrorContainer: $([]),\n
\t\terrorLabelContainer: $([]),\n
\t\tonsubmit: true,\n
\t\tignore: ":hidden",\n
\t\tignoreTitle: false,\n
\t\tonfocusin: function(element, event) {\n
\t\tonfocusin: function( element, event ) {\n
\t\t\tthis.lastActive = element;\n
\n
\t\t\t// hide error label and remove error class on focus if enabled\n
......@@ -247,37 +249,37 @@ $.extend($.validator, {\n
\t\t\t\tthis.addWrapper(this.errorsFor(element)).hide();\n
\t\t\t}\n
\t\t},\n
\t\tonfocusout: function(element, event) {\n
\t\tonfocusout: function( element, event ) {\n
\t\t\tif ( !this.checkable(element) && (element.name in this.submitted || !this.optional(element)) ) {\n
\t\t\t\tthis.element(element);\n
\t\t\t}\n
\t\t},\n
\t\tonkeyup: function(element, event) {\n
\t\t\tif ( event.which === 9 && this.elementValue(element) === \'\' ) {\n
\t\tonkeyup: function( element, event ) {\n
\t\t\tif ( event.which === 9 && this.elementValue(element) === "" ) {\n
\t\t\t\treturn;\n
\t\t\t} else if ( element.name in this.submitted || element === this.lastActive ) {\n
\t\t\t} else if ( element.name in this.submitted || element === this.lastElement ) {\n
\t\t\t\tthis.element(element);\n
\t\t\t}\n
\t\t},\n
\t\tonclick: function(element, event) {\n
\t\tonclick: function( element, event ) {\n
\t\t\t// click on selects, radiobuttons and checkboxes\n
\t\t\tif ( element.name in this.submitted ) {\n
\t\t\t\tthis.element(element);\n
\t\t\t}\n
\t\t\t// or option elements, check parent select in that case\n
\t\t\telse if (element.parentNode.name in this.submitted) {\n
\t\t\telse if ( element.parentNode.name in this.submitted ) {\n
\t\t\t\tthis.element(element.parentNode);\n
\t\t\t}\n
\t\t},\n
\t\thighlight: function(element, errorClass, validClass) {\n
\t\t\tif (element.type === \'radio\') {\n
\t\thighlight: function( element, errorClass, validClass ) {\n
\t\t\tif ( element.type === "radio" ) {\n
\t\t\t\tthis.findByName(element.name).addClass(errorClass).removeClass(validClass);\n
\t\t\t} else {\n
\t\t\t\t$(element).addClass(errorClass).removeClass(validClass);\n
\t\t\t}\n
\t\t},\n
\t\tunhighlight: function(element, errorClass, validClass) {\n
\t\t\tif (element.type === \'radio\') {\n
\t\tunhighlight: function( element, errorClass, validClass ) {\n
\t\t\tif ( element.type === "radio" ) {\n
\t\t\t\tthis.findByName(element.name).removeClass(errorClass).addClass(validClass);\n
\t\t\t} else {\n
\t\t\t\t$(element).removeClass(errorClass).addClass(validClass);\n
......@@ -286,7 +288,7 @@ $.extend($.validator, {\n
\t},\n
\n
\t// http://docs.jquery.com/Plugins/Validation/Validator/setDefaults\n
\tsetDefaults: function(settings) {\n
\tsetDefaults: function( settings ) {\n
\t\t$.extend( $.validator.defaults, settings );\n
\t},\n
\n
......@@ -325,20 +327,23 @@ $.extend($.validator, {\n
\t\t\tthis.reset();\n
\n
\t\t\tvar groups = (this.groups = {});\n
\t\t\t$.each(this.settings.groups, function(key, value) {\n
\t\t\t\t$.each(value.split(/\\s/), function(index, name) {\n
\t\t\t$.each(this.settings.groups, function( key, value ) {\n
\t\t\t\tif ( typeof value === "string" ) {\n
\t\t\t\t\tvalue = value.split(/\\s/);\n
\t\t\t\t}\n
\t\t\t\t$.each(value, function( index, name ) {\n
\t\t\t\t\tgroups[name] = key;\n
\t\t\t\t});\n
\t\t\t});\n
\t\t\tvar rules = this.settings.rules;\n
\t\t\t$.each(rules, function(key, value) {\n
\t\t\t$.each(rules, function( key, value ) {\n
\t\t\t\trules[key] = $.validator.normalizeRule(value);\n
\t\t\t});\n
\n
\t\t\tfunction delegate(event) {\n
\t\t\t\tvar validator = $.data(this[0].form, "validator"),\n
\t\t\t\t\teventType = "on" + event.type.replace(/^validate/, "");\n
\t\t\t\tif (validator.settings[eventType]) {\n
\t\t\t\tif ( validator.settings[eventType] ) {\n
\t\t\t\t\tvalidator.settings[eventType].call(validator, this[0], event);\n
\t\t\t\t}\n
\t\t\t}\n
......@@ -351,7 +356,7 @@ $.extend($.validator, {\n
\t\t\t\t\t"focusin focusout keyup", delegate)\n
\t\t\t\t.validateDelegate("[type=\'radio\'], [type=\'checkbox\'], select, option", "click", delegate);\n
\n
\t\t\tif (this.settings.invalidHandler) {\n
\t\t\tif ( this.settings.invalidHandler ) {\n
\t\t\t\t$(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler);\n
\t\t\t}\n
\t\t},\n
......@@ -361,7 +366,7 @@ $.extend($.validator, {\n
\t\t\tthis.checkForm();\n
\t\t\t$.extend(this.submitted, this.errorMap);\n
\t\t\tthis.invalid = $.extend({}, this.errorMap);\n
\t\t\tif (!this.valid()) {\n
\t\t\tif ( !this.valid() ) {\n
\t\t\t\t$(this.currentForm).triggerHandler("invalid-form", [this]);\n
\t\t\t}\n
\t\t\tthis.showErrors();\n
......@@ -383,7 +388,7 @@ $.extend($.validator, {\n
\t\t\tthis.prepareElement( element );\n
\t\t\tthis.currentElements = $(element);\n
\t\t\tvar result = this.check( element ) !== false;\n
\t\t\tif (result) {\n
\t\t\tif ( result ) {\n
\t\t\t\tdelete this.invalid[element.name];\n
\t\t\t} else {\n
\t\t\t\tthis.invalid[element.name] = true;\n
......@@ -397,8 +402,8 @@ $.extend($.validator, {\n
\t\t},\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Validator/showErrors\n
\t\tshowErrors: function(errors) {\n
\t\t\tif(errors) {\n
\t\tshowErrors: function( errors ) {\n
\t\t\tif ( errors ) {\n
\t\t\t\t// add items to error list and map\n
\t\t\t\t$.extend( this.errorMap, errors );\n
\t\t\t\tthis.errorList = [];\n
......@@ -409,11 +414,11 @@ $.extend($.validator, {\n
\t\t\t\t\t});\n
\t\t\t\t}\n
\t\t\t\t// remove items from success list\n
\t\t\t\tthis.successList = $.grep( this.successList, function(element) {\n
\t\t\t\tthis.successList = $.grep( this.successList, function( element ) {\n
\t\t\t\t\treturn !(element.name in errors);\n
\t\t\t\t});\n
\t\t\t}\n
\t\t\tif (this.settings.showErrors) {\n
\t\t\tif ( this.settings.showErrors ) {\n
\t\t\t\tthis.settings.showErrors.call( this, this.errorMap, this.errorList );\n
\t\t\t} else {\n
\t\t\t\tthis.defaultShowErrors();\n
......@@ -423,7 +428,7 @@ $.extend($.validator, {\n
\t\t// http://docs.jquery.com/Plugins/Validation/Validator/resetForm\n
\t\tresetForm: function() {\n
\t\t\tif ( $.fn.resetForm ) {\n
\t\t\t\t$( this.currentForm ).resetForm();\n
\t\t\t\t$(this.currentForm).resetForm();\n
\t\t\t}\n
\t\t\tthis.submitted = {};\n
\t\t\tthis.lastElement = null;\n
......@@ -457,7 +462,7 @@ $.extend($.validator, {\n
\t\t},\n
\n
\t\tfocusInvalid: function() {\n
\t\t\tif( this.settings.focusInvalid ) {\n
\t\t\tif ( this.settings.focusInvalid ) {\n
\t\t\t\ttry {\n
\t\t\t\t\t$(this.findLastActive() || this.errorList.length && this.errorList[0].element || [])\n
\t\t\t\t\t.filter(":visible")\n
......@@ -472,7 +477,7 @@ $.extend($.validator, {\n
\n
\t\tfindLastActive: function() {\n
\t\t\tvar lastActive = this.lastActive;\n
\t\t\treturn lastActive && $.grep(this.errorList, function(n) {\n
\t\t\treturn lastActive && $.grep(this.errorList, function( n ) {\n
\t\t\t\treturn n.element.name === lastActive.name;\n
\t\t\t}).length === 1 && lastActive;\n
\t\t},\n
......@@ -502,12 +507,12 @@ $.extend($.validator, {\n
\t\t},\n
\n
\t\tclean: function( selector ) {\n
\t\t\treturn $( selector )[0];\n
\t\t\treturn $(selector)[0];\n
\t\t},\n
\n
\t\terrors: function() {\n
\t\t\tvar errorClass = this.settings.errorClass.replace(\' \', \'.\');\n
\t\t\treturn $( this.settings.errorElement + "." + errorClass, this.errorContext );\n
\t\t\tvar errorClass = this.settings.errorClass.replace(" ", ".");\n
\t\t\treturn $(this.settings.errorElement + "." + errorClass, this.errorContext);\n
\t\t},\n
\n
\t\treset: function() {\n
......@@ -530,14 +535,14 @@ $.extend($.validator, {\n
\t\t},\n
\n
\t\telementValue: function( element ) {\n
\t\t\tvar type = $(element).attr(\'type\'),\n
\t\t\tvar type = $(element).attr("type"),\n
\t\t\t\tval = $(element).val();\n
\n
\t\t\tif ( type === \'radio\' || type === \'checkbox\' ) {\n
\t\t\t\treturn $(\'input[name="\' + $(element).attr(\'name\') + \'"]:checked\').val();\n
\t\t\tif ( type === "radio" || type === "checkbox" ) {\n
\t\t\t\treturn $("input[name=\'" + $(element).attr("name") + "\']:checked").val();\n
\t\t\t}\n
\n
\t\t\tif ( typeof val === \'string\' ) {\n
\t\t\tif ( typeof val === "string" ) {\n
\t\t\t\treturn val.replace(/\\r/g, "");\n
\t\t\t}\n
\t\t\treturn val;\n
......@@ -570,18 +575,18 @@ $.extend($.validator, {\n
\t\t\t\t\t\treturn;\n
\t\t\t\t\t}\n
\n
\t\t\t\t\tif( !result ) {\n
\t\t\t\t\tif ( !result ) {\n
\t\t\t\t\t\tthis.formatAndAdd( element, rule );\n
\t\t\t\t\t\treturn false;\n
\t\t\t\t\t}\n
\t\t\t\t} catch(e) {\n
\t\t\t\t\tif ( this.settings.debug && window.console ) {\n
\t\t\t\t\t\tconsole.log("exception occured when checking element " + element.id + ", check the \'" + rule.method + "\' method", e);\n
\t\t\t\t\t\tconsole.log( "Exception occured when checking element " + element.id + ", check the \'" + rule.method + "\' method.", e );\n
\t\t\t\t\t}\n
\t\t\t\t\tthrow e;\n
\t\t\t\t}\n
\t\t\t}\n
\t\t\tif (dependencyMismatch) {\n
\t\t\tif ( dependencyMismatch ) {\n
\t\t\t\treturn;\n
\t\t\t}\n
\t\t\tif ( this.objectLength(rules) ) {\n
......@@ -591,19 +596,9 @@ $.extend($.validator, {\n
\t\t},\n
\n
\t\t// return the custom message for the given element and validation method\n
\t\t// specified in the element\'s "messages" metadata\n
\t\tcustomMetaMessage: function(element, method) {\n
\t\t\tif (!$.metadata) {\n
\t\t\t\treturn;\n
\t\t\t}\n
\t\t\tvar meta = this.settings.meta ? $(element).metadata()[this.settings.meta] : $(element).metadata();\n
\t\t\treturn meta && meta.messages && meta.messages[method];\n
\t\t},\n
\n
\t\t// return the custom message for the given element and validation method\n
\t\t// specified in the element\'s HTML5 data attribute\n
\t\tcustomDataMessage: function(element, method) {\n
\t\t\treturn $(element).data(\'msg-\' + method.toLowerCase()) || (element.attributes && $(element).attr(\'data-msg-\' + method.toLowerCase()));\n
\t\tcustomDataMessage: function( element, method ) {\n
\t\t\treturn $(element).data("msg-" + method.toLowerCase()) || (element.attributes && $(element).attr("data-msg-" + method.toLowerCase()));\n
\t\t},\n
\n
\t\t// return the custom message for the given element name and validation method\n
......@@ -615,18 +610,17 @@ $.extend($.validator, {\n
\t\t// return the first defined argument, allowing empty strings\n
\t\tfindDefined: function() {\n
\t\t\tfor(var i = 0; i < arguments.length; i++) {\n
\t\t\t\tif (arguments[i] !== undefined) {\n
\t\t\t\tif ( arguments[i] !== undefined ) {\n
\t\t\t\t\treturn arguments[i];\n
\t\t\t\t}\n
\t\t\t}\n
\t\t\treturn undefined;\n
\t\t},\n
\n
\t\tdefaultMessage: function( element, method) {\n
\t\tdefaultMessage: function( element, method ) {\n
\t\t\treturn this.findDefined(\n
\t\t\t\tthis.customMessage( element.name, method ),\n
\t\t\t\tthis.customDataMessage( element, method ),\n
\t\t\t\tthis.customMetaMessage( element, method ),\n
\t\t\t\t// title is never undefined, so handle empty string as undefined\n
\t\t\t\t!this.settings.ignoreTitle && element.title || undefined,\n
\t\t\t\t$.validator.messages[method],\n
......@@ -640,7 +634,7 @@ $.extend($.validator, {\n
\t\t\tif ( typeof message === "function" ) {\n
\t\t\t\tmessage = message.call(this, rule.parameters, element);\n
\t\t\t} else if (theregex.test(message)) {\n
\t\t\t\tmessage = $.validator.format(message.replace(theregex, \'{$1}\'), rule.parameters);\n
\t\t\t\tmessage = $.validator.format(message.replace(theregex, "{$1}"), rule.parameters);\n
\t\t\t}\n
\t\t\tthis.errorList.push({\n
\t\t\t\tmessage: message,\n
......@@ -651,7 +645,7 @@ $.extend($.validator, {\n
\t\t\tthis.submitted[element.name] = message;\n
\t\t},\n
\n
\t\taddWrapper: function(toToggle) {\n
\t\taddWrapper: function( toToggle ) {\n
\t\t\tif ( this.settings.wrapper ) {\n
\t\t\t\ttoToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) );\n
\t\t\t}\n
......@@ -667,15 +661,15 @@ $.extend($.validator, {\n
\t\t\t\t}\n
\t\t\t\tthis.showLabel( error.element, error.message );\n
\t\t\t}\n
\t\t\tif( this.errorList.length ) {\n
\t\t\tif ( this.errorList.length ) {\n
\t\t\t\tthis.toShow = this.toShow.add( this.containers );\n
\t\t\t}\n
\t\t\tif (this.settings.success) {\n
\t\t\tif ( this.settings.success ) {\n
\t\t\t\tfor ( i = 0; this.successList[i]; i++ ) {\n
\t\t\t\t\tthis.showLabel( this.successList[i] );\n
\t\t\t\t}\n
\t\t\t}\n
\t\t\tif (this.settings.unhighlight) {\n
\t\t\tif ( this.settings.unhighlight ) {\n
\t\t\t\tfor ( i = 0, elements = this.validElements(); elements[i]; i++ ) {\n
\t\t\t\t\tthis.settings.unhighlight.call( this, elements[i], this.settings.errorClass, this.settings.validClass );\n
\t\t\t\t}\n
......@@ -695,20 +689,17 @@ $.extend($.validator, {\n
\t\t\t});\n
\t\t},\n
\n
\t\tshowLabel: function(element, message) {\n
\t\tshowLabel: function( element, message ) {\n
\t\t\tvar label = this.errorsFor( element );\n
\t\t\tif ( label.length ) {\n
\t\t\t\t// refresh error/success class\n
\t\t\t\tlabel.removeClass( this.settings.validClass ).addClass( this.settings.errorClass );\n
\n
\t\t\t\t// check if we have a generated label, replace the message then\n
\t\t\t\tif ( label.attr("generated") ) {\n
\t\t\t\t\tlabel.html(message);\n
\t\t\t\t}\n
\t\t\t\t// replace message on existing label\n
\t\t\t\tlabel.html(message);\n
\t\t\t} else {\n
\t\t\t\t// create label\n
\t\t\t\tlabel = $("<" + this.settings.errorElement + "/>")\n
\t\t\t\t\t.attr({"for": this.idOrName(element), generated: true})\n
\t\t\t\tlabel = $("<" + this.settings.errorElement + ">")\n
\t\t\t\t\t.attr("for", this.idOrName(element))\n
\t\t\t\t\t.addClass(this.settings.errorClass)\n
\t\t\t\t\t.html(message || "");\n
\t\t\t\tif ( this.settings.wrapper ) {\n
......@@ -720,7 +711,7 @@ $.extend($.validator, {\n
\t\t\t\t\tif ( this.settings.errorPlacement ) {\n
\t\t\t\t\t\tthis.settings.errorPlacement(label, $(element) );\n
\t\t\t\t\t} else {\n
\t\t\t\t\tlabel.insertAfter(element);\n
\t\t\t\t\t\tlabel.insertAfter(element);\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\t\t\t}\n
......@@ -735,20 +726,20 @@ $.extend($.validator, {\n
\t\t\tthis.toShow = this.toShow.add(label);\n
\t\t},\n
\n
\t\terrorsFor: function(element) {\n
\t\terrorsFor: function( element ) {\n
\t\t\tvar name = this.idOrName(element);\n
\t\t\treturn this.errors().filter(function() {\n
\t\t\t\treturn $(this).attr(\'for\') === name;\n
\t\t\t\treturn $(this).attr("for") === name;\n
\t\t\t});\n
\t\t},\n
\n
\t\tidOrName: function(element) {\n
\t\tidOrName: function( element ) {\n
\t\t\treturn this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name);\n
\t\t},\n
\n
\t\tvalidationTargetFor: function(element) {\n
\t\tvalidationTargetFor: function( element ) {\n
\t\t\t// if radio/checkbox, validate first element in group instead\n
\t\t\tif (this.checkable(element)) {\n
\t\t\tif ( this.checkable(element) ) {\n
\t\t\t\telement = this.findByName( element.name ).not(this.settings.ignore)[0];\n
\t\t\t}\n
\t\t\treturn element;\n
......@@ -759,53 +750,53 @@ $.extend($.validator, {\n
\t\t},\n
\n
\t\tfindByName: function( name ) {\n
\t\t\treturn $(this.currentForm).find(\'[name="\' + name + \'"]\');\n
\t\t\treturn $(this.currentForm).find("[name=\'" + name + "\']");\n
\t\t},\n
\n
\t\tgetLength: function(value, element) {\n
\t\tgetLength: function( value, element ) {\n
\t\t\tswitch( element.nodeName.toLowerCase() ) {\n
\t\t\tcase \'select\':\n
\t\t\tcase "select":\n
\t\t\t\treturn $("option:selected", element).length;\n
\t\t\tcase \'input\':\n
\t\t\t\tif( this.checkable( element) ) {\n
\t\t\t\t\treturn this.findByName(element.name).filter(\':checked\').length;\n
\t\t\tcase "input":\n
\t\t\t\tif ( this.checkable( element) ) {\n
\t\t\t\t\treturn this.findByName(element.name).filter(":checked").length;\n
\t\t\t\t}\n
\t\t\t}\n
\t\t\treturn value.length;\n
\t\t},\n
\n
\t\tdepend: function(param, element) {\n
\t\tdepend: function( param, element ) {\n
\t\t\treturn this.dependTypes[typeof param] ? this.dependTypes[typeof param](param, element) : true;\n
\t\t},\n
\n
\t\tdependTypes: {\n
\t\t\t"boolean": function(param, element) {\n
\t\t\t"boolean": function( param, element ) {\n
\t\t\t\treturn param;\n
\t\t\t},\n
\t\t\t"string": function(param, element) {\n
\t\t\t"string": function( param, element ) {\n
\t\t\t\treturn !!$(param, element.form).length;\n
\t\t\t},\n
\t\t\t"function": function(param, element) {\n
\t\t\t"function": function( param, element ) {\n
\t\t\t\treturn param(element);\n
\t\t\t}\n
\t\t},\n
\n
\t\toptional: function(element) {\n
\t\toptional: function( element ) {\n
\t\t\tvar val = this.elementValue(element);\n
\t\t\treturn !$.validator.methods.required.call(this, val, element) && "dependency-mismatch";\n
\t\t},\n
\n
\t\tstartRequest: function(element) {\n
\t\t\tif (!this.pending[element.name]) {\n
\t\tstartRequest: function( element ) {\n
\t\t\tif ( !this.pending[element.name] ) {\n
\t\t\t\tthis.pendingRequest++;\n
\t\t\t\tthis.pending[element.name] = true;\n
\t\t\t}\n
\t\t},\n
\n
\t\tstopRequest: function(element, valid) {\n
\t\tstopRequest: function( element, valid ) {\n
\t\t\tthis.pendingRequest--;\n
\t\t\t// sometimes synchronization fails, make sure pendingRequest is never < 0\n
\t\t\tif (this.pendingRequest < 0) {\n
\t\t\tif ( this.pendingRequest < 0 ) {\n
\t\t\t\tthis.pendingRequest = 0;\n
\t\t\t}\n
\t\t\tdelete this.pending[element.name];\n
......@@ -818,7 +809,7 @@ $.extend($.validator, {\n
\t\t\t}\n
\t\t},\n
\n
\t\tpreviousValue: function(element) {\n
\t\tpreviousValue: function( element ) {\n
\t\t\treturn $.data(element, "previousValue") || $.data(element, "previousValue", {\n
\t\t\t\told: null,\n
\t\t\t\tvalid: true,\n
......@@ -839,7 +830,7 @@ $.extend($.validator, {\n
\t\tcreditcard: {creditcard: true}\n
\t},\n
\n
\taddClassRules: function(className, rules) {\n
\taddClassRules: function( className, rules ) {\n
\t\tif ( className.constructor === String ) {\n
\t\t\tthis.classRuleSettings[className] = rules;\n
\t\t} else {\n
......@@ -847,12 +838,12 @@ $.extend($.validator, {\n
\t\t}\n
\t},\n
\n
\tclassRules: function(element) {\n
\tclassRules: function( element ) {\n
\t\tvar rules = {};\n
\t\tvar classes = $(element).attr(\'class\');\n
\t\tvar classes = $(element).attr("class");\n
\t\tif ( classes ) {\n
\t\t\t$.each(classes.split(\' \'), function() {\n
\t\t\t\tif (this in $.validator.classRuleSettings) {\n
\t\t\t$.each(classes.split(" "), function() {\n
\t\t\t\tif ( this in $.validator.classRuleSettings ) {\n
\t\t\t\t\t$.extend(rules, $.validator.classRuleSettings[this]);\n
\t\t\t\t}\n
\t\t\t});\n
......@@ -860,7 +851,7 @@ $.extend($.validator, {\n
\t\treturn rules;\n
\t},\n
\n
\tattributeRules: function(element) {\n
\tattributeRules: function( element ) {\n
\t\tvar rules = {};\n
\t\tvar $element = $(element);\n
\n
......@@ -868,11 +859,11 @@ $.extend($.validator, {\n
\t\t\tvar value;\n
\n
\t\t\t// support for <input required> in both html5 and older browsers\n
\t\t\tif (method === \'required\') {\n
\t\t\tif ( method === "required" ) {\n
\t\t\t\tvalue = $element.get(0).getAttribute(method);\n
\t\t\t\t// Some browsers return an empty string for the required attribute\n
\t\t\t\t// and non-HTML5 browsers might have required="" markup\n
\t\t\t\tif (value === "") {\n
\t\t\t\tif ( value === "" ) {\n
\t\t\t\t\tvalue = true;\n
\t\t\t\t}\n
\t\t\t\t// force non-HTML5 browsers to return bool\n
......@@ -881,60 +872,61 @@ $.extend($.validator, {\n
\t\t\t\tvalue = $element.attr(method);\n
\t\t\t}\n
\n
\t\t\tif (value) {\n
\t\t\tif ( value ) {\n
\t\t\t\trules[method] = value;\n
\t\t\t} else if ($element[0].getAttribute("type") === method) {\n
\t\t\t} else if ( $element[0].getAttribute("type") === method ) {\n
\t\t\t\trules[method] = true;\n
\t\t\t}\n
\t\t}\n
\n
\t\t// maxlength may be returned as -1, 2147483647 (IE) and 524288 (safari) for text inputs\n
\t\tif (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) {\n
\t\tif ( rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength) ) {\n
\t\t\tdelete rules.maxlength;\n
\t\t}\n
\n
\t\treturn rules;\n
\t},\n
\n
\tmetadataRules: function(element) {\n
\t\tif (!$.metadata) {\n
\t\t\treturn {};\n
\tdataRules: function( element ) {\n
\t\tvar method, value,\n
\t\t\trules = {}, $element = $(element);\n
\t\tfor (method in $.validator.methods) {\n
\t\t\tvalue = $element.data("rule-" + method.toLowerCase());\n
\t\t\tif ( value !== undefined ) {\n
\t\t\t\trules[method] = value;\n
\t\t\t}\n
\t\t}\n
\n
\t\tvar meta = $.data(element.form, \'validator\').settings.meta;\n
\t\treturn meta ?\n
\t\t\t$(element).metadata()[meta] :\n
\t\t\t$(element).metadata();\n
\t\treturn rules;\n
\t},\n
\n
\tstaticRules: function(element) {\n
\tstaticRules: function( element ) {\n
\t\tvar rules = {};\n
\t\tvar validator = $.data(element.form, \'validator\');\n
\t\tif (validator.settings.rules) {\n
\t\tvar validator = $.data(element.form, "validator");\n
\t\tif ( validator.settings.rules ) {\n
\t\t\trules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {};\n
\t\t}\n
\t\treturn rules;\n
\t},\n
\n
\tnormalizeRules: function(rules, element) {\n
\tnormalizeRules: function( rules, element ) {\n
\t\t// handle dependency check\n
\t\t$.each(rules, function(prop, val) {\n
\t\t$.each(rules, function( prop, val ) {\n
\t\t\t// ignore rule when param is explicitly false, eg. required:false\n
\t\t\tif (val === false) {\n
\t\t\tif ( val === false ) {\n
\t\t\t\tdelete rules[prop];\n
\t\t\t\treturn;\n
\t\t\t}\n
\t\t\tif (val.param || val.depends) {\n
\t\t\tif ( val.param || val.depends ) {\n
\t\t\t\tvar keepRule = true;\n
\t\t\t\tswitch (typeof val.depends) {\n
\t\t\t\t\tcase "string":\n
\t\t\t\t\t\tkeepRule = !!$(val.depends, element.form).length;\n
\t\t\t\t\t\tbreak;\n
\t\t\t\t\tcase "function":\n
\t\t\t\t\t\tkeepRule = val.depends.call(element, element);\n
\t\t\t\t\t\tbreak;\n
\t\t\t\tcase "string":\n
\t\t\t\t\tkeepRule = !!$(val.depends, element.form).length;\n
\t\t\t\t\tbreak;\n
\t\t\t\tcase "function":\n
\t\t\t\t\tkeepRule = val.depends.call(element, element);\n
\t\t\t\t\tbreak;\n
\t\t\t\t}\n
\t\t\t\tif (keepRule) {\n
\t\t\t\tif ( keepRule ) {\n
\t\t\t\t\trules[prop] = val.param !== undefined ? val.param : true;\n
\t\t\t\t} else {\n
\t\t\t\t\tdelete rules[prop];\n
......@@ -943,47 +935,48 @@ $.extend($.validator, {\n
\t\t});\n
\n
\t\t// evaluate parameters\n
\t\t$.each(rules, function(rule, parameter) {\n
\t\t$.each(rules, function( rule, parameter ) {\n
\t\t\trules[rule] = $.isFunction(parameter) ? parameter(element) : parameter;\n
\t\t});\n
\n
\t\t// clean number parameters\n
\t\t$.each([\'minlength\', \'maxlength\', \'min\', \'max\'], function() {\n
\t\t\tif (rules[this]) {\n
\t\t$.each([\'minlength\', \'maxlength\'], function() {\n
\t\t\tif ( rules[this] ) {\n
\t\t\t\trules[this] = Number(rules[this]);\n
\t\t\t}\n
\t\t});\n
\t\t$.each([\'rangelength\', \'range\'], function() {\n
\t\t\tif (rules[this]) {\n
\t\t\t\trules[this] = [Number(rules[this][0]), Number(rules[this][1])];\n
\t\t$.each([\'rangelength\'], function() {\n
\t\t\tvar parts;\n
\t\t\tif ( rules[this] ) {\n
\t\t\t\tif ( $.isArray(rules[this]) ) {\n
\t\t\t\t\trules[this] = [Number(rules[this][0]), Number(rules[this][1])];\n
\t\t\t\t} else if ( typeof rules[this] === "string" ) {\n
\t\t\t\t\tparts = rules[this].split(/[\\s,]+/);\n
\t\t\t\t\trules[this] = [Number(parts[0]), Number(parts[1])];\n
\t\t\t\t}\n
\t\t\t}\n
\t\t});\n
\n
\t\tif ($.validator.autoCreateRanges) {\n
\t\tif ( $.validator.autoCreateRanges ) {\n
\t\t\t// auto-create ranges\n
\t\t\tif (rules.min && rules.max) {\n
\t\t\tif ( rules.min && rules.max ) {\n
\t\t\t\trules.range = [rules.min, rules.max];\n
\t\t\t\tdelete rules.min;\n
\t\t\t\tdelete rules.max;\n
\t\t\t}\n
\t\t\tif (rules.minlength && rules.maxlength) {\n
\t\t\tif ( rules.minlength && rules.maxlength ) {\n
\t\t\t\trules.rangelength = [rules.minlength, rules.maxlength];\n
\t\t\t\tdelete rules.minlength;\n
\t\t\t\tdelete rules.maxlength;\n
\t\t\t}\n
\t\t}\n
\n
\t\t// To support custom messages in metadata ignore rule methods titled "messages"\n
\t\tif (rules.messages) {\n
\t\t\tdelete rules.messages;\n
\t\t}\n
\n
\t\treturn rules;\n
\t},\n
\n
\t// Converts a simple string to a {string: true} rule, e.g., "required" to {required:true}\n
\tnormalizeRule: function(data) {\n
\t\tif( typeof data === "string" ) {\n
\tnormalizeRule: function( data ) {\n
\t\tif ( typeof data === "string" ) {\n
\t\t\tvar transformed = {};\n
\t\t\t$.each(data.split(/\\s/), function() {\n
\t\t\t\ttransformed[this] = true;\n
......@@ -994,10 +987,10 @@ $.extend($.validator, {\n
\t},\n
\n
\t// http://docs.jquery.com/Plugins/Validation/Validator/addMethod\n
\taddMethod: function(name, method, message) {\n
\taddMethod: function( name, method, message ) {\n
\t\t$.validator.methods[name] = method;\n
\t\t$.validator.messages[name] = message !== undefined ? message : $.validator.messages[name];\n
\t\tif (method.length < 3) {\n
\t\tif ( method.length < 3 ) {\n
\t\t\t$.validator.addClassRules(name, $.validator.normalizeRule(name));\n
\t\t}\n
\t},\n
......@@ -1005,7 +998,7 @@ $.extend($.validator, {\n
\tmethods: {\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Methods/required\n
\t\trequired: function(value, element, param) {\n
\t\trequired: function( value, element, param ) {\n
\t\t\t// check if dependency is met\n
\t\t\tif ( !this.depend(param, element) ) {\n
\t\t\t\treturn "dependency-mismatch";\n
......@@ -1022,7 +1015,7 @@ $.extend($.validator, {\n
\t\t},\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Methods/remote\n
\t\tremote: function(value, element, param) {\n
\t\tremote: function( value, element, param ) {\n
\t\t\tif ( this.optional(element) ) {\n
\t\t\t\treturn "dependency-mismatch";\n
\t\t\t}\n
......@@ -1036,9 +1029,6 @@ $.extend($.validator, {\n
\n
\t\t\tparam = typeof param === "string" && {url:param} || param;\n
\n
\t\t\tif ( this.pending[element.name] ) {\n
\t\t\t\treturn "pending";\n
\t\t\t}\n
\t\t\tif ( previous.old === value ) {\n
\t\t\t\treturn previous.valid;\n
\t\t\t}\n
......@@ -1054,7 +1044,7 @@ $.extend($.validator, {\n
\t\t\t\tport: "validate" + element.name,\n
\t\t\t\tdataType: "json",\n
\t\t\t\tdata: data,\n
\t\t\t\tsuccess: function(response) {\n
\t\t\t\tsuccess: function( response ) {\n
\t\t\t\t\tvalidator.settings.messages[element.name].remote = previous.originalMessage;\n
\t\t\t\t\tvar valid = response === true || response === "true";\n
\t\t\t\t\tif ( valid ) {\n
......@@ -1079,19 +1069,19 @@ $.extend($.validator, {\n
\t\t},\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Methods/minlength\n
\t\tminlength: function(value, element, param) {\n
\t\tminlength: function( value, element, param ) {\n
\t\t\tvar length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);\n
\t\t\treturn this.optional(element) || length >= param;\n
\t\t},\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Methods/maxlength\n
\t\tmaxlength: function(value, element, param) {\n
\t\tmaxlength: function( value, element, param ) {\n
\t\t\tvar length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);\n
\t\t\treturn this.optional(element) || length <= param;\n
\t\t},\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Methods/rangelength\n
\t\trangelength: function(value, element, param) {\n
\t\trangelength: function( value, element, param ) {\n
\t\t\tvar length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);\n
\t\t\treturn this.optional(element) || ( length >= param[0] && length <= param[1] );\n
\t\t},\n
......@@ -1112,45 +1102,45 @@ $.extend($.validator, {\n
\t\t},\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Methods/email\n
\t\temail: function(value, element) {\n
\t\temail: function( value, element ) {\n
\t\t\t// contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/\n
\t\t\treturn this.optional(element) || /^((([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i.test(value);\n
\t\t},\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Methods/url\n
\t\turl: function(value, element) {\n
\t\turl: function( value, element ) {\n
\t\t\t// contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/\n
\t\t\treturn this.optional(element) || /^(https?|ftp):\\/\\/(((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?)(:\\d*)?)(\\/((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)+(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)*)*)?)?(\\?((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|[\\uE000-\\uF8FF]|\\/|\\?)*)?(\\#((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i.test(value);\n
\t\t\treturn this.optional(element) || /^(https?|s?ftp):\\/\\/(((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?)(:\\d*)?)(\\/((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)+(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)*)*)?)?(\\?((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|[\\uE000-\\uF8FF]|\\/|\\?)*)?(#((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i.test(value);\n
\t\t},\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Methods/date\n
\t\tdate: function(value, element) {\n
\t\t\treturn this.optional(element) || !/Invalid|NaN/.test(new Date(value));\n
\t\tdate: function( value, element ) {\n
\t\t\treturn this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString());\n
\t\t},\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Methods/dateISO\n
\t\tdateISO: function(value, element) {\n
\t\tdateISO: function( value, element ) {\n
\t\t\treturn this.optional(element) || /^\\d{4}[\\/\\-]\\d{1,2}[\\/\\-]\\d{1,2}$/.test(value);\n
\t\t},\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Methods/number\n
\t\tnumber: function(value, element) {\n
\t\tnumber: function( value, element ) {\n
\t\t\treturn this.optional(element) || /^-?(?:\\d+|\\d{1,3}(?:,\\d{3})+)?(?:\\.\\d+)?$/.test(value);\n
\t\t},\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Methods/digits\n
\t\tdigits: function(value, element) {\n
\t\tdigits: function( value, element ) {\n
\t\t\treturn this.optional(element) || /^\\d+$/.test(value);\n
\t\t},\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Methods/creditcard\n
\t\t// based on http://en.wikipedia.org/wiki/Luhn\n
\t\tcreditcard: function(value, element) {\n
\t\tcreditcard: function( value, element ) {\n
\t\t\tif ( this.optional(element) ) {\n
\t\t\t\treturn "dependency-mismatch";\n
\t\t\t}\n
\t\t\t// accept only spaces, digits and dashes\n
\t\t\tif (/[^0-9 \\-]+/.test(value)) {\n
\t\t\tif ( /[^0-9 \\-]+/.test(value) ) {\n
\t\t\t\treturn false;\n
\t\t\t}\n
\t\t\tvar nCheck = 0,\n
......@@ -1162,8 +1152,8 @@ $.extend($.validator, {\n
\t\t\tfor (var n = value.length - 1; n >= 0; n--) {\n
\t\t\t\tvar cDigit = value.charAt(n);\n
\t\t\t\tnDigit = parseInt(cDigit, 10);\n
\t\t\t\tif (bEven) {\n
\t\t\t\t\tif ((nDigit *= 2) > 9) {\n
\t\t\t\tif ( bEven ) {\n
\t\t\t\t\tif ( (nDigit *= 2) > 9 ) {\n
\t\t\t\t\t\tnDigit -= 9;\n
\t\t\t\t\t}\n
\t\t\t\t}\n
......@@ -1175,11 +1165,11 @@ $.extend($.validator, {\n
\t\t},\n
\n
\t\t// http://docs.jquery.com/Plugins/Validation/Methods/equalTo\n
\t\tequalTo: function(value, element, param) {\n
\t\tequalTo: function( value, element, param ) {\n
\t\t\t// bind to the blur event of the target in order to revalidate whenever the target field is updated\n
\t\t\t// TODO find a way to bind the event just once, avoiding the unbind-rebind overhead\n
\t\t\tvar target = $(param);\n
\t\t\tif (this.settings.onfocusout) {\n
\t\t\tif ( this.settings.onfocusout ) {\n
\t\t\t\ttarget.unbind(".validate-equalTo").bind("blur.validate-equalTo", function() {\n
\t\t\t\t\t$(element).valid();\n
\t\t\t\t});\n
......@@ -1203,9 +1193,9 @@ $.format = $.validator.format;\n
\tvar pendingRequests = {};\n
\t// Use a prefilter if available (1.5+)\n
\tif ( $.ajaxPrefilter ) {\n
\t\t$.ajaxPrefilter(function(settings, _, xhr) {\n
\t\t$.ajaxPrefilter(function( settings, _, xhr ) {\n
\t\t\tvar port = settings.port;\n
\t\t\tif (settings.mode === "abort") {\n
\t\t\tif ( settings.mode === "abort" ) {\n
\t\t\t\tif ( pendingRequests[port] ) {\n
\t\t\t\t\tpendingRequests[port].abort();\n
\t\t\t\t}\n
......@@ -1215,10 +1205,10 @@ $.format = $.validator.format;\n
\t} else {\n
\t\t// Proxy ajax\n
\t\tvar ajax = $.ajax;\n
\t\t$.ajax = function(settings) {\n
\t\t$.ajax = function( settings ) {\n
\t\t\tvar mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode,\n
\t\t\t\tport = ( "port" in settings ? settings : $.ajaxSettings ).port;\n
\t\t\tif (mode === "abort") {\n
\t\t\tif ( mode === "abort" ) {\n
\t\t\t\tif ( pendingRequests[port] ) {\n
\t\t\t\t\tpendingRequests[port].abort();\n
\t\t\t\t}\n
......@@ -1229,45 +1219,14 @@ $.format = $.validator.format;\n
\t}\n
}(jQuery));\n
\n
// provides cross-browser focusin and focusout events\n
// IE has native support, in other browsers, use event caputuring (neither bubbles)\n
\n
// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation\n
// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target\n
(function($) {\n
\t// only implement if not provided by jQuery core (since 1.4)\n
\t// TODO verify if jQuery 1.4\'s implementation is compatible with older jQuery special-event APIs\n
\tif (!jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener) {\n
\t\t$.each({\n
\t\t\tfocus: \'focusin\',\n
\t\t\tblur: \'focusout\'\n
\t\t}, function( original, fix ){\n
\t\t\t$.event.special[fix] = {\n
\t\t\t\tsetup:function() {\n
\t\t\t\t\tthis.addEventListener( original, handler, true );\n
\t\t\t\t},\n
\t\t\t\tteardown:function() {\n
\t\t\t\t\tthis.removeEventListener( original, handler, true );\n
\t\t\t\t},\n
\t\t\t\thandler: function(e) {\n
\t\t\t\t\tvar args = arguments;\n
\t\t\t\t\targs[0] = $.event.fix(e);\n
\t\t\t\t\targs[0].type = fix;\n
\t\t\t\t\treturn $.event.handle.apply(this, args);\n
\t\t\t\t}\n
\t\t\t};\n
\t\t\tfunction handler(e) {\n
\t\t\t\te = $.event.fix(e);\n
\t\t\t\te.type = fix;\n
\t\t\t\treturn $.event.handle.call(this, e);\n
\t\t\t}\n
\t\t});\n
\t}\n
\t$.extend($.fn, {\n
\t\tvalidateDelegate: function(delegate, type, handler) {\n
\t\t\treturn this.bind(type, function(event) {\n
\t\tvalidateDelegate: function( delegate, type, handler ) {\n
\t\t\treturn this.bind(type, function( event ) {\n
\t\t\t\tvar target = $(event.target);\n
\t\t\t\tif (target.is(delegate)) {\n
\t\t\t\tif ( target.is(delegate) ) {\n
\t\t\t\t\treturn handler.apply(target, arguments);\n
\t\t\t\t}\n
\t\t\t});\n
......@@ -1284,7 +1243,7 @@ $.format = $.validator.format;\n
</item>
<item>
<key> <string>size</string> </key>
<value> <int>39131</int> </value>
<value> <int>38015</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -12,7 +12,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts52798201.63</string> </value>
<value> <string>ts63959085.35</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -26,10 +26,10 @@
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*! jQuery Validation Plugin - v1.10.0 - 9/7/2012\n
/*! jQuery Validation Plugin - v1.11.0 - 2/4/2013\n
* https://github.com/jzaefferer/jquery-validation\n
* Copyright (c) 2012 Jörn Zaefferer; Licensed MIT, GPL */\n
(function(a){a.extend(a.fn,{validate:function(b){if(!this.length){b&&b.debug&&window.console&&console.warn("nothing selected, can\'t validate, returning nothing");return}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.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type=\'hidden\'/>").attr("name",c.submitButton.name).val(c.submitButton.value).appendTo(c.currentForm)),c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),!1):!0}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(){if(a(this[0]).is("form"))return this.validate().form();var b=!0,c=a(this[0].form).validate();return this.each(function(){b&=c.element(this)}),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d=this[0];if(b){var e=a.data(d.form,"validator").settings,f=e.rules,g=a.validator.staticRules(d);switch(b){case"add":a.extend(g,a.validator.normalizeRule(c)),f[d.name]=g,c.messages&&(e.messages[d.name]=a.extend(e.messages[d.name],c.messages));break;case"remove":if(!c)return delete f[d.name],g;var h={};return a.each(c.split(/\\s/),function(a,b){h[b]=g[b],delete g[b]}),h}}var i=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(d),a.validator.classRules(d),a.validator.attributeRules(d),a.validator.staticRules(d)),d);if(i.required){var j=i.required;delete i.required,i=a.extend({required:j},i)}return i}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+b.value)},filled:function(b){return!!a.trim(""+b.value)},unchecked:function(a){return!a.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 arguments.length===1?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(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"),c)}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a,b){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(a)).hide())},onfocusout:function(a,b){!this.checkable(a)&&(a.name in this.submitted||!this.optional(a))&&this.element(a)},onkeyup:function(a,b){if(b.which===9&&this.elementValue(a)==="")return;(a.name in this.submitted||a===this.lastActive)&&this.element(a)},onclick:function(a,b){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){b.type==="radio"?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){b.type==="radio"?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.",creditcard:"Please enter a valid credit card number.",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}.")},autoCreateRanges:!1,prototype:{init:function(){function d(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,"");c.settings[d]&&c.settings[d].call(c,this[0],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 b=this.groups={};a.each(this.settings.groups,function(c,d){a.each(d.split(/\\s/),function(a,d){b[d]=c})});var c=this.settings.rules;a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).validateDelegate(":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\'] ","focusin focusout keyup",d).validateDelegate("[type=\'radio\'], [type=\'checkbox\'], select, option","click",d),this.settings.invalidHandler&&a(this.currentForm).bind("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){b=this.validationTargetFor(this.clean(b)),this.lastElement=b,this.prepareElement(b),this.currentElements=a(b);var c=this.check(b)!==!1;return c?delete this.invalid[b.name]:this.invalid[b.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),c},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[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.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b=0;for(var c in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()===0},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&&a.grep(this.errorList,function(a){return a.element.name===b.name}).length===1&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.replace(" ",".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),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=a(b).attr("type"),d=a(b).val();return c==="radio"||c==="checkbox"?a(\'input[name="\'+a(b).attr("name")+\'"]:checked\').val():typeof d=="string"?d.replace(/\\r/g,""):d},check:function(b){b=this.validationTargetFor(this.clean(b));var c=a(b).rules(),d=!1,e=this.elementValue(b),f;for(var g in c){var h={method:g,parameters:c[g]};try{f=a.validator.methods[g].call(this,e,b,h.parameters);if(f==="dependency-mismatch"){d=!0;continue}d=!1;if(f==="pending"){this.toHide=this.toHide.not(this.errorsFor(b));return}if(!f)return this.formatAndAdd(b,h),!1}catch(i){throw this.settings.debug&&window.console&&console.log("exception occured when checking element "+b.id+", check the \'"+h.method+"\' method",i),i}}if(d)return;return this.objectLength(c)&&this.successList.push(b),!0},customMetaMessage:function(b,c){if(!a.metadata)return;var d=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return d&&d.messages&&d.messages[c]},customDataMessage:function(b,c){return a(b).data("msg-"+c.toLowerCase())||b.attributes&&a(b).attr("data-msg-"+c.toLowerCase())},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(arguments[a]!==undefined)return arguments[a];return undefined},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),this.customMetaMessage(b,c),!this.settings.ignoreTitle&&b.title||undefined,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\\$?\\{(\\d+)\\}/g;typeof d=="function"?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b;for(a=0;this.errorList[a];a++){var 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)}this.errorList.length&&(this.toShow=this.toShow.add(this.containers));if(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=this.errorsFor(b);d.length?(d.removeClass(this.settings.validClass).addClass(this.settings.errorClass),d.attr("generated")&&d.html(c)):(d=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(b),generated:!0}).addClass(this.settings.errorClass).html(c||""),this.settings.wrapper&&(d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b))),!c&&this.settings.success&&(d.text(""),typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d,b)),this.toShow=this.toShow.add(d)},errorsFor:function(b){var c=this.idOrName(b);return this.errors().filter(function(){return a(this).attr("for")===c})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){return this.checkable(a)&&(a=this.findByName(a.name).not(this.settings.ignore)[0]),a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find(\'[name="\'+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):!0},dependTypes:{"boolean":function(a,b){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(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&this.pendingRequest===0&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&this.pendingRequest===0&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},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},attributeRules:function(b){var c={},d=a(b);for(var e in a.validator.methods){var f;e==="required"?(f=d.get(0).getAttribute(e),f===""&&(f=!0),f=!!f):f=d.attr(e),f?c[e]=f:d[0].getAttribute("type")===e&&(c[e]=!0)}return c.maxlength&&/-1|2147483647|524288/.test(c.maxlength)&&delete c.maxlength,c},metadataRules:function(b){if(!a.metadata)return{};var c=a.data(b.form,"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata()},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){delete b[d];return}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]=e.param!==undefined?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength","min","max"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){b[this]&&(b[this]=[Number(b[this][0]),Number(b[this][1])])}),a.validator.autoCreateRanges&&(b.min&&b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),b.minlength&&b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b.messages&&delete b.messages,b},normalizeRule:function(b){if(typeof b=="string"){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]=d!==undefined?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(c.nodeName.toLowerCase()==="select"){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e=this.previousValue(c);this.settings.messages[c.name]||(this.settings.messages[c.name]={}),e.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=e.message,d=typeof d=="string"&&{url:d}||d;if(this.pending[c.name])return"pending";if(e.old===b)return e.valid;e.old=b;var f=this;this.startRequest(c);var g={};return g[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:g,success:function(d){f.settings.messages[c.name].remote=e.originalMessage;var g=d===!0||d==="true";if(g){var h=f.formSubmitted;f.prepareElement(c),f.formSubmitted=h,f.successList.push(c),delete f.invalid[c.name],f.showErrors()}else{var i={},j=d||f.defaultMessage(c,"remote");i[c.name]=e.message=a.isFunction(j)?j(b):j,f.invalid[c.name]=!0,f.showErrors(i)}e.valid=g,f.stopRequest(c,g)}},d)),"pending"},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e<=d},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(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]},email:function(a,b){return this.optional(b)||/^((([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i.test(a)},url:function(a,b){return this.optional(b)||/^(https?|ftp):\\/\\/(((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?)(:\\d*)?)(\\/((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)+(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)*)*)?)?(\\?((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|[\\uE000-\\uF8FF]|\\/|\\?)*)?(\\#((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\\d{4}[\\/\\-]\\d{1,2}[\\/\\-]\\d{1,2}$/.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)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \\-]+/.test(a))return!1;var c=0,d=0,e=!1;a=a.replace(/\\D/g,"");for(var f=a.length-1;f>=0;f--){var g=a.charAt(f);d=parseInt(g,10),e&&(d*=2)>9&&(d-=9),c+=d,e=!e}return c%10===0},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()}}}),a.format=a.validator.format})(jQuery),function(a){var b={};if(a.ajaxPrefilter)a.ajaxPrefilter(function(a,c,d){var e=a.port;a.mode==="abort"&&(b[e]&&b[e].abort(),b[e]=d)});else{var c=a.ajax;a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return e==="abort"?(b[f]&&b[f].abort(),b[f]=c.apply(this,arguments)):c.apply(this,arguments)}}}(jQuery),function(a){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&a.each({focus:"focusin",blur:"focusout"},function(b,c){function d(b){return b=a.event.fix(b),b.type=c,a.event.handle.call(this,b)}a.event.special[c]={setup:function(){this.addEventListener(b,d,!0)},teardown:function(){this.removeEventListener(b,d,!0)},handler:function(b){var d=arguments;return d[0]=a.event.fix(b),d[0].type=c,a.event.handle.apply(this,d)}}}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);if(e.is(b))return d.apply(e,arguments)})}})}(jQuery)
* Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */\n
(function(e){e.extend(e.fn,{validate:function(t){if(!this.length){t&&t.debug&&window.console&&console.warn("Nothing selected, can\'t validate, returning nothing.");return}var n=e.data(this[0],"validator");return n?n:(this.attr("novalidate","novalidate"),n=new e.validator(t,this[0]),e.data(this[0],"validator",n),n.settings.onsubmit&&(this.validateDelegate(":submit","click",function(t){n.settings.submitHandler&&(n.submitButton=t.target),e(t.target).hasClass("cancel")&&(n.cancelSubmit=!0)}),this.submit(function(t){function r(){var r;return n.settings.submitHandler?(n.submitButton&&(r=e("<input type=\'hidden\'/>").attr("name",n.submitButton.name).val(n.submitButton.value).appendTo(n.currentForm)),n.settings.submitHandler.call(n,n.currentForm,t),n.submitButton&&r.remove(),!1):!0}return n.settings.debug&&t.preventDefault(),n.cancelSubmit?(n.cancelSubmit=!1,r()):n.form()?n.pendingRequest?(n.formSubmitted=!0,!1):r():(n.focusInvalid(),!1)})),n)},valid:function(){if(e(this[0]).is("form"))return this.validate().form();var t=!0,n=e(this[0].form).validate();return this.each(function(){t&=n.element(this)}),t},removeAttrs:function(t){var n={},r=this;return e.each(t.split(/\\s/),function(e,t){n[t]=r.attr(t),r.removeAttr(t)}),n},rules:function(t,n){var r=this[0];if(t){var i=e.data(r.form,"validator").settings,s=i.rules,o=e.validator.staticRules(r);switch(t){case"add":e.extend(o,e.validator.normalizeRule(n)),s[r.name]=o,n.messages&&(i.messages[r.name]=e.extend(i.messages[r.name],n.messages));break;case"remove":if(!n)return delete s[r.name],o;var u={};return e.each(n.split(/\\s/),function(e,t){u[t]=o[t],delete o[t]}),u}}var a=e.validator.normalizeRules(e.extend({},e.validator.classRules(r),e.validator.attributeRules(r),e.validator.dataRules(r),e.validator.staticRules(r)),r);if(a.required){var f=a.required;delete a.required,a=e.extend({required:f},a)}return a}}),e.extend(e.expr[":"],{blank:function(t){return!e.trim(""+t.value)},filled:function(t){return!!e.trim(""+t.value)},unchecked:function(e){return!e.checked}}),e.validator=function(t,n){this.settings=e.extend(!0,{},e.validator.defaults,t),this.currentForm=n,this.init()},e.validator.format=function(t,n){return arguments.length===1?function(){var n=e.makeArray(arguments);return n.unshift(t),e.validator.format.apply(this,n)}:(arguments.length>2&&n.constructor!==Array&&(n=e.makeArray(arguments).slice(1)),n.constructor!==Array&&(n=[n]),e.each(n,function(e,n){t=t.replace(new RegExp("\\\\{"+e+"\\\\}","g"),function(){return n})}),t)},e.extend(e.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:e([]),errorLabelContainer:e([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(e,t){this.lastActive=e,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,e,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(e)).hide())},onfocusout:function(e,t){!this.checkable(e)&&(e.name in this.submitted||!this.optional(e))&&this.element(e)},onkeyup:function(e,t){if(t.which===9&&this.elementValue(e)==="")return;(e.name in this.submitted||e===this.lastElement)&&this.element(e)},onclick:function(e,t){e.name in this.submitted?this.element(e):e.parentNode.name in this.submitted&&this.element(e.parentNode)},highlight:function(t,n,r){t.type==="radio"?this.findByName(t.name).addClass(n).removeClass(r):e(t).addClass(n).removeClass(r)},unhighlight:function(t,n,r){t.type==="radio"?this.findByName(t.name).removeClass(n).addClass(r):e(t).removeClass(n).addClass(r)}},setDefaults:function(t){e.extend(e.validator.defaults,t)},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.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:e.validator.format("Please enter no more than {0} characters."),minlength:e.validator.format("Please enter at least {0} characters."),rangelength:e.validator.format("Please enter a value between {0} and {1} characters long."),range:e.validator.format("Please enter a value between {0} and {1}."),max:e.validator.format("Please enter a value less than or equal to {0}."),min:e.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function r(t){var n=e.data(this[0].form,"validator"),r="on"+t.type.replace(/^validate/,"");n.settings[r]&&n.settings[r].call(n,this[0],t)}this.labelContainer=e(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||e(this.currentForm),this.containers=e(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var t=this.groups={};e.each(this.settings.groups,function(n,r){typeof r=="string"&&(r=r.split(/\\s/)),e.each(r,function(e,r){t[r]=n})});var n=this.settings.rules;e.each(n,function(t,r){n[t]=e.validator.normalizeRule(r)}),e(this.currentForm).validateDelegate(":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\'] ","focusin focusout keyup",r).validateDelegate("[type=\'radio\'], [type=\'checkbox\'], select, option","click",r),this.settings.invalidHandler&&e(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),e.extend(this.submitted,this.errorMap),this.invalid=e.extend({},this.errorMap),this.valid()||e(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var e=0,t=this.currentElements=this.elements();t[e];e++)this.check(t[e]);return this.valid()},element:function(t){t=this.validationTargetFor(this.clean(t)),this.lastElement=t,this.prepareElement(t),this.currentElements=e(t);var n=this.check(t)!==!1;return n?delete this.invalid[t.name]:this.invalid[t.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),n},showErrors:function(t){if(t){e.extend(this.errorMap,t),this.errorList=[];for(var n in t)this.errorList.push({message:t[n],element:this.findByName(n)[0]});this.successList=e.grep(this.successList,function(e){return!(e.name in t)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){e.fn.resetForm&&e(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(e){var t=0;for(var n in e)t++;return t},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()===0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{e(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}},findLastActive:function(){var t=this.lastActive;return t&&e.grep(this.errorList,function(e){return e.element.name===t.name}).length===1&&t},elements:function(){var t=this,n={};return e(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&t.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in n||!t.objectLength(e(this).rules())?!1:(n[this.name]=!0,!0)})},clean:function(t){return e(t)[0]},errors:function(){var t=this.settings.errorClass.replace(" ",".");return e(this.settings.errorElement+"."+t,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=e([]),this.toHide=e([]),this.currentElements=e([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(e){this.reset(),this.toHide=this.errorsFor(e)},elementValue:function(t){var n=e(t).attr("type"),r=e(t).val();return n==="radio"||n==="checkbox"?e("input[name=\'"+e(t).attr("name")+"\']:checked").val():typeof r=="string"?r.replace(/\\r/g,""):r},check:function(t){t=this.validationTargetFor(this.clean(t));var n=e(t).rules(),r=!1,i=this.elementValue(t),s;for(var o in n){var u={method:o,parameters:n[o]};try{s=e.validator.methods[o].call(this,i,t,u.parameters);if(s==="dependency-mismatch"){r=!0;continue}r=!1;if(s==="pending"){this.toHide=this.toHide.not(this.errorsFor(t));return}if(!s)return this.formatAndAdd(t,u),!1}catch(a){throw this.settings.debug&&window.console&&console.log("Exception occured when checking element "+t.id+", check the \'"+u.method+"\' method.",a),a}}if(r)return;return this.objectLength(n)&&this.successList.push(t),!0},customDataMessage:function(t,n){return e(t).data("msg-"+n.toLowerCase())||t.attributes&&e(t).attr("data-msg-"+n.toLowerCase())},customMessage:function(e,t){var n=this.settings.messages[e];return n&&(n.constructor===String?n:n[t])},findDefined:function(){for(var e=0;e<arguments.length;e++)if(arguments[e]!==undefined)return arguments[e];return undefined},defaultMessage:function(t,n){return this.findDefined(this.customMessage(t.name,n),this.customDataMessage(t,n),!this.settings.ignoreTitle&&t.title||undefined,e.validator.messages[n],"<strong>Warning: No message defined for "+t.name+"</strong>")},formatAndAdd:function(t,n){var r=this.defaultMessage(t,n.method),i=/\\$?\\{(\\d+)\\}/g;typeof r=="function"?r=r.call(this,n.parameters,t):i.test(r)&&(r=e.validator.format(r.replace(i,"{$1}"),n.parameters)),this.errorList.push({message:r,element:t}),this.errorMap[t.name]=r,this.submitted[t.name]=r},addWrapper:function(e){return this.settings.wrapper&&(e=e.add(e.parent(this.settings.wrapper))),e},defaultShowErrors:function(){var e,t;for(e=0;this.errorList[e];e++){var n=this.errorList[e];this.settings.highlight&&this.settings.highlight.call(this,n.element,this.settings.errorClass,this.settings.validClass),this.showLabel(n.element,n.message)}this.errorList.length&&(this.toShow=this.toShow.add(this.containers));if(this.settings.success)for(e=0;this.successList[e];e++)this.showLabel(this.successList[e]);if(this.settings.unhighlight)for(e=0,t=this.validElements();t[e];e++)this.settings.unhighlight.call(this,t[e],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 e(this.errorList).map(function(){return this.element})},showLabel:function(t,n){var r=this.errorsFor(t);r.length?(r.removeClass(this.settings.validClass).addClass(this.settings.errorClass),r.html(n)):(r=e("<"+this.settings.errorElement+">").attr("for",this.idOrName(t)).addClass(this.settings.errorClass).html(n||""),this.settings.wrapper&&(r=r.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(r).length||(this.settings.errorPlacement?this.settings.errorPlacement(r,e(t)):r.insertAfter(t))),!n&&this.settings.success&&(r.text(""),typeof this.settings.success=="string"?r.addClass(this.settings.success):this.settings.success(r,t)),this.toShow=this.toShow.add(r)},errorsFor:function(t){var n=this.idOrName(t);return this.errors().filter(function(){return e(this).attr("for")===n})},idOrName:function(e){return this.groups[e.name]||(this.checkable(e)?e.name:e.id||e.name)},validationTargetFor:function(e){return this.checkable(e)&&(e=this.findByName(e.name).not(this.settings.ignore)[0]),e},checkable:function(e){return/radio|checkbox/i.test(e.type)},findByName:function(t){return e(this.currentForm).find("[name=\'"+t+"\']")},getLength:function(t,n){switch(n.nodeName.toLowerCase()){case"select":return e("option:selected",n).length;case"input":if(this.checkable(n))return this.findByName(n.name).filter(":checked").length}return t.length},depend:function(e,t){return this.dependTypes[typeof e]?this.dependTypes[typeof e](e,t):!0},dependTypes:{"boolean":function(e,t){return e},string:function(t,n){return!!e(t,n.form).length},"function":function(e,t){return e(t)}},optional:function(t){var n=this.elementValue(t);return!e.validator.methods.required.call(this,n,t)&&"dependency-mismatch"},startRequest:function(e){this.pending[e.name]||(this.pendingRequest++,this.pending[e.name]=!0)},stopRequest:function(t,n){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[t.name],n&&this.pendingRequest===0&&this.formSubmitted&&this.form()?(e(this.currentForm).submit(),this.formSubmitted=!1):!n&&this.pendingRequest===0&&this.formSubmitted&&(e(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t){return e.data(t,"previousValue")||e.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,"remote")})}},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(t,n){t.constructor===String?this.classRuleSettings[t]=n:e.extend(this.classRuleSettings,t)},classRules:function(t){var n={},r=e(t).attr("class");return r&&e.each(r.split(" "),function(){this in e.validator.classRuleSettings&&e.extend(n,e.validator.classRuleSettings[this])}),n},attributeRules:function(t){var n={},r=e(t);for(var i in e.validator.methods){var s;i==="required"?(s=r.get(0).getAttribute(i),s===""&&(s=!0),s=!!s):s=r.attr(i),s?n[i]=s:r[0].getAttribute("type")===i&&(n[i]=!0)}return n.maxlength&&/-1|2147483647|524288/.test(n.maxlength)&&delete n.maxlength,n},dataRules:function(t){var n,r,i={},s=e(t);for(n in e.validator.methods)r=s.data("rule-"+n.toLowerCase()),r!==undefined&&(i[n]=r);return i},staticRules:function(t){var n={},r=e.data(t.form,"validator");return r.settings.rules&&(n=e.validator.normalizeRule(r.settings.rules[t.name])||{}),n},normalizeRules:function(t,n){return e.each(t,function(r,i){if(i===!1){delete t[r];return}if(i.param||i.depends){var s=!0;switch(typeof i.depends){case"string":s=!!e(i.depends,n.form).length;break;case"function":s=i.depends.call(n,n)}s?t[r]=i.param!==undefined?i.param:!0:delete t[r]}}),e.each(t,function(r,i){t[r]=e.isFunction(i)?i(n):i}),e.each(["minlength","maxlength"],function(){t[this]&&(t[this]=Number(t[this]))}),e.each(["rangelength"],function(){var n;t[this]&&(e.isArray(t[this])?t[this]=[Number(t[this][0]),Number(t[this][1])]:typeof t[this]=="string"&&(n=t[this].split(/[\\s,]+/),t[this]=[Number(n[0]),Number(n[1])]))}),e.validator.autoCreateRanges&&(t.min&&t.max&&(t.range=[t.min,t.max],delete t.min,delete t.max),t.minlength&&t.maxlength&&(t.rangelength=[t.minlength,t.maxlength],delete t.minlength,delete t.maxlength)),t},normalizeRule:function(t){if(typeof t=="string"){var n={};e.each(t.split(/\\s/),function(){n[this]=!0}),t=n}return t},addMethod:function(t,n,r){e.validator.methods[t]=n,e.validator.messages[t]=r!==undefined?r:e.validator.messages[t],n.length<3&&e.validator.addClassRules(t,e.validator.normalizeRule(t))},methods:{required:function(t,n,r){if(!this.depend(r,n))return"dependency-mismatch";if(n.nodeName.toLowerCase()==="select"){var i=e(n).val();return i&&i.length>0}return this.checkable(n)?this.getLength(t,n)>0:e.trim(t).length>0},remote:function(t,n,r){if(this.optional(n))return"dependency-mismatch";var i=this.previousValue(n);this.settings.messages[n.name]||(this.settings.messages[n.name]={}),i.originalMessage=this.settings.messages[n.name].remote,this.settings.messages[n.name].remote=i.message,r=typeof r=="string"&&{url:r}||r;if(i.old===t)return i.valid;i.old=t;var s=this;this.startRequest(n);var o={};return o[n.name]=t,e.ajax(e.extend(!0,{url:r,mode:"abort",port:"validate"+n.name,dataType:"json",data:o,success:function(r){s.settings.messages[n.name].remote=i.originalMessage;var o=r===!0||r==="true";if(o){var u=s.formSubmitted;s.prepareElement(n),s.formSubmitted=u,s.successList.push(n),delete s.invalid[n.name],s.showErrors()}else{var a={},f=r||s.defaultMessage(n,"remote");a[n.name]=i.message=e.isFunction(f)?f(t):f,s.invalid[n.name]=!0,s.showErrors(a)}i.valid=o,s.stopRequest(n,o)}},r)),"pending"},minlength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i>=r},maxlength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i<=r},rangelength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i>=r[0]&&i<=r[1]},min:function(e,t,n){return this.optional(t)||e>=n},max:function(e,t,n){return this.optional(t)||e<=n},range:function(e,t,n){return this.optional(t)||e>=n[0]&&e<=n[1]},email:function(e,t){return this.optional(t)||/^((([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i.test(e)},url:function(e,t){return this.optional(t)||/^(https?|s?ftp):\\/\\/(((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?)(:\\d*)?)(\\/((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)+(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)*)*)?)?(\\?((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|[\\uE000-\\uF8FF]|\\/|\\?)*)?(#((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i.test(e)},date:function(e,t){return this.optional(t)||!/Invalid|NaN/.test((new Date(e)).toString())},dateISO:function(e,t){return this.optional(t)||/^\\d{4}[\\/\\-]\\d{1,2}[\\/\\-]\\d{1,2}$/.test(e)},number:function(e,t){return this.optional(t)||/^-?(?:\\d+|\\d{1,3}(?:,\\d{3})+)?(?:\\.\\d+)?$/.test(e)},digits:function(e,t){return this.optional(t)||/^\\d+$/.test(e)},creditcard:function(e,t){if(this.optional(t))return"dependency-mismatch";if(/[^0-9 \\-]+/.test(e))return!1;var n=0,r=0,i=!1;e=e.replace(/\\D/g,"");for(var s=e.length-1;s>=0;s--){var o=e.charAt(s);r=parseInt(o,10),i&&(r*=2)>9&&(r-=9),n+=r,i=!i}return n%10===0},equalTo:function(t,n,r){var i=e(r);return this.settings.onfocusout&&i.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){e(n).valid()}),t===i.val()}}}),e.format=e.validator.format})(jQuery),function(e){var t={};if(e.ajaxPrefilter)e.ajaxPrefilter(function(e,n,r){var i=e.port;e.mode==="abort"&&(t[i]&&t[i].abort(),t[i]=r)});else{var n=e.ajax;e.ajax=function(r){var i=("mode"in r?r:e.ajaxSettings).mode,s=("port"in r?r:e.ajaxSettings).port;return i==="abort"?(t[s]&&t[s].abort(),t[s]=n.apply(this,arguments)):n.apply(this,arguments)}}}(jQuery),function(e){e.extend(e.fn,{validateDelegate:function(t,n,r){return this.bind(n,function(n){var i=e(n.target);if(i.is(t))return r.apply(i,arguments)})}})}(jQuery);
]]></string> </value>
</item>
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>21493</int> </value>
<value> <int>20886</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
This Business Template contains only static files of jquery validation plugin 1.10.0.
This Business Template contains only static files of jquery validation plugin 1.11.0.
* http://bassistance.de/jquery-plugins/jquery-plugin-validation/
* http://docs.jquery.com/Plugins/Validation
\ No newline at end of file
1
\ No newline at end of file
2
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment