1/*! $12 Validation Plugin - v1.10.0 - 9/7/2012 2 * https://github.com/jzaefferer/$12-validation 3 * Copyright (c) 2012 Jörn Zaefferer; Licensed MIT, GPL */ 4 5(function(a) { a.extend(a.fn, { validate: function(b) { 6 if (!this.length) { b && b.debug && window.console && console.warn("nothing selected, can't validate, returning nothing"); 7 return } 8 var c = a.data(this[0], "validator"); 9 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) { 10 function d() { 11 var d; 12 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 } 13 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() { 14 if (a(this[0]).is("form")) return this.validate().form(); 15 var b = !0, 16 c = a(this[0].form).validate(); 17 return this.each(function() { b &= c.element(this) }), b }, removeAttrs: function(b) { 18 var c = {}, 19 d = this; 20 return a.each(b.split(/\s/), function(a, b) { c[b] = d.attr(b), d.removeAttr(b) }), c }, rules: function(b, c) { 21 var d = this[0]; 22 if (b) { 23 var e = a.data(d.form, "validator").settings, 24 f = e.rules, 25 g = a.validator.staticRules(d); 26 switch (b) { 27 case "add": 28 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)); 29 break; 30 case "remove": 31 if (!c) return delete f[d.name], g; 32 var h = {}; 33 return a.each(c.split(/\s/), function(a, b) { h[b] = g[b], delete g[b] }), h } } 34 var i = a.validator.normalizeRules(a.extend({}, a.validator.metadataRules(d), a.validator.classRules(d), a.validator.attributeRules(d), a.validator.staticRules(d)), d); 35 if (i.required) { 36 var j = i.required; 37 delete i.required, i = a.extend({ required: j }, i) } 38 return i } }), a.extend(a.expr[":"], { blank: function(b) { 39 return !a.trim("" + b.value) }, filled: function(b) { 40 return !!a.trim("" + b.value) }, unchecked: function(a) { 41 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) { 42 return arguments.length === 1 ? function() { 43 var c = a.makeArray(arguments); 44 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
44(a) }, onkeyup: function(a, b) { 45 if (b.which === 9 && this.elementValue(a) === "") return; 46 (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() { 47 function d(b) { 48 var c = a.data(this[0].form, "validator"), 49 d = "on" + b.type.replace(/^validate/, ""); 50 c.settings[d] && c.settings[d].call(c, this[0], b) } 51 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(); 52 var b = this.groups = {}; 53 a.each(this.settings.groups, function(c, d) { a.each(d.split(/\s/), function(a, d) { b[d] = c }) }); 54 var c = this.settings.rules; 55 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() { 56 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(); 57 for (var a = 0, b = this.currentElements = this.elements(); b[a]; a++) this.check(b[a]); 58 return this.valid() }, element: function(b) { b = this.validationTargetFor(this.clean(b)), this.lastElement = b, this.prepareElement(b), this.currentElements = a(b); 59 var c = this.check(b) !== !1; 60 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) { 61 if (b) { a.extend(this.errorMap, b), this.errorList = []; 62 for (var c in b) this.errorList.push({ message: b[c], element: this.findByName(c)[0] }); 63 this.successList = a.grep(this.successList, function(a) { 64 return !(a.name in b) }) } 65 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() { 66 return this.objectLength(this.invalid) }, objectLength: function(a) { 67 var b = 0; 68 for (var c in a) b++; 69 return b }, hideErrors: function() { this.addWrapper(this.toHide).hide() }, valid: function() { 70 return this.size() === 0 }, size: function() { 71 return this.errorList.length }, focusInvalid: function() { 72 if (this.settings.focusInvalid) try { a(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin") } catch (b) {} }, findLastActive: function() { 73 var b = this.lastActive; 74 return b && a.grep(this.errorList, function(a) { 75 return a.element.name === b.name }).length === 1 && b }, elements: function() { 76 var b = this, 77 c = {}; 78 return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function() { 79 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) { 80 return a(b)[0] }, errors: function() { 81 var b = this.settings.errorClass.replace(" ", "."); 82 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
82) }, prepareElement: function(a) { this.reset(), this.toHide = this.errorsFor(a) }, elementValue: function(b) { 83 var c = a(b).attr("type"), 84 d = a(b).val(); 85 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)); 86 var c = a(b).rules(), 87 d = !1, 88 e = this.elementValue(b), 89 f; 90 for (var g in c) { 91 var h = { method: g, parameters: c[g] }; 92 try { f = a.validator.methods[g].call(this, e, b, h.parameters); 93 if (f === "dependency-mismatch") { d = !0; 94 continue } 95 d = !1; 96 if (f === "pending") { this.toHide = this.toHide.not(this.errorsFor(b)); 97 return } 98 if (!f) return this.formatAndAdd(b, h), !1 } catch (i) { 99 throw this.settings.debug && window.console && console.log("exception occured when checking element " + b.id + ", check the '" + h.method + "' method", i), i } } 100 if (d) return; 101 return this.objectLength(c) && this.successList.push(b), !0 }, customMetaMessage: function(b, c) { 102 if (!a.metadata) return; 103 var d = this.settings.meta ? a(b).metadata()[this.settings.meta] : a(b).metadata(); 104 return d && d.messages && d.messages[c] }, customDataMessage: function(b, c) { 105 return a(b).data("msg-" + c.toLowerCase()) || b.attributes && a(b).attr("data-msg-" + c.toLowerCase()) }, customMessage: function(a, b) { 106 var c = this.settings.messages[a]; 107 return c && (c.constructor === String ? c : c[b]) }, findDefined: function() { 108 for (var a = 0; a < arguments.length; a++) 109 if (arguments[a] !== undefined) return arguments[a]; 110 return undefined }, defaultMessage: function(b, c) { 111 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) { 112 var d = this.defaultMessage(b, c.method), 113 e = /\$?\{(\d+)\}/g; 114 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) { 115 return this.settings.wrapper && (a = a.add(a.parent(this.settings.wrapper))), a }, defaultShowErrors: function() { 116 var a, b; 117 for (a = 0; this.errorList[a]; a++) { 118 var c = this.errorList[a]; 119 this.settings.highlight && this.settings.highlight.call(this, c.element, this.settings.errorClass, this.settings.validClass), this.showLabel(c.element, c.message) } 120 this.errorList.length && (this.toShow = this.toShow.add(this.containers)); 121 if (this.settings.success) 122 for (a = 0; this.successList[a]; a++) this.showLabel(this.successList[a]); 123 if (this.settings.unhighlight) 124 for (a = 0, b = this.validElements(); b[a]; a++) this.settings.unhighlight.call(this, b[a], this.settings.errorClass, this.settings.validClass); 125 this.toHide = this.toHide.not(this.toShow), this.hideErrors(), this.addWrapper(this.toShow).show() }, validElements: function() { 126 return this.currentElements.not(this.invalidElements()) }, invalidElements: function() { 127 return a(this.errorList).map(function() { 128 return this.element }) }, showLabel: function(b, c) { 129 var d = this.errorsFor(b);
130 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) { 131 var c = this.idOrName(b); 132 return this.errors().filter(function() { 133 return a(this).attr("for") === c }) }, idOrName: function(a) { 134 return this.groups[a.name] || (this.checkable(a) ? a.name : a.id || a.name) }, validationTargetFor: function(a) { 135 return this.checkable(a) && (a = this.findByName(a.name).not(this.settings.ignore)[0]), a }, checkable: function(a) { 136 return /radio|checkbox/i.test(a.type) }, findByName: function(b) { 137 return a(this.currentForm).find('[name="' + b + '"]') }, getLength: function(b, c) { 138 switch (c.nodeName.toLowerCase()) { 139 case "select": 140 return a("option:selected", c).length; 141 case "input": 142 if (this.checkable(c)) return this.findByName(c.name).filter(":checked").length } 143 return b.length }, depend: function(a, b) { 144 return this.dependTypes[typeof a] ? this.dependTypes[typeof a](a, b) : !0 }, dependTypes: { "boolean": function(a, b) { 145 return a }, string: function(b, c) { 146 return !!a(b, c.form).length }, "function": function(a, b) { 147 return a(b) } }, optional: function(b) { 148 var c = this.elementValue(b); 149 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) { 150 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) { 151 var c = {}, 152 d = a(b).attr("class"); 153 return d && a.each(d.split(" "), function() { this in a.validator.classRuleSettings && a.extend(c, a.validator.classRuleSettings[this]) }), c }, attributeRules: function(b) { 154 var c = {}, 155 d = a(b); 156 for (var e in a.validator.methods) { 157 var f; 158 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) } 159 return c.maxlength && /-1|2147483647|524288/.test(c.maxlength) && delete c.maxlength, c }, metadataRules: function(b) { 160 if (!a.metadata) return {}; 161 var c = a.data(b.form, "validator").settings.meta; 162 return c ? a(b).metadata()[c] : a(b).metadata() }, staticRules: function(b) { 163 var c = {}, 164 d = a.data(b.form, "validator"); 165 return d.settings.rules && (c = a.validator.normalizeRule(d.settings.rules[b.name]) || {}), c }, normalizeRules: function(b, c) { 166 return a.each(b, function(d, e) { 167 if (e === !1) { delete b[d]; 168 return } 169 if (e.param || e.depends) { 170 var f = !0; 171 switch (typeof e.depends) { 172 case "string": 173 f = !!a(e.depends, c.form).length; 174 break; 175 case "function": 176 f = e.depends.call(c, c) } 177 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) { 178 if (typeof b == "string") { 179 var c = {}; 180 a.each(b.split(/\s/), function() { c[this] = !0 }), b = c } 181 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) { 182 if (!this.depend(d, c)) return "dependency-mismatch"; 183 if (c.nodeName.toLowerCase() === "select") { 184 var e = a(c).val(); 185 return e && e.length > 0 } 186 return this.checkable(c) ? this.getLength(b, c) > 0 : a.trim(b).length > 0 }, remote: function(b, c, d) { 187 if (this.optional(c)) return "dependency-mismatch"; 188 var e = this.previousValue(c); 189 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; 190 if (this.pending[c.name]) return "pending"; 191 if (e.old === b) return e.valid; 192 e.old = b; 193 var f = this;
194 this.startRequest(c); 195 var g = {}; 196 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; 197 var g = d === !0 || d === "true"; 198 if (g) { 199 var h = f.formSubmitted; 200 f.prepareElement(c), f.formSubmitted = h, f.successList.push(c), delete f.invalid[c.name], f.showErrors() } else { 201 var i = {}, 202 j = d || f.defaultMessage(c, "remote"); 203 i[c.name] = e.message = a.isFunction(j) ? j(b) : j, f.invalid[c.name] = !0, f.showErrors(i) } 204 e.valid = g, f.stopRequest(c, g) } }, d)), "pending" }, minlength: function(b, c, d) { 205 var e = a.isArray(b) ? b.length : this.getLength(a.trim(b), c); 206 return this.optional(c) || e >= d }, maxlength: function(b, c, d) { 207 var e = a.isArray(b) ? b.length : this.getLength(a.trim(b), c); 208 return this.optional(c) || e <= d }, rangelength: function(b, c, d) { 209 var e = a.isArray(b) ? b.length : this.getLength(a.trim(b), c); 210 return this.optional(c) || e >= d[0] && e <= d[1] }, min: function(a, b, c) { 211 return this.optional(b) || a >= c }, max: function(a, b, c) { 212 return this.optional(b) || a <= c }, range: function(a, b, c) { 213 return this.optional(b) || a >= c[0] && a <= c[1] }, email: function(a, b) { 214 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) { 215 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) { 216 return this.optional(b) || !/Invalid|NaN/.test(new Date(a)) }, dateISO: function(a, b) { 217 return this.optional(b) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(a) }, number: function(a, b) { 218 return this.optional(b) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a) }, digits: function(a, b) { 219 return this.optional(b) || /^\d+$/.test(a) }, creditcard: function(a, b) { 220 if (this.optional(b)) return "dependency-mismatch"; 221 if (/[^0-9 \-]+/.test(a)) return !1; 222 var c = 0, 223 d = 0, 224 e = !1; 225 a = a.replace(/\D/g, ""); 226 for (var f = a.length - 1; f >= 0;
226 f--) { 227 var g = a.charAt(f); 228 d = parseInt(g, 10), e && (d *= 2) > 9 && (d -= 9), c += d, e = !e } 229 return c % 10 === 0 }, equalTo: function(b, c, d) { 230 var e = a(d); 231 return this.settings.onfocusout && e.unbind(".validate-equalTo").bind("blur.validate-equalTo", function() { a(c).valid() }), b === e.val() } } }), a.format = a.validator.format })($12), 232function(a) { 233 var b = {}; 234 if (a.ajaxPrefilter) a.ajaxPrefilter(function(a, c, d) { 235 var e = a.port; 236 a.mode === "abort" && (b[e] && b[e].abort(), b[e] = d) }); 237 else { 238 var c = a.ajax; 239 a.ajax = function(d) { 240 var e = ("mode" in d ? d : a.ajaxSettings).mode, 241 f = ("port" in d ? d : a.ajaxSettings).port; 242 return e === "abort" ? (b[f] && b[f].abort(), b[f] = c.apply(this, arguments)) : c.apply(this, arguments) } } }($12), 243function(a) {!$12.event.special.focusin && !$12.event.special.focusout && document.addEventListener && a.each({ focus: "focusin", blur: "focusout" }, function(b, c) { 244 function d(b) { 245 return b = a.event.fix(b), b.type = c, a.event.dispatch.call(this, b)} 246 a.event.special[c] = { setup: function() { this.addEventListener(b, d, !0) }, teardown: function() { this.removeEventListener(b, d, !0) }, handler: function(b) { 247 var d = arguments; 248 return d[0] = a.event.fix(b), d[0].type = c, a.event.dispatch.apply(this, d) } } }), a.extend(a.fn, { validateDelegate: function(b, c, d) { 249 return this.bind(c, function(c) { 250 var e = a(c.target); 251 if (e.is(b)) return d.apply(e, arguments) }) } }) }($12)
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.