From 35b406db675bb99d51f2bf8608b7d1cd933362b1 Mon Sep 17 00:00:00 2001 From: elclanrs Date: Sat, 26 Oct 2013 17:08:04 -0400 Subject: [PATCH] fix range rule typo --- js/out/jquery.idealforms.js | 4 ++-- js/out/jquery.idealforms.min.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/out/jquery.idealforms.js b/js/out/jquery.idealforms.js index f406907..4753085 100644 --- a/js/out/jquery.idealforms.js +++ b/js/out/jquery.idealforms.js @@ -1264,7 +1264,7 @@ module.exports = { return !isNaN(value); }, - range: function(input, value, mix, max) { + range: function(input, value, min, max) { return Number(value) >= min && Number(value) <= max; }, @@ -1350,5 +1350,5 @@ module.exports = { }; },{}]},{},[11]) -//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJhdGVkLmpzIiwic291cmNlcyI6WyIvdmFyL3d3dy9qcS1pZGVhbGZvcm1zL2pzL2Vycm9ycy5qcyIsIi92YXIvd3d3L2pxLWlkZWFsZm9ybXMvanMvZXh0ZW5zaW9ucy9hZGFwdGl2ZS9hZGFwdGl2ZS5leHQuanMiLCIvdmFyL3d3dy9qcS1pZGVhbGZvcm1zL2pzL2V4dGVuc2lvbnMvYWpheC9hamF4LmV4dC5qcyIsIi92YXIvd3d3L2pxLWlkZWFsZm9ybXMvanMvZXh0ZW5zaW9ucy9jdXN0b20taW5wdXRzL2N1c3RvbS1pbnB1dHMuZXh0LmpzIiwiL3Zhci93d3cvanEtaWRlYWxmb3Jtcy9qcy9leHRlbnNpb25zL2N1c3RvbS1pbnB1dHMvaWRlYWxmaWxlLmpzIiwiL3Zhci93d3cvanEtaWRlYWxmb3Jtcy9qcy9leHRlbnNpb25zL2N1c3RvbS1pbnB1dHMvaWRlYWxyYWRpb2NoZWNrLmpzIiwiL3Zhci93d3cvanEtaWRlYWxmb3Jtcy9qcy9leHRlbnNpb25zL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci5leHQuanMi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AgICAgICAgICAgIGZpbGVzLnB1c2goZmlsZUFycltpXS5uYW1lKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZmlsZW5hbWUgPSBmaWxlcy5qb2luKCcsICcpO1xuXG4gICAgICAgICAgLy8gSWYgbm90IHN1cHBvcnRlZCB0aGVuIGp1c3QgdGFrZSB0aGUgdmFsdWVcbiAgICAgICAgICAvLyBhbmQgcmVtb3ZlIHRoZSBwYXRoIHRvIGp1c3Qgc2hvdyB0aGUgZmlsZW5hbWVcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBmaWxlbmFtZSA9ICRmaWxlLnZhbCgpLnNwbGl0KCdcXFxcJykucG9wKCk7XG4gICAgICAgIH1cblxuICAgICAgICAkaW5wdXQgLnZhbChmaWxlbmFtZSkuYXR0cigndGl0bGUnLCBmaWxlbmFtZSk7XG5cbiAgICAgIH0pO1xuXG4gICAgICAkaW5wdXQub24oe1xuICAgICAgICBibHVyOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgJGZpbGUudHJpZ2dlcignYmx1cicpO1xuICAgICAgICB9LFxuICAgICAgICBrZXlkb3duOiBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgIGlmIChlLndoaWNoID09PSAxMykgeyAvLyBFbnRlclxuICAgICAgICAgICAgaWYgKCFpc0lFKSAkZmlsZS50cmlnZ2VyKCdjbGljaycpO1xuICAgICAgICAgICAgJCh0aGlzKS5jbG9zZXN0KCdmb3JtJykub25lKCdrZXlkb3duJywgZnVuY3Rpb24oZSkge1xuICAgICAgICAgICAgICBpZiAoZS53aGljaCA9PT0gMTMpIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSBpZiAoZS53aGljaCA9PT0gOCB8fCBlLndoaWNoID09PSA0NikgeyAvLyBCYWNrc3BhY2UgJiBEZWxcbiAgICAgICAgICAgIC8vIEluIElFIHRoZSB2YWx1ZSBpcyByZWFkLW9ubHlcbiAgICAgICA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GUgdmFsdWVcbiAgICAgICAgICAvLyBhbmQgcmVtb3ZlIHRoZSBwYXRoIHRvIGp1c3Qgc2hvdyB0aGUgZmlsZW5hbWVcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBmaWxlbmFtZSA9ICRmaWxlLnZhbCgpLnNwbGl0KCdcXFxcJykucG9wKCk7XG4gICAgICAgIH1cblxuICAgICAgICAkaW5wdXQgLnZhbChmaWxlbmFtZSkuYXR0cigndGl0bGUnLCBmaWxlbmFtZSk7XG5cbiAgICAgIH0pO1xuXG4gICAgICAkaW5wdXQub24oe1xuICAgICAgICBibHVyOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgJGZpbGUudHJpZ2dlcignYmx1cicpO1xuICAgICAgICB9LFxuICAgICAgICBrZXlkb3duOiBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgIGlmIChlLndoaWNoID09PSAxMykgeyAvLyBFbnRlclxuICAgICAgICAgICAgaWYgKCFpc0lFKSAkZmlsZS50cmlnZ2VyKCdjbGljaycpO1xuICAgICAgICAgICAgJCh0aGlzKS5jbG9zZXN0KCdmb3JtJykub25lKCdrZXlkb3duJywgZnVuY3Rpb24oZSkge1xuICAgICAgICAgICAgICBpZiAoZS53aGljaCA9PT0gMTMpIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSBpZiAoZS53aGljaCA9PT0gOCB8fCBlLndoaWNoID09PSA0NikgeyAvLyBCYWNrc3BhY2UgJiBEZWxcbiAgICAgICAgICAgIC8vIEluIElFIHRoZSB2YWx1ZSBpcyByZWFkLW9ubHlcbiAgICAgICAgICAgIC8vIHdpdGggdGhpcyB0cmljayB3ZSByZW1vdmUgdGhlIG9sZCBpbnB1dCBhbmQgYWRkXG4gICAgICAgICAgICAvLyBhIGNsZWFuIGNsb25lIHdpdGggYWxsIHRoZSBvcmlnaW5hbCBldmVudHMgYXR0YWNoZWRcbiAgICAgICAgICAgIGlmIChp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cm1hdCk7XG4gIH1cblxufTtcbiJdfQ== ; \ No newline at end of file diff --git a/js/out/jquery.idealforms.min.js b/js/out/jquery.idealforms.min.js index 224369b..290e888 100644 --- a/js/out/jquery.idealforms.min.js +++ b/js/out/jquery.idealforms.min.js @@ -4,4 +4,4 @@ * @version: 3.0 * @license GPL or MIT */ -!function(t){var i={};i.name="idealforms",i.defaults={field:".field",error:".error",iconHtml:"",iconClass:"icon",invalidClass:"invalid",validClass:"valid",silentLoad:!0,onValidate:t.noop,onSubmit:t.noop},i.global={_format:function(e){var t=[].slice.call(arguments,1);return e.replace(/\{(\d)\}/g,function(e,i){return t[+i]||""}).replace(/\{\*([^*}]*)\}/g,function(e,i){return t.join(i||", ")})},_getKey:function(e,t){return e.split(".").reduce(function(e,t){return e&&e[t]},t)},i18n:{},ruleSeparator:" ",argSeparator:":",rules:e("./rules"),errors:e("./errors"),extensions:[e("./extensions/dynamic-fields/dynamic-fields.ext"),e("./extensions/ajax/ajax.ext"),e("./extensions/steps/steps.ext"),e("./extensions/custom-inputs/custom-inputs.ext"),e("./extensions/datepicker/datepicker.ext"),e("./extensions/adaptive/adaptive.ext")]},i.methods=t.extend({},e("./private"),e("./public")),e("./plugin")(i)}(jQuery,window,document)},{"./errors":1,"./extensions/adaptive/adaptive.ext":2,"./extensions/ajax/ajax.ext":3,"./extensions/custom-inputs/custom-inputs.ext":4,"./extensions/datepicker/datepicker.ext":7,"./extensions/dynamic-fields/dynamic-fields.ext":8,"./extensions/steps/steps.ext":10,"./plugin":12,"./private":13,"./public":14,"./rules":15}],12:[function(e,t){t.exports=function(){var e=Array.prototype;return function(t){function i(e,i){this.opts=$.extend({},t.defaults,i),this.el=e,this._name=t.name,this._init()}t=$.extend(!0,{name:"plugin",defaults:{disabledExtensions:"none"},methods:{},global:{}},t),$[t.name]=$.extend({addExtension:function(e){t.global.extensions.push(e)}},t.global),i._extended={},i.prototype._hasExtension=function(e){var i=this;return t.global.extensions.filter(function(t){return t.name==e&&i.opts.disabledExtensions.indexOf(t.name)<0}).length},i.prototype._extend=function(e){var t=this;$.each(e,function(e,s){$.extend(t.opts,$.extend(!0,s.options,t.opts)),$.each(s.methods,function(e,n){t.opts.disabledExtensions.indexOf(s.name)>-1||(i.prototype[e]?(i._extended[e]=i._extended[e]||[],i._extended[e].push({name:s.name,fn:n})):i.prototype[e]=n)})})},i.prototype._inject=function(e){var t=[].slice.call(arguments,1);if("function"==typeof e)return e.call(this);var s=this;i._extended[e]&&$.each(i._extended[e],function(e,i){i.fn.apply(s,t)})},i.prototype._init=$.noop,i.prototype[t.name]=function(t){if(!t)return this;try{return this[t].apply(this,e.slice.call(arguments,1))}catch(i){}},$.extend(i.prototype,t.methods),$.fn[t.name]=function(){var s,n=e.slice.call(arguments),a="string"==typeof n[0]&&n[0].split(":"),o=a[a.length>1?1:0],r=a.length>1&&a[0],l="object"==typeof n[0]&&n[0],d=n.slice(1);return r&&(o=r+o.substr(0,1).toUpperCase()+o.substr(1,o.length-1)),this.each(function(){var e=$.data(this,t.name);return e?s=e[t.name].apply(e,[o].concat(d)):$.data(this,t.name,new i(this,l))}),r?s:this}}}()},{}],13:[function(e,t){t.exports={_init:function(){var e=this;this.$form=$(this.el),this.$fields=$(),this.$inputs=$(),this._extend($.idealforms.extensions),this._i18n(),this._inject("_init"),this._addMarkupRules(),this.addRules(this.opts.rules||{}),this.$form.submit(function(t){e._validateAll(),e.focusFirstInvalid(),e.opts.onSubmit.call(e,e.getInvalid().length,t)}),this.opts.silentLoad||setTimeout($.proxy(this.focusFirstInvalid,this),1)},_addMarkupRules:function(){var e={};this.$form.find("input, select, textarea").each(function(){var t=$(this).data("idealforms-rules");t&&!e[this.name]&&(e[this.name]=t)}),this.addRules(e)},_i18n:function(){var e=this;$.each($.idealforms.i18n,function(t,i){var s=i.errors,n={};delete i.errors;for(var a in i)n[a]={i18n:i[a]};$.extend($.idealforms.errors,s),$.extend(!0,e.opts,n)})},_buildField:function(e){var t,i=this._getField(e);t=$(this.opts.iconHtml,{"class":this.opts.iconClass,click:function(){$(e).focus()}}),this.$fields.filter(i).length||(this.$fields=this.$fields.add(i),this.opts.iconHtml&&i.append(t),i.addClass("idealforms-field idealforms-field-"+e.type)),this._addEvents(e),this._inject("_buildField",e)},_addEvents:function(e){var t=this,i=this._getField(e);$(e).on("change keyup",function(e){9!=e.which&&16!=e.which&&t._validate(this,!0,!0)}).focus(function(){t.isValid(this.name)||i.find(t.opts.error).show()}).blur(function(){i.find(t.opts.error).hide()})},_isRequired:function(e){return $(e).is(":checkbox, :radio, select")?!0:this.opts.rules[e.name].indexOf("required")>-1},_getRelated:function(e){return this._getField(e).find('[name="'+e.name+'"]')},_getField:function(e){return $(e).closest(this.opts.field)},_getFirstInvalid:function(){return this.getInvalid().first().find("input:first, textarea, select")},_handleError:function(e,t,i){i=i||this.isValid(e.name);var s=this._getField(e).find(this.opts.error);this.$form.find(this.opts.error).hide(),t&&s.text(t),s.toggle(!i)},_handleStyle:function(e,t){t=t||this.isValid(e.name),this._getField(e).removeClass(this.opts.validClass+" "+this.opts.invalidClass).addClass(t?this.opts.validClass:this.opts.invalidClass).find("."+this.opts.iconClass).show()},_fresh:function(e){this._getField(e).removeClass(this.opts.validClass+" "+this.opts.invalidClass).find(this.opts.error).hide().end().find("."+this.opts.iconClass).toggle(this._isRequired(e))},_validate:function(e,t,i){var s,n=this,a=this._getField(e),o=this.opts.rules[e.name].split($.idealforms.ruleSeparator),r=a.data("idealforms-value"),l=!0;return $(e).is(":checkbox, :radio")||r!=e.value?(a.data("idealforms-value",e.value),e.value||this._isRequired(e)?$.each(o,function(o,r){r=r.split($.idealforms.argSeparator),s=r[0];var d,u=$.idealforms.rules[s],c=r.slice(1);return d=$.idealforms._format.apply(null,[$.idealforms._getKey("errors."+e.name+"."+s,n.opts)||$.idealforms.errors[s]].concat(c)),l="function"==typeof u?u.apply(n,[e,e.value].concat(c)):u.test(e.value),a.data("idealforms-valid",l),t&&n._handleError(e,d,l),i&&n._handleStyle(e,l),n.opts.onValidate.call(n,e,s,l),l}):(a.removeData("idealforms-valid"),this._fresh(e)),this._inject("_validate",e,s,l),l):a.data("idealforms-valid")},_validateAll:function(){var e=this;this.$inputs.each(function(){e._validate(this,!0)})}}},{}],14:[function(e,t){t.exports={addRules:function(e){var t=this,i=this.$form.find($.map(e,function(e,t){return'[name="'+t+'"]'}).join(","));$.extend(this.opts.rules,e),i.each(function(){t._buildField(this)}),this.$inputs=this.$inputs.add(i),this._validateAll(),this.$fields.find(this.opts.error).hide(),this._inject("addRules")},getInvalid:function(){return this.$fields.filter(function(){return $(this).data("idealforms-valid")===!1})},focusFirstInvalid:function(){var e=this._getFirstInvalid()[0];e&&(this._handleError(e),this._handleStyle(e),this._inject("focusFirstInvalid",e),$(e).focus())},isValid:function(e){return e?!this.getInvalid().find('[name="'+e+'"]').length:!this.getInvalid().length},reset:function(e){var t=this,i=this.$inputs;e&&(i=i.filter('[name="'+e+'"]')),i.filter("input:not(:checkbox, :radio)").val(""),i.filter(":checkbox, :radio").prop("checked",!1),i.filter("select").find("option").prop("selected",function(){return this.defaultSelected}),i.change().each(function(){t._fresh(this)}),this._inject("reset",e)}}},{}],15:[function(e,t){t.exports={required:/.+/,digits:/^\d+$/,email:/^[^@]+@[^@]+\..{2,6}$/,username:/^[a-z](?=[\w.]{3,31}$)\w*\.?\w*$/i,pass:/(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}/,strongpass:/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/,phone:/^[2-9]\d{2}-\d{3}-\d{4}$/,zip:/^\d{5}$|^\d{5}-\d{4}$/,url:/^(?:(ftp|http|https):\/\/)?(?:[\w\-]+\.)+[a-z]{2,6}([\:\/?#].*)?$/i,number:function(e,t){return!isNaN(t)},range:function(e,t,i,s){return Number(t)>=min&&Number(t)<=s},min:function(e,t,i){return t.length>=i},max:function(e,t,i){return t.length<=i},minoption:function(e,t,i){return this._getRelated(e).filter(":checked").length>=i},maxoption:function(e,t,i){return this._getRelated(e).filter(":checked").length<=i},minmax:function(e,t,i,s){return t.length>=i&&t.length<=s},select:function(e,t,i){return t!=i},extension:function(e){var t=[].slice.call(arguments,1),i=!1;return $.each(e.files||[{name:e.value}],function(e,s){i=$.inArray(s.name.split(".").pop().toLowerCase(),t)>-1}),i},equalto:function(e,t,i){var s=this,n=$('[name="'+i+'"]');return this.getInvalid().find(n).length?!1:(n.off("keyup.equalto").on("keyup.equalto",function(){s._getField(e).removeData("idealforms-value"),s._validate(e,!1,!0)}),e.value==n.val())},date:function(e,t,i){function s(e,t){for(var i,s,n,a=0,o=t.length;o>a;a++)/m/.test(t[a])&&(i=e[a]),/d/.test(t[a])&&(s=e[a]),/y/.test(t[a])&&(n=e[a]);return i&&s&&n?i>0&&13>i&&n&&4==n.length&&s>0&&s<=new Date(n,i,0).getDate():!1}i=i||"mm/dd/yyyy";var n=/[^mdy]/.exec(i)[0],a=i.split(n),o=t.split(n);return s(o,a)}}},{}]},{},[11]); \ No newline at end of file +!function(t){var i={};i.name="idealforms",i.defaults={field:".field",error:".error",iconHtml:"",iconClass:"icon",invalidClass:"invalid",validClass:"valid",silentLoad:!0,onValidate:t.noop,onSubmit:t.noop},i.global={_format:function(e){var t=[].slice.call(arguments,1);return e.replace(/\{(\d)\}/g,function(e,i){return t[+i]||""}).replace(/\{\*([^*}]*)\}/g,function(e,i){return t.join(i||", ")})},_getKey:function(e,t){return e.split(".").reduce(function(e,t){return e&&e[t]},t)},i18n:{},ruleSeparator:" ",argSeparator:":",rules:e("./rules"),errors:e("./errors"),extensions:[e("./extensions/dynamic-fields/dynamic-fields.ext"),e("./extensions/ajax/ajax.ext"),e("./extensions/steps/steps.ext"),e("./extensions/custom-inputs/custom-inputs.ext"),e("./extensions/datepicker/datepicker.ext"),e("./extensions/adaptive/adaptive.ext")]},i.methods=t.extend({},e("./private"),e("./public")),e("./plugin")(i)}(jQuery,window,document)},{"./errors":1,"./extensions/adaptive/adaptive.ext":2,"./extensions/ajax/ajax.ext":3,"./extensions/custom-inputs/custom-inputs.ext":4,"./extensions/datepicker/datepicker.ext":7,"./extensions/dynamic-fields/dynamic-fields.ext":8,"./extensions/steps/steps.ext":10,"./plugin":12,"./private":13,"./public":14,"./rules":15}],12:[function(e,t){t.exports=function(){var e=Array.prototype;return function(t){function i(e,i){this.opts=$.extend({},t.defaults,i),this.el=e,this._name=t.name,this._init()}t=$.extend(!0,{name:"plugin",defaults:{disabledExtensions:"none"},methods:{},global:{}},t),$[t.name]=$.extend({addExtension:function(e){t.global.extensions.push(e)}},t.global),i._extended={},i.prototype._hasExtension=function(e){var i=this;return t.global.extensions.filter(function(t){return t.name==e&&i.opts.disabledExtensions.indexOf(t.name)<0}).length},i.prototype._extend=function(e){var t=this;$.each(e,function(e,s){$.extend(t.opts,$.extend(!0,s.options,t.opts)),$.each(s.methods,function(e,n){t.opts.disabledExtensions.indexOf(s.name)>-1||(i.prototype[e]?(i._extended[e]=i._extended[e]||[],i._extended[e].push({name:s.name,fn:n})):i.prototype[e]=n)})})},i.prototype._inject=function(e){var t=[].slice.call(arguments,1);if("function"==typeof e)return e.call(this);var s=this;i._extended[e]&&$.each(i._extended[e],function(e,i){i.fn.apply(s,t)})},i.prototype._init=$.noop,i.prototype[t.name]=function(t){if(!t)return this;try{return this[t].apply(this,e.slice.call(arguments,1))}catch(i){}},$.extend(i.prototype,t.methods),$.fn[t.name]=function(){var s,n=e.slice.call(arguments),a="string"==typeof n[0]&&n[0].split(":"),o=a[a.length>1?1:0],r=a.length>1&&a[0],l="object"==typeof n[0]&&n[0],d=n.slice(1);return r&&(o=r+o.substr(0,1).toUpperCase()+o.substr(1,o.length-1)),this.each(function(){var e=$.data(this,t.name);return e?s=e[t.name].apply(e,[o].concat(d)):$.data(this,t.name,new i(this,l))}),r?s:this}}}()},{}],13:[function(e,t){t.exports={_init:function(){var e=this;this.$form=$(this.el),this.$fields=$(),this.$inputs=$(),this._extend($.idealforms.extensions),this._i18n(),this._inject("_init"),this._addMarkupRules(),this.addRules(this.opts.rules||{}),this.$form.submit(function(t){e._validateAll(),e.focusFirstInvalid(),e.opts.onSubmit.call(e,e.getInvalid().length,t)}),this.opts.silentLoad||setTimeout($.proxy(this.focusFirstInvalid,this),1)},_addMarkupRules:function(){var e={};this.$form.find("input, select, textarea").each(function(){var t=$(this).data("idealforms-rules");t&&!e[this.name]&&(e[this.name]=t)}),this.addRules(e)},_i18n:function(){var e=this;$.each($.idealforms.i18n,function(t,i){var s=i.errors,n={};delete i.errors;for(var a in i)n[a]={i18n:i[a]};$.extend($.idealforms.errors,s),$.extend(!0,e.opts,n)})},_buildField:function(e){var t,i=this._getField(e);t=$(this.opts.iconHtml,{"class":this.opts.iconClass,click:function(){$(e).focus()}}),this.$fields.filter(i).length||(this.$fields=this.$fields.add(i),this.opts.iconHtml&&i.append(t),i.addClass("idealforms-field idealforms-field-"+e.type)),this._addEvents(e),this._inject("_buildField",e)},_addEvents:function(e){var t=this,i=this._getField(e);$(e).on("change keyup",function(e){9!=e.which&&16!=e.which&&t._validate(this,!0,!0)}).focus(function(){t.isValid(this.name)||i.find(t.opts.error).show()}).blur(function(){i.find(t.opts.error).hide()})},_isRequired:function(e){return $(e).is(":checkbox, :radio, select")?!0:this.opts.rules[e.name].indexOf("required")>-1},_getRelated:function(e){return this._getField(e).find('[name="'+e.name+'"]')},_getField:function(e){return $(e).closest(this.opts.field)},_getFirstInvalid:function(){return this.getInvalid().first().find("input:first, textarea, select")},_handleError:function(e,t,i){i=i||this.isValid(e.name);var s=this._getField(e).find(this.opts.error);this.$form.find(this.opts.error).hide(),t&&s.text(t),s.toggle(!i)},_handleStyle:function(e,t){t=t||this.isValid(e.name),this._getField(e).removeClass(this.opts.validClass+" "+this.opts.invalidClass).addClass(t?this.opts.validClass:this.opts.invalidClass).find("."+this.opts.iconClass).show()},_fresh:function(e){this._getField(e).removeClass(this.opts.validClass+" "+this.opts.invalidClass).find(this.opts.error).hide().end().find("."+this.opts.iconClass).toggle(this._isRequired(e))},_validate:function(e,t,i){var s,n=this,a=this._getField(e),o=this.opts.rules[e.name].split($.idealforms.ruleSeparator),r=a.data("idealforms-value"),l=!0;return $(e).is(":checkbox, :radio")||r!=e.value?(a.data("idealforms-value",e.value),e.value||this._isRequired(e)?$.each(o,function(o,r){r=r.split($.idealforms.argSeparator),s=r[0];var d,u=$.idealforms.rules[s],c=r.slice(1);return d=$.idealforms._format.apply(null,[$.idealforms._getKey("errors."+e.name+"."+s,n.opts)||$.idealforms.errors[s]].concat(c)),l="function"==typeof u?u.apply(n,[e,e.value].concat(c)):u.test(e.value),a.data("idealforms-valid",l),t&&n._handleError(e,d,l),i&&n._handleStyle(e,l),n.opts.onValidate.call(n,e,s,l),l}):(a.removeData("idealforms-valid"),this._fresh(e)),this._inject("_validate",e,s,l),l):a.data("idealforms-valid")},_validateAll:function(){var e=this;this.$inputs.each(function(){e._validate(this,!0)})}}},{}],14:[function(e,t){t.exports={addRules:function(e){var t=this,i=this.$form.find($.map(e,function(e,t){return'[name="'+t+'"]'}).join(","));$.extend(this.opts.rules,e),i.each(function(){t._buildField(this)}),this.$inputs=this.$inputs.add(i),this._validateAll(),this.$fields.find(this.opts.error).hide(),this._inject("addRules")},getInvalid:function(){return this.$fields.filter(function(){return $(this).data("idealforms-valid")===!1})},focusFirstInvalid:function(){var e=this._getFirstInvalid()[0];e&&(this._handleError(e),this._handleStyle(e),this._inject("focusFirstInvalid",e),$(e).focus())},isValid:function(e){return e?!this.getInvalid().find('[name="'+e+'"]').length:!this.getInvalid().length},reset:function(e){var t=this,i=this.$inputs;e&&(i=i.filter('[name="'+e+'"]')),i.filter("input:not(:checkbox, :radio)").val(""),i.filter(":checkbox, :radio").prop("checked",!1),i.filter("select").find("option").prop("selected",function(){return this.defaultSelected}),i.change().each(function(){t._fresh(this)}),this._inject("reset",e)}}},{}],15:[function(e,t){t.exports={required:/.+/,digits:/^\d+$/,email:/^[^@]+@[^@]+\..{2,6}$/,username:/^[a-z](?=[\w.]{3,31}$)\w*\.?\w*$/i,pass:/(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}/,strongpass:/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/,phone:/^[2-9]\d{2}-\d{3}-\d{4}$/,zip:/^\d{5}$|^\d{5}-\d{4}$/,url:/^(?:(ftp|http|https):\/\/)?(?:[\w\-]+\.)+[a-z]{2,6}([\:\/?#].*)?$/i,number:function(e,t){return!isNaN(t)},range:function(e,t,i,s){return Number(t)>=i&&Number(t)<=s},min:function(e,t,i){return t.length>=i},max:function(e,t,i){return t.length<=i},minoption:function(e,t,i){return this._getRelated(e).filter(":checked").length>=i},maxoption:function(e,t,i){return this._getRelated(e).filter(":checked").length<=i},minmax:function(e,t,i,s){return t.length>=i&&t.length<=s},select:function(e,t,i){return t!=i},extension:function(e){var t=[].slice.call(arguments,1),i=!1;return $.each(e.files||[{name:e.value}],function(e,s){i=$.inArray(s.name.split(".").pop().toLowerCase(),t)>-1}),i},equalto:function(e,t,i){var s=this,n=$('[name="'+i+'"]');return this.getInvalid().find(n).length?!1:(n.off("keyup.equalto").on("keyup.equalto",function(){s._getField(e).removeData("idealforms-value"),s._validate(e,!1,!0)}),e.value==n.val())},date:function(e,t,i){function s(e,t){for(var i,s,n,a=0,o=t.length;o>a;a++)/m/.test(t[a])&&(i=e[a]),/d/.test(t[a])&&(s=e[a]),/y/.test(t[a])&&(n=e[a]);return i&&s&&n?i>0&&13>i&&n&&4==n.length&&s>0&&s<=new Date(n,i,0).getDate():!1}i=i||"mm/dd/yyyy";var n=/[^mdy]/.exec(i)[0],a=i.split(n),o=t.split(n);return s(o,a)}}},{}]},{},[11]); \ No newline at end of file