2 * jQuery Validation Plugin 1.9.0
4 * http://bassistance.de/jquery-plugins/jquery-plugin-validation/
5 * http://docs.jquery.com/Plugins/Validation
7 * Copyright (c) 2006 - 2011 Jörn Zaefferer
9 * Dual licensed under the MIT and GPL licenses:
10 * http://www.opensource.org/licenses/mit-license.php
11 * http://www.gnu.org/licenses/gpl.html
15 validate: function (a) {
17 var b = c.data(this[0], "validator");
19 this.attr("novalidate", "novalidate");
20 b = new c.validator(a, this[0]);
21 c.data(this[0], "validator", b);
22 if (b.settings.onsubmit) {
23 a = this.find("input, button");
24 a.filter(".cancel").click(function () {
27 b.settings.submitHandler && a.filter(":submit").click(function () {
30 this.submit(function (d) {
32 if (b.settings.submitHandler) {
33 if (b.submitButton) var f = c("<input type='hidden'/>").attr("name",
34 b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm);
35 b.settings.submitHandler.call(b, b.currentForm);
36 b.submitButton && f.remove();
41 b.settings.debug && d.preventDefault();
43 b.cancelSubmit = false;
47 if (b.pendingRequest) {
48 b.formSubmitted = true;
59 } else a && a.debug && window.console && console.warn("nothing selected, can't validate, returning nothing")
62 if (c(this[0]).is("form")) return this.validate().form();
65 b = c(this[0].form).validate();
66 this.each(function () {
72 removeAttrs: function (a) {
75 c.each(a.split(/\s/), function (e, f) {
81 rules: function (a, b) {
84 var e = c.data(d.form, "validator").settings,
86 g = c.validator.staticRules(d);
89 c.extend(g, c.validator.normalizeRule(b));
91 if (b.messages) e.messages[d.name] = c.extend(e.messages[d.name], b.messages);
99 c.each(b.split(/\s/), function (j, i) {
106 d = c.validator.normalizeRules(c.extend({}, c.validator.metadataRules(d), c.validator.classRules(d), c.validator.attributeRules(d), c.validator.staticRules(d)), d);
117 c.extend(c.expr[":"], {
118 blank: function (a) {
119 return !c.trim("" + a.value)
121 filled: function (a) {
122 return !!c.trim("" + a.value)
124 unchecked: function (a) {
128 c.validator = function (a,
130 this.settings = c.extend(true, {}, c.validator.defaults, a);
131 this.currentForm = b;
134 c.validator.format = function (a, b) {
135 if (arguments.length == 1) return function () {
136 var d = c.makeArray(arguments);
138 return c.validator.format.apply(this, d)
140 if (arguments.length > 2 && b.constructor != Array) b = c.makeArray(arguments).slice(1);
141 if (b.constructor != Array) b = [b];
142 c.each(b, function (d, e) {
143 a = a.replace(RegExp("\\{" + d + "\\}", "g"), e)
147 c.extend(c.validator, {
152 errorClass: "control-label",
153 validClass: "control-label",
154 errorElement: "span",
156 errorContainer: c([]),
157 errorLabelContainer: c([]),
161 onfocusin: function (a) {
163 if (this.settings.focusCleanup && !this.blockFocusCleanup) {
164 this.settings.unhighlight && this.settings.unhighlight.call(this, a, this.settings.errorClass, this.settings.validClass);
165 this.addWrapper(this.errorsFor(a)).hide()
168 onfocusout: function (a) {
169 if (!this.checkable(a) && (a.name in this.submitted || !this.optional(a))) this.element(a)
171 onkeyup: function (a) {
172 if (a.name in this.submitted || a == this.lastElement) this.element(a)
174 onclick: function (a) {
175 if (a.name in this.submitted) this.element(a);
176 else a.parentNode.name in this.submitted && this.element(a.parentNode)
178 highlight: function (a, b, d) {
179 a.type === "radio" ? this.findByName(a.name).addClass(b).removeClass(d) : c(a).addClass(b).removeClass(d)
181 unhighlight: function (a, b, d) {
182 a.type === "radio" ? this.findByName(a.name).removeClass(b).addClass(d) : c(a).removeClass(b).addClass(d)
185 setDefaults: function (a) {
186 c.extend(c.validator.defaults,
191 remote: "Please fix this field.",
192 email: "Please enter a valid email address.",
193 url: "Please enter a valid URL.",
194 date: "Please enter a valid date.",
195 dateISO: "Please enter a valid date (ISO).",
196 number: "Please enter a valid number.",
197 digits: "Please enter only digits.",
198 creditcard: "Please enter a valid credit card number.",
199 equalTo: "Please enter the same value again.",
200 accept: "Please enter a value with a valid extension.",
201 maxlength: c.validator.format("Please enter no more than {0} characters."),
202 minlength: c.validator.format("Please enter at least {0} characters."),
203 rangelength: c.validator.format("Please enter a value between {0} and {1} characters long."),
204 range: c.validator.format("Please enter a value between {0} and {1}."),
205 max: c.validator.format("Please enter a value less than or equal to {0}."),
206 min: c.validator.format("Please enter a value greater than or equal to {0}.")
208 autoCreateRanges: false,
212 var f = c.data(this[0].form, "validator"),
213 g = "on" + e.type.replace(/^validate/,
215 f.settings[g] && f.settings[g].call(f, this[0], e)
217 this.labelContainer = c(this.settings.errorLabelContainer);
218 this.errorContext = this.labelContainer.length && this.labelContainer || c(this.currentForm);
219 this.containers = c(this.settings.errorContainer).add(this.settings.errorLabelContainer);
221 this.valueCache = {};
222 this.pendingRequest = 0;
226 var b = this.groups = {};
227 c.each(this.settings.groups, function (e, f) {
228 c.each(f.split(/\s/), function (g, h) {
234 c.each(d, function (e, f) {
235 d[e] = c.validator.normalizeRule(f)
237 c(this.currentForm).validateDelegate("[type='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", a).validateDelegate("[type='radio'], [type='checkbox'], select, option", "click",
239 this.settings.invalidHandler && c(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler)
243 c.extend(this.submitted, this.errorMap);
244 this.invalid = c.extend({}, this.errorMap);
245 this.valid() || c(this.currentForm).triggerHandler("invalid-form", [this]);
249 checkForm: function () {
251 for (var a = 0, b = this.currentElements = this.elements(); b[a]; a++) this.check(b[a]);
254 element: function (a) {
256 a = this.validationTargetFor(this.clean(a));
257 this.prepareElement(a);
258 this.currentElements = c(a);
259 var b = this.check(a);
260 if (b) delete this.invalid[a.name];
261 else this.invalid[a.name] = true; if (!this.numberOfInvalids()) this.toHide = this.toHide.add(this.containers);
265 showErrors: function (a) {
267 c.extend(this.errorMap, a);
269 for (var b in a) this.errorList.push({
271 element: this.findByName(b)[0]
273 this.successList = c.grep(this.successList, function (d) {
274 return !(d.name in a)
277 this.settings.showErrors ?
278 this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors()
280 resetForm: function () {
281 c.fn.resetForm && c(this.currentForm).resetForm();
283 this.lastElement = null;
286 this.elements().removeClass(this.settings.errorClass)
288 numberOfInvalids: function () {
289 return this.objectLength(this.invalid)
291 objectLength: function (a) {
297 hideErrors: function () {
298 this.addWrapper(this.toHide).hide()
301 return this.size() ==
305 return this.errorList.length
307 focusInvalid: function () {
308 if (this.settings.focusInvalid) try {
309 c(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin")
312 findLastActive: function () {
313 var a = this.lastActive;
314 return a && c.grep(this.errorList, function (b) {
315 return b.element.name == a.name
318 elements: function () {
321 return c(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function () {
323 a.settings.debug && window.console && console.error("%o has no name assigned", this);
324 if (this.name in b || !a.objectLength(c(this).rules())) return false;
325 return b[this.name] = true
328 clean: function (a) {
331 errors: function () {
332 return c(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext)
335 this.successList = [];
340 this.currentElements = c([])
342 prepareForm: function () {
344 this.toHide = this.errors().add(this.containers)
346 prepareElement: function (a) {
348 this.toHide = this.errorsFor(a)
350 check: function (a) {
351 a = this.validationTargetFor(this.clean(a));
352 var b = c(a).rules(),
361 var g = c.validator.methods[e].call(this, a.value.replace(/\r/g, ""), a, f.parameters);
362 if (g == "dependency-mismatch") d = true;
365 if (g == "pending") {
366 this.toHide = this.toHide.not(this.errorsFor(a));
370 this.formatAndAdd(a, f);
375 this.settings.debug && window.console && console.log("exception occured when checking element " +
376 a.id + ", check the '" + f.method + "' method", h);
381 this.objectLength(b) && this.successList.push(a);
385 customMetaMessage: function (a, b) {
387 var d = this.settings.meta ? c(a).metadata()[this.settings.meta] : c(a).metadata();
388 return d && d.messages && d.messages[b]
391 customMessage: function (a, b) {
392 var d = this.settings.messages[a];
393 return d && (d.constructor == String ? d : d[b])
395 findDefined: function () {
396 for (var a = 0; a < arguments.length; a++)
397 if (arguments[a] !== undefined) return arguments[a]
399 defaultMessage: function (a,
401 return this.findDefined(this.customMessage(a.name, b), this.customMetaMessage(a, b), !this.settings.ignoreTitle && a.title || undefined, c.validator.messages[b], "<strong>Warning: No message defined for " + a.name + "</strong>")
403 formatAndAdd: function (a, b) {
404 var d = this.defaultMessage(a, b.method),
406 if (typeof d == "function") d = d.call(this, b.parameters, a);
407 else if (e.test(d)) d = jQuery.format(d.replace(e, "{$1}"), b.parameters);
408 this.errorList.push({
412 this.errorMap[a.name] = d;
413 this.submitted[a.name] =
416 addWrapper: function (a) {
417 if (this.settings.wrapper) a = a.add(a.parent(this.settings.wrapper));
420 defaultShowErrors: function () {
421 for (var a = 0; this.errorList[a]; a++) {
422 var b = this.errorList[a];
423 this.settings.highlight && this.settings.highlight.call(this, b.element, this.settings.errorClass, this.settings.validClass);
424 this.showLabel(b.element, b.message)
426 if (this.errorList.length) this.toShow = this.toShow.add(this.containers);
427 if (this.settings.success)
428 for (a = 0; this.successList[a]; a++) this.showLabel(this.successList[a]);
429 if (this.settings.unhighlight) {
431 for (b = this.validElements(); b[a]; a++) this.settings.unhighlight.call(this, b[a], this.settings.errorClass, this.settings.validClass)
433 this.toHide = this.toHide.not(this.toShow);
435 this.addWrapper(this.toShow).show()
437 validElements: function () {
438 return this.currentElements.not(this.invalidElements())
440 invalidElements: function () {
441 return c(this.errorList).map(function () {
445 showLabel: function (a, b) {
446 var d = this.errorsFor(a);
448 d.removeClass(this.settings.validClass).addClass(this.settings.errorClass);
449 d.attr("generated") && d.html(b)
451 d = c("<" + this.settings.errorElement + "/>").attr({
452 "for": this.idOrName(a),
454 }).addClass(this.settings.errorClass).html(b || "");
455 if (this.settings.wrapper) d = d.hide().show().wrap("<" + this.settings.wrapper + "/>").parent();
456 this.labelContainer.append(d).length || (this.settings.errorPlacement ? this.settings.errorPlacement(d, c(a)) : d.insertAfter(a))
457 } if (!b && this.settings.success) {
459 typeof this.settings.success == "string" ? d.addClass(this.settings.success) : this.settings.success(d)
464 errorsFor: function (a) {
465 var b = this.idOrName(a);
466 return this.errors().filter(function () {
467 return c(this).attr("for") == b
470 idOrName: function (a) {
471 return this.groups[a.name] || (this.checkable(a) ? a.name : a.id || a.name)
473 validationTargetFor: function (a) {
474 if (this.checkable(a)) a = this.findByName(a.name).not(this.settings.ignore)[0];
477 checkable: function (a) {
478 return /radio|checkbox/i.test(a.type)
480 findByName: function (a) {
481 var b = this.currentForm;
482 return c(document.getElementsByName(a)).map(function (d,
484 return e.form == b && e.name == a && e || null
487 getLength: function (a, b) {
488 switch (b.nodeName.toLowerCase()) {
490 return c("option:selected", b).length;
492 if (this.checkable(b)) return this.findByName(b.name).filter(":checked").length
496 depend: function (a, b) {
497 return this.dependTypes[typeof a] ? this.dependTypes[typeof a](a, b) : true
500 "boolean": function (a) {
503 string: function (a, b) {
504 return !!c(a, b.form).length
506 "function": function (a, b) {
510 optional: function (a) {
511 return !c.validator.methods.required.call(this,
512 c.trim(a.value), a) && "dependency-mismatch"
514 startRequest: function (a) {
515 if (!this.pending[a.name]) {
516 this.pendingRequest++;
517 this.pending[a.name] = true
520 stopRequest: function (a, b) {
521 this.pendingRequest--;
522 if (this.pendingRequest < 0) this.pendingRequest = 0;
523 delete this.pending[a.name];
524 if (b && this.pendingRequest == 0 && this.formSubmitted && this.form()) {
525 c(this.currentForm).submit();
526 this.formSubmitted = false
527 } else if (!b && this.pendingRequest == 0 && this.formSubmitted) {
528 c(this.currentForm).triggerHandler("invalid-form", [this]);
533 previousValue: function (a) {
534 return c.data(a, "previousValue") || c.data(a, "previousValue", {
537 message: this.defaultMessage(a, "remote")
573 addClassRules: function (a, b) {
574 a.constructor == String ? this.classRuleSettings[a] = b : c.extend(this.classRuleSettings,
577 classRules: function (a) {
579 (a = c(a).attr("class")) && c.each(a.split(" "), function () {
580 this in c.validator.classRuleSettings && c.extend(b, c.validator.classRuleSettings[this])
584 attributeRules: function (a) {
587 for (var d in c.validator.methods) {
589 if (e = d === "required" && typeof c.fn.prop === "function" ? a.prop(d) : a.attr(d)) b[d] = e;
590 else if (a[0].getAttribute("type") === d) b[d] = true
592 b.maxlength && /-1|2147483647|524288/.test(b.maxlength) && delete b.maxlength;
595 metadataRules: function (a) {
596 if (!c.metadata) return {};
597 var b = c.data(a.form, "validator").settings.meta;
598 return b ? c(a).metadata()[b] : c(a).metadata()
600 staticRules: function (a) {
602 d = c.data(a.form, "validator");
603 if (d.settings.rules) b = c.validator.normalizeRule(d.settings.rules[a.name]) || {};
606 normalizeRules: function (a, b) {
607 c.each(a, function (d, e) {
608 if (e === false) delete a[d];
609 else if (e.param || e.depends) {
611 switch (typeof e.depends) {
613 f = !!c(e.depends, b.form).length;
616 f = e.depends.call(b, b)
618 if (f) a[d] = e.param !== undefined ?
623 c.each(a, function (d, e) {
624 a[d] = c.isFunction(e) ? e(b) : e
626 c.each(["minlength", "maxlength", "min", "max"], function () {
627 if (a[this]) a[this] = Number(a[this])
629 c.each(["rangelength", "range"], function () {
630 if (a[this]) a[this] = [Number(a[this][0]), Number(a[this][1])]
632 if (c.validator.autoCreateRanges) {
633 if (a.min && a.max) {
634 a.range = [a.min, a.max];
638 if (a.minlength && a.maxlength) {
639 a.rangelength = [a.minlength, a.maxlength];
644 a.messages && delete a.messages;
647 normalizeRule: function (a) {
648 if (typeof a == "string") {
650 c.each(a.split(/\s/), function () {
657 addMethod: function (a, b, d) {
658 c.validator.methods[a] = b;
659 c.validator.messages[a] = d != undefined ? d : c.validator.messages[a];
660 b.length < 3 && c.validator.addClassRules(a, c.validator.normalizeRule(a))
663 required: function (a, b, d) {
664 if (!this.depend(d, b)) return "dependency-mismatch";
665 switch (b.nodeName.toLowerCase()) {
667 return (a = c(b).val()) && a.length > 0;
669 if (this.checkable(b)) return this.getLength(a,
672 return c.trim(a).length > 0
675 remote: function (a, b, d) {
676 if (this.optional(b)) return "dependency-mismatch";
677 var e = this.previousValue(b);
678 this.settings.messages[b.name] || (this.settings.messages[b.name] = {});
679 e.originalMessage = this.settings.messages[b.name].remote;
680 this.settings.messages[b.name].remote = e.message;
681 d = typeof d == "string" && {
684 if (this.pending[b.name]) return "pending";
685 if (e.old === a) return e.valid;
688 this.startRequest(b);
691 c.ajax(c.extend(true, {
694 port: "validate" + b.name,
697 success: function (h) {
698 f.settings.messages[b.name].remote = e.originalMessage;
701 var i = f.formSubmitted;
704 f.successList.push(b);
708 h = h || f.defaultMessage(b, "remote");
709 i[b.name] = e.message = c.isFunction(h) ? h(a) : h;
718 minlength: function (a, b, d) {
719 return this.optional(b) || this.getLength(c.trim(a), b) >= d
721 maxlength: function (a,
723 return this.optional(b) || this.getLength(c.trim(a), b) <= d
725 rangelength: function (a, b, d) {
726 a = this.getLength(c.trim(a), b);
727 return this.optional(b) || a >= d[0] && a <= d[1]
729 min: function (a, b, d) {
730 return this.optional(b) || a >= d
732 max: function (a, b, d) {
733 return this.optional(b) || a <= d
735 range: function (a, b, d) {
736 return this.optional(b) || a >= d[0] && a <= d[1]
738 email: function (a, b) {
739 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)
741 url: function (a, b) {
742 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)
744 date: function (a, b) {
745 return this.optional(b) || !/Invalid|NaN/.test(new Date(a))
747 dateISO: function (a, b) {
748 return this.optional(b) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)
750 number: function (a, b) {
751 return this.optional(b) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)
753 digits: function (a, b) {
754 return this.optional(b) || /^\d+$/.test(a)
756 creditcard: function (a, b) {
757 if (this.optional(b)) return "dependency-mismatch";
758 if (/[^0-9 -]+/.test(a)) return false;
762 a = a.replace(/\D/g, "");
763 for (var g = a.length - 1; g >=
768 if ((e *= 2) > 9) e -= 9;
774 accept: function (a, b, d) {
775 d = typeof d == "string" ? d.replace(/,/g, "|") : "png|jpe?g|gif";
776 return this.optional(b) || a.match(RegExp(".(" + d + ")$", "i"))
778 equalTo: function (a, b, d) {
779 d = c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo", function () {
786 c.format = c.validator.format
790 if (c.ajaxPrefilter) c.ajaxPrefilter(function (d, e, f) {
792 if (d.mode == "abort") {
793 a[e] && a[e].abort();
799 c.ajax = function (d) {
800 var e = ("port" in d ? d : c.ajaxSettings).port;
801 if (("mode" in d ? d : c.ajaxSettings).mode == "abort") {
802 a[e] && a[e].abort();
803 return a[e] = b.apply(this, arguments)
805 return b.apply(this, arguments)
810 !jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener && c.each({
817 return c.event.handle.call(this, e)
819 c.event.special[b] = {
821 this.addEventListener(a, d, true)
823 teardown: function () {
824 this.removeEventListener(a, d, true)
826 handler: function (e) {
827 arguments[0] = c.event.fix(e);
828 arguments[0].type = b;
829 return c.event.handle.apply(this, arguments)
834 validateDelegate: function (a,
836 return this.bind(b, function (e) {
838 if (f.is(a)) return d.apply(f, arguments)