diff --git a/dist/jquery.bvalidator.js b/dist/jquery.bvalidator.js index 0041f75..33a9f5e 100644 --- a/dist/jquery.bvalidator.js +++ b/dist/jquery.bvalidator.js @@ -229,6 +229,7 @@ var bValidator = (function ($) { var actionData = postInputs[postName].actionData; var ajaxValidationResult; var errorMsg = []; + var ajaxCache; // input value after ajax request var inputValue = $input.val(); @@ -237,6 +238,11 @@ var bValidator = (function ($) { if (inputValue != postInputs[postName].inputValue) continue; + if (fn.options.ajaxCache) { + ajaxCache = $input.data('ajaxCache' + fn.dataNamespace); + ajaxCache.lastMessage = null; + } + // default ajax validation function has some additional arguments actionData.params = [ajaxResponse, postName].concat(actionData.params) @@ -260,7 +266,6 @@ var bValidator = (function ($) { // save last message to cache if (fn.options.ajaxCache) { - var ajaxCache = $input.data('ajaxCache' + fn.dataNamespace); ajaxCache.lastMessage = errorMsg; } } @@ -1538,15 +1543,21 @@ bValidator.validators = (function ($) { var validationResult; - // check if response from server is JSON - try { - var results = $.parseJSON(ajaxResponse); - if (results[postName]) - validationResult = results[postName]; + if (typeof ajaxResponse === 'object'){ + if (postName in ajaxResponse) + validationResult = ajaxResponse[postName]; } - // ajaxResponse is not json - catch (err) { - validationResult = ajaxResponse; + else { + // check if response from server is JSON + try { + var results = $.parseJSON(ajaxResponse); + if (postName in results) + validationResult = results[postName]; + } + // ajaxResponse is not json + catch (err) { + validationResult = ajaxResponse; + } } return validationResult diff --git a/dist/jquery.bvalidator.min.js b/dist/jquery.bvalidator.min.js index 18beceb..afbc423 100644 --- a/dist/jquery.bvalidator.min.js +++ b/dist/jquery.bvalidator.min.js @@ -1,2 +1,2 @@ -var bValidator=function(a){"use strict";var b=function(b,c,d){var e=b.data("bValidators");e||(e={},b.data("bValidators",e)),d=d?d.toLowerCase():"bvalidator",b.data("bValidator")||b.data("bValidator",this),e[d]=this;var f=function(){};f.prototype=bValidator.fn,this.fn=new f,this.fn.validators=bValidator.validators,this.fn.modifiers=bValidator.modifiers,this.fn.options=a.extend(!0,{},bValidator.defaultOptions,this.fn.getAttrOptions(b,d+bValidator.defaultOptions.dataOptionNamespace),c),this.fn.instance=this,this.fn.dataNamespace=this.fn.getDataNamespace(d),this.fn.eventNamespace=this.fn.dataNamespace,this.fn.eventFormNamespace=this.fn.eventNamespace+"form",this.fn.$mainElement=b,this.fn.instanceName=d,this.fn.dataAttrPrefix="data-"+d,this.fn.options.validateOn&&this.fn.bindValidateOn(this.fn.getElementsForValidation(b)),b.is("form")&&this.fn.bindToForm(b)};return b.fn={bindToForm:function(b){var c=this;c.options.validateOnSubmit&&b.on("submit"+c.eventFormNamespace,function(d){var e=!0;if(!c.bValidatorSkip){if(b.trigger(a.Event("beforeFormValidation"+c.eventNamespace,{bValidator:{instance:c.instance}})),e=c.validate(!1,!1,d,"scroll"),"withAjax"==e)return d.stopImmediatePropagation(),!1;!e&&c.options.stopSubmitPropagation&&d.stopImmediatePropagation()}return c.bValidatorSkip=!1,b.trigger(a.Event("afterFormValidation"+c.eventNamespace,{bValidator:{instance:c.instance,validationResult:e}})),e}),b.on("reset"+c.eventFormNamespace,function(){c.instance.reset()}),c.options.html5ValidationOff&&b.attr("novalidate","novalidate")},getDataNamespace:function(a){return"."+a},serverValidate:function(b,c,d,e,f){for(var g,h={},i=this,j=!1,k=0;kb||a(window).scrollTop()+a(window).height()e){var g=f.substring(e);g=g.charAt(0).toLowerCase()+g.substr(1),d[g]=c[f]}return d},getThemeOptions:function(b){var c=this.getThemeName(b);return this.options.themes[c].dataOptionNamespace?a.extend({},this.options.themes[c],this.getAttrOptions(this.$mainElement,this.options.themes[c].dataOptionNamespace),this.getAttrOptions(b,this.options.themes[c].dataOptionNamespace)):a.extend({},this.options.themes[c])},getThemeName:function(a){var b;return b=a.attr(this.dataAttrPrefix+this.options.setThemeAttr),b||(b=this.$mainElement.attr(this.dataAttrPrefix+this.options.setThemeAttr),b||(b=this.options.useTheme,b||this.throwException("useTheme option not set"))),this.options.themes[b]||this.throwException("no options for theme: "+b),b},makeInstance:function(a){if("undefined"==typeof a.data("bValidators")){var b=a.attr("data-bvalidator-validate");if(b){b=b.split(",");for(var c=0;c=parseInt(b)},maxlen:function(a,b){return a.length<=parseInt(b)},rangelen:function(a,b,c){return a.length>=parseInt(b)&&a.length<=parseInt(c)},equal:function(b,c){return b==a("#"+c).val()},differ:function(b,c){return b!=a("#"+c).val()},min:function(a,b){return this.number(a)?parseFloat(a)>=parseFloat(b):!1},max:function(a,b){return this.number(a)?parseFloat(a)<=parseFloat(b):!1},between:function(a,b,c){if(!this.number(a))return!1;var d=parseFloat(a);return d>=parseFloat(b)&&d<=parseFloat(c)},required:function(b){return b&&a.trim(b)?!0:!1},pattern:function(a,b,c){return"string"==typeof b&&(b=new RegExp(b,c)),b.test(a)},alpha:function(a){return this.pattern(a,/^[a-z ._\-]+$/i)},alphanum:function(a){return this.pattern(a,/^[a-z\d ._\-]+$/i)},digit:function(a){return this.pattern(a,/^\d+$/)},number:function(a){return this.pattern(a,/^[-+]?\d+(\.\d+)?$/)},email:function(a){return this.pattern(a,/^([a-zA-Z\d_\.\-\+%])+\@(([a-zA-Z\d\-])+\.)+([a-zA-Z\d])+$/)},url:function(a){return this.pattern(a,/^\b(https?|ftp):\/\/([-A-Z0-9.]+)(\/[-A-Z0-9+&@#\/%=~_|!:,.;]*)?(\?[A-Z0-9+&@#\/%=~_|!:,.;]*)?$/i)},ip4:function(a){return this.pattern(a,/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/)},ip6:function(a){return this.pattern(a,/^(?:(?:(?:[A-F\d]{1,4}:){5}[A-F\d]{1,4}|(?:[A-F\d]{1,4}:){4}:[A-F\d]{1,4}|(?:[A-F\d]{1,4}:){3}(?::[A-F\d]{1,4}){1,2}|(?:[A-F\d]{1,4}:){2}(?::[A-F\d]{1,4}){1,3}|[A-F\d]{1,4}:(?::[A-F\d]{1,4}){1,4}|(?:[A-F\d]{1,4}:){1,5}|:(?::[A-F\d]{1,4}){1,5}|:):(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[A-F\d]{1,4}:){7}[A-F\d]{1,4}|(?:[A-F\d]{1,4}:){6}:[A-F\d]{1,4}|(?:[A-F\d]{1,4}:){5}(?::[A-F\d]{1,4}){1,2}|(?:[A-F\d]{1,4}:){4}(?::[A-F\d]{1,4}){1,3}|(?:[A-F\d]{1,4}:){3}(?::[A-F\d]{1,4}){1,4}|(?:[A-F\d]{1,4}:){2}(?::[A-F\d]{1,4}){1,5}|[A-F\d]{1,4}:(?::[A-F\d]{1,4}){1,6}|(?:[A-F\d]{1,4}:){1,7}:|:(?::[A-F\d]{1,4}){1,7})$/i)},date:function(a,b){if(10==a.length&&10==b.length){var c=b.match(/[^mdy]+/g);if(2==c.length&&1==c[0].length&&c[0]==c[1]){for(var d,e,f,g=a.split(c[0]),h=b.split(c[0]),i=0;3>i;i++)"dd"==h[i]?d=g[i]:"mm"==h[i]?e=g[i]:"yyyy"==h[i]&&(f=g[i]);var j=new Date(f,e-1,d);return j.getMonth()+1!=e||j.getDate()!=d||j.getFullYear()!=f?!1:!0}}return!1},extension:function(a){var b="";if(!arguments[1])return!1;for(var c=1;ct||y(window).scrollTop()+y(window).height()i){var s=r.substring(i);n[s=s.charAt(0).toLowerCase()+s.substr(1)]=a[r]}return n},getThemeOptions:function(t){var e=this.getThemeName(t);return this.options.themes[e].dataOptionNamespace?y.extend({},this.options.themes[e],this.getAttrOptions(this.$mainElement,this.options.themes[e].dataOptionNamespace),this.getAttrOptions(t,this.options.themes[e].dataOptionNamespace)):y.extend({},this.options.themes[e])},getThemeName:function(t){var e;return(e=(e=t.attr(this.dataAttrPrefix+this.options.setThemeAttr))||((e=this.$mainElement.attr(this.dataAttrPrefix+this.options.setThemeAttr))||this.options.useTheme))||this.throwException("useTheme option not set"),this.options.themes[e]||this.throwException("no options for theme: "+e),e},makeInstance:function(t){if(void 0===t.data("bValidators")){var e=t.attr("data-bvalidator-validate");if(e){e=e.split(",");for(var a=0;a=parseInt(e)},maxlen:function(t,e){return t.length<=parseInt(e)},rangelen:function(t,e,a){return t.length>=parseInt(e)&&t.length<=parseInt(a)},equal:function(t,e){return t==r("#"+e).val()},differ:function(t,e){return t!=r("#"+e).val()},min:function(t,e){return!!this.number(t)&&parseFloat(t)>=parseFloat(e)},max:function(t,e){return!!this.number(t)&&parseFloat(t)<=parseFloat(e)},between:function(t,e,a){if(!this.number(t))return!1;var n=parseFloat(t);return n>=parseFloat(e)&&n<=parseFloat(a)},required:function(t){return!(!t||!r.trim(t))},pattern:function(t,e,a){return"string"==typeof e&&(e=new RegExp(e,a)),e.test(t)},alpha:function(t){return this.pattern(t,/^[a-z ._\-]+$/i)},alphanum:function(t){return this.pattern(t,/^[a-z\d ._\-]+$/i)},digit:function(t){return this.pattern(t,/^\d+$/)},number:function(t){return this.pattern(t,/^[-+]?\d+(\.\d+)?$/)},email:function(t){return this.pattern(t,/^([a-zA-Z\d_\.\-\+%])+\@(([a-zA-Z\d\-])+\.)+([a-zA-Z\d])+$/)},url:function(t){return this.pattern(t,/^\b(https?|ftp):\/\/([-A-Z0-9.]+)(\/[-A-Z0-9+&@#\/%=~_|!:,.;]*)?(\?[A-Z0-9+&@#\/%=~_|!:,.;]*)?$/i)},ip4:function(t){return this.pattern(t,/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/)},ip6:function(t){return this.pattern(t,/^(?:(?:(?:[A-F\d]{1,4}:){5}[A-F\d]{1,4}|(?:[A-F\d]{1,4}:){4}:[A-F\d]{1,4}|(?:[A-F\d]{1,4}:){3}(?::[A-F\d]{1,4}){1,2}|(?:[A-F\d]{1,4}:){2}(?::[A-F\d]{1,4}){1,3}|[A-F\d]{1,4}:(?::[A-F\d]{1,4}){1,4}|(?:[A-F\d]{1,4}:){1,5}|:(?::[A-F\d]{1,4}){1,5}|:):(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[A-F\d]{1,4}:){7}[A-F\d]{1,4}|(?:[A-F\d]{1,4}:){6}:[A-F\d]{1,4}|(?:[A-F\d]{1,4}:){5}(?::[A-F\d]{1,4}){1,2}|(?:[A-F\d]{1,4}:){4}(?::[A-F\d]{1,4}){1,3}|(?:[A-F\d]{1,4}:){3}(?::[A-F\d]{1,4}){1,4}|(?:[A-F\d]{1,4}:){2}(?::[A-F\d]{1,4}){1,5}|[A-F\d]{1,4}:(?::[A-F\d]{1,4}){1,6}|(?:[A-F\d]{1,4}:){1,7}:|:(?::[A-F\d]{1,4}){1,7})$/i)},date:function(t,e){if(10==t.length&&10==e.length){var a=e.match(/[^mdy]+/g);if(2==a.length&&1==a[0].length&&a[0]==a[1]){for(var n,i,r,s=t.split(a[0]),o=e.split(a[0]),l=0;l<3;l++)"dd"==o[l]?n=s[l]:"mm"==o[l]?i=s[l]:"yyyy"==o[l]&&(r=s[l]);var d=new Date(r,i-1,n);return d.getMonth()+1==i&&d.getDate()==n&&d.getFullYear()==r}}return!1},extension:function(t){var e="";if(!arguments[1])return!1;for(var a=1;a
', viewport : null, trigger : 'manual' diff --git a/dist/themes/bs3/bs3tooltip/bs3tooltip.js b/dist/themes/bs3/bs3tooltip/bs3tooltip.js index 0f5908c..67975ab 100644 --- a/dist/themes/bs3/bs3tooltip/bs3tooltip.js +++ b/dist/themes/bs3/bs3tooltip/bs3tooltip.js @@ -4,10 +4,11 @@ bValidator.defaultOptions.themes.bs3tooltip = { - tooltipOptions : { // see: http://getbootstrap.com/javascript/#tooltips-options - html : 'true', + tooltipOptions : { + html : true, viewport : null, - trigger : 'manual' + trigger : 'manual', + sanitize : false }, placement : 'right', // top | bottom | left | right content : '
{message}
', diff --git a/dist/themes/bslikerc/bslikerc.css b/dist/themes/bslikerc/bslikerc.css index bb0862f..16733ff 100644 --- a/dist/themes/bslikerc/bslikerc.css +++ b/dist/themes/bslikerc/bslikerc.css @@ -12,13 +12,11 @@ padding-right: 20px; font-family: Arial, Helvetica, sans-serif; background-color: #ffffff; - -webkit-background-clip: padding-box; - background-clip: padding-box; + background-clip: padding-box; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); position:absolute; line-height: 20px; } diff --git a/dist/themes/bslikert/bslikert.css b/dist/themes/bslikert/bslikert.css index f03cfcd..0392561 100644 --- a/dist/themes/bslikert/bslikert.css +++ b/dist/themes/bslikert/bslikert.css @@ -12,13 +12,11 @@ padding-right: 20px; font-family: Arial, Helvetica, sans-serif; background-color: #ffffff; - -webkit-background-clip: padding-box; - background-clip: padding-box; + background-clip: padding-box; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); position:absolute; line-height: 20px; } diff --git a/dist/themes/gray/gray.css b/dist/themes/gray/gray.css index ad72337..5d14230 100644 --- a/dist/themes/gray/gray.css +++ b/dist/themes/gray/gray.css @@ -11,8 +11,7 @@ border-radius: 4px; border-bottom-left-radius: 0; border-top-left-radius: 0; - -webkit-box-shadow: 0 0 6px #ddd; - box-shadow: 0 0 6px #ddd; + box-shadow: 0 0 6px #ddd; white-space: nowrap; padding-top: 2px; padding-right: 15px; diff --git a/dist/themes/gray2/gray2.css b/dist/themes/gray2/gray2.css index 382647d..34a761b 100644 --- a/dist/themes/gray2/gray2.css +++ b/dist/themes/gray2/gray2.css @@ -11,8 +11,7 @@ border-radius: 4px; border-bottom-left-radius: 0; border-top-left-radius: 0; - -webkit-box-shadow: 0 0 6px #ddd; - box-shadow: 0 0 6px #ddd; + box-shadow: 0 0 6px #ddd; white-space: nowrap; padding-top: 2px; padding-right: 15px; diff --git a/dist/themes/gray3/gray3.css b/dist/themes/gray3/gray3.css index 10af8fa..45d36fc 100644 --- a/dist/themes/gray3/gray3.css +++ b/dist/themes/gray3/gray3.css @@ -12,12 +12,8 @@ padding-right: 20px; font-family: Arial, Helvetica, sans-serif; border: 1px solid #666666; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5); background: #c6c6c6; /* Old browsers */ - background: -webkit-gradient(linear, left top, left bottom, from(#c6c6c6), to(#3f3f3f)); - background: -webkit-linear-gradient(top, #c6c6c6 0%, #3f3f3f 100%); - background: -o-linear-gradient(top, #c6c6c6 0%, #3f3f3f 100%); background: linear-gradient(to bottom, #c6c6c6 0%,#3f3f3f 100%); color: #FFF; line-height: normal; diff --git a/dist/themes/gray4/gray4.css b/dist/themes/gray4/gray4.css index dfc52eb..2ee8cbe 100644 --- a/dist/themes/gray4/gray4.css +++ b/dist/themes/gray4/gray4.css @@ -12,8 +12,7 @@ border-radius: 4px; border-bottom-left-radius: 0; border-top-left-radius: 0; - -webkit-box-shadow: 0 0 6px #ddd; - box-shadow: 0 0 6px #ddd; + box-shadow: 0 0 6px #ddd; white-space: nowrap; padding-top: 2px; padding-right: 15px; diff --git a/dist/themes/orange/orange.css b/dist/themes/orange/orange.css index 71de2ef..84f9fd7 100644 --- a/dist/themes/orange/orange.css +++ b/dist/themes/orange/orange.css @@ -11,8 +11,7 @@ border-radius: 4px; border-bottom-left-radius: 0; border-top-left-radius: 0; - -webkit-box-shadow: 0 0 6px #ddd; - box-shadow: 0 0 6px #ddd; + box-shadow: 0 0 6px #ddd; white-space: nowrap; padding-top: 2px; padding-right: 15px; diff --git a/dist/themes/postit/postit.css b/dist/themes/postit/postit.css index b0a14e6..2b16c2d 100644 --- a/dist/themes/postit/postit.css +++ b/dist/themes/postit/postit.css @@ -15,8 +15,7 @@ border: 2px solid #100b07; border-radius: 10px; font-family: "Comic Sans MS", "Trebuchet MS", Trebuchet, Arial, Verdana, Sans-serif; - -webkit-box-shadow: 0 0 6px #ddd; - box-shadow: 0 0 6px #ddd; + box-shadow: 0 0 6px #ddd; line-height: normal; position: absolute; } diff --git a/dist/themes/presenters/bs3form.min.js b/dist/themes/presenters/bs3form.min.js index 83fb657..66e2bfc 100644 --- a/dist/themes/presenters/bs3form.min.js +++ b/dist/themes/presenters/bs3form.min.js @@ -1 +1 @@ -bValidator.Bs3FormPresenter=function(a){"use strict";var b=function(a,c){var d=function(){};d.prototype=b.fn,this.fn=new d,this.fn.$input=a,this.fn.validatorInstance=c,this.fn.$msgContainer=null,this.fn.themeOptions=null,this.fn.chkboxOrRadio=null,this.fn.$formGroupElement=null,this.fn.$msgParent=null},c={showInvalid:function(a){this.fn.showInvalid(a)},showValid:function(){this.fn.showValid()},removeAll:function(){this.fn.removeAll()},setOptions:function(a){this.fn.setOptions(a)},isInvalidOn:function(){return this.fn.isInvalidOn()}};return b.prototype=c,b.fn={createMsg:function(b){for(var c="",d=0;d"+b[d]+"";return a(this.themeOptions.template.replace("{message}",c))},showInvalid:function(a){this.removeInvalid(!0),this.validatorInstance&&this.validatorInstance.setScrollTo(this.$input.offset().top),this.getFormGroupElement().addClass(this.themeOptions.formGroupInvalidClass),this.themeOptions.showMessages===!0&&(this.$msgContainer=this.createMsg(a),this.getMsgContainer().append(this.$msgContainer))},getFormGroupElement:function(){if(null!==this.$formGroupElement&&this.$formGroupElement.length)return this.$formGroupElement;var b=null,c=this.themeOptions.formGroup;return b="#"==c[0]?a(c):this.validatorInstance?this.$input.closest(c,this.validatorInstance.fn.$mainElement):this.$input.closest(c),0===b.length&&window.console.warn("[bValidator 'bs3form' theme] missing form-group element"),this.$formGroupElement=b,b},getMsgContainer:function(){if(!this.themeOptions.msgParent)return this.getFormGroupElement();if(null!==this.$msgParent&&this.$msgParent.length)return this.$msgParent;var b=null,c=this.themeOptions.msgParent;return b="#"==c[0]?a(c):this.validatorInstance?this.$input.closest(c,this.validatorInstance.fn.$mainElement):this.$input.closest(c),0===b.length&&(b=this.getFormGroupElement()),this.$msgParent=b,b},showValid:function(){this.removeInvalid(),this.themeOptions.formGroupValidClass&&this.getFormGroupElement().addClass(this.themeOptions.formGroupValidClass)},removeInvalid:function(){null!==this.$msgContainer&&(this.$msgContainer.remove(),this.$msgContainer=null),this.getFormGroupElement().removeClass(this.themeOptions.formGroupInvalidClass)},removeValid:function(){this.getFormGroupElement().removeClass(this.themeOptions.formGroupValidClass)},removeAll:function(){this.removeValid(),this.removeInvalid()},setOptions:function(a){this.themeOptions=a,"checkbox"==this.$input[0].type||"radio"==this.$input[0].type?this.chkboxOrRadio=!0:this.chkboxOrRadio=!1},isInvalidOn:function(){return null!==this.$msgContainer?!0:!1}},b}(jQuery); \ No newline at end of file +bValidator.Bs3FormPresenter=function(e){"use strict";var s=function(t,n){function i(){}i.prototype=s.fn,this.fn=new i,this.fn.$input=t,this.fn.validatorInstance=n,this.fn.$msgContainer=null,this.fn.themeOptions=null,this.fn.chkboxOrRadio=null,this.fn.$formGroupElement=null,this.fn.$msgParent=null};return s.prototype={showInvalid:function(t){this.fn.showInvalid(t)},showValid:function(){this.fn.showValid()},removeAll:function(){this.fn.removeAll()},setOptions:function(t){this.fn.setOptions(t)},isInvalidOn:function(){return this.fn.isInvalidOn()}},s.fn={createMsg:function(t){for(var n="",i=0;i"+t[i]+"";return e(this.themeOptions.template.replace("{message}",n))},showInvalid:function(t){this.removeInvalid(!0),this.validatorInstance&&this.validatorInstance.setScrollTo(this.$input.offset().top),this.getFormGroupElement().addClass(this.themeOptions.formGroupInvalidClass),!0===this.themeOptions.showMessages&&(this.$msgContainer=this.createMsg(t),this.getMsgContainer().append(this.$msgContainer))},getFormGroupElement:function(){if(null!==this.$formGroupElement&&this.$formGroupElement.length)return this.$formGroupElement;var t=null,n=this.themeOptions.formGroup;return 0===(t="#"==n[0]?e(n):this.validatorInstance?this.$input.closest(n,this.validatorInstance.fn.$mainElement):this.$input.closest(n)).length&&window.console.warn("[bValidator 'bs3form' theme] missing form-group element"),this.$formGroupElement=t},getMsgContainer:function(){if(!this.themeOptions.msgParent)return this.getFormGroupElement();if(null!==this.$msgParent&&this.$msgParent.length)return this.$msgParent;var t=null,n=this.themeOptions.msgParent;return 0===(t="#"==n[0]?e(n):this.validatorInstance?this.$input.closest(n,this.validatorInstance.fn.$mainElement):this.$input.closest(n)).length&&(t=this.getFormGroupElement()),this.$msgParent=t},showValid:function(){this.removeInvalid(),this.themeOptions.formGroupValidClass&&this.getFormGroupElement().addClass(this.themeOptions.formGroupValidClass)},removeInvalid:function(){null!==this.$msgContainer&&(this.$msgContainer.remove(),this.$msgContainer=null),this.getFormGroupElement().removeClass(this.themeOptions.formGroupInvalidClass)},removeValid:function(){this.getFormGroupElement().removeClass(this.themeOptions.formGroupValidClass)},removeAll:function(){this.removeValid(),this.removeInvalid()},setOptions:function(t){this.themeOptions=t,"checkbox"==this.$input[0].type||"radio"==this.$input[0].type?this.chkboxOrRadio=!0:this.chkboxOrRadio=!1},isInvalidOn:function(){return null!==this.$msgContainer}},s}(jQuery); \ No newline at end of file diff --git a/dist/themes/presenters/bs3popover-tooltip.js b/dist/themes/presenters/bs3popover-tooltip.js index 4ebe4cf..8e124d5 100644 --- a/dist/themes/presenters/bs3popover-tooltip.js +++ b/dist/themes/presenters/bs3popover-tooltip.js @@ -95,11 +95,11 @@ bValidator.Bs3PopoverTooltipPresenter = (function ($) { // displays message showInvalid : function (messages) { - var tooltipContent = this.getTooltipContent(messages); + var $tooltipContent = this.getTooltipContent(messages); // if popover is already initialized just replace the content if (this.$tooltipContainer) { - this.$input.data('bs.' + this.type).options.content = tooltipContent; + this.$input.data('bs.' + this.type).options.content = $tooltipContent; } // make a new tooltip else { @@ -115,10 +115,10 @@ bValidator.Bs3PopoverTooltipPresenter = (function ($) { } if (this.type == 'tooltip') { - options.title = tooltipContent; + options.title = $tooltipContent; options = $.extend({}, options, this.themeOptions.tooltipOptions); } else { // popover - options.content = tooltipContent; + options.content = $tooltipContent; options = $.extend({}, options, this.themeOptions.popoverOptions); } diff --git a/dist/themes/presenters/bs3popover-tooltip.min.js b/dist/themes/presenters/bs3popover-tooltip.min.js index ece1ea3..2eb1944 100644 --- a/dist/themes/presenters/bs3popover-tooltip.min.js +++ b/dist/themes/presenters/bs3popover-tooltip.min.js @@ -1 +1 @@ -bValidator.Bs3PopoverTooltipPresenter=function(a){"use strict";var b=function(a,c){var d=function(){};d.prototype=b.fn,this.fn=new d,this.fn.$input=a,this.fn.validatorInstance=c,this.fn.$tooltipContainer=null,this.fn.type=null};return b.prototype={removeAll:function(){this.fn.removeInvalid()},isInvalidOn:function(){return this.fn.isInvalidOn()},setOptions:function(a){this.fn.setOptions(a)},showInvalid:function(a){this.fn.showInvalid(a)},showValid:function(){this.fn.removeInvalid()},destroy:function(){this.fn.destroy()}},b.fn={removeInvalid:function(){this.$input[this.type]("hide")},isInvalidOn:function(){return this.$input.data()["bs."+this.type]&&this.$input.data()["bs."+this.type].tip().hasClass("in")?!0:!1},getTooltipContent:function(b){for(var c,d="",e=0;e"+b[e]+"\n";return c=a(this.themeOptions.showClose?this.themeOptions.contentClose.replace("{message}",d):this.themeOptions.content.replace("{message}",d))},setOptions:function(a){this.themeOptions=a,a.popoverOptions?this.type="popover":this.type="tooltip"},destroy:function(){this.$input[this.type]("destroy"),this.$tooltipContainer.detach(),this.$tooltipContainer=null},showInvalid:function(b){var c=this.getTooltipContent(b);if(this.$tooltipContainer)this.$input.data("bs."+this.type).options.content=c;else{this.$tooltipContainer=a('
'),this.$tooltipContainer.insertAfter(this.$input);var d={container:this.$tooltipContainer,placement:this.themeOptions.placement};"tooltip"==this.type?(d.title=c,d=a.extend({},d,this.themeOptions.tooltipOptions)):(d.content=c,d=a.extend({},d,this.themeOptions.popoverOptions)),this.$input[this.type](d)}this.$input[this.type]("show");var e=this.$input.data()["bs."+this.type].tip(),f=this;e.find("button").click(function(){f.removeInvalid()}),this.validatorInstance.setScrollTo(e.offset().top)}},b}(jQuery); \ No newline at end of file +bValidator.Bs3PopoverTooltipPresenter=function(s){"use strict";var o=function(t,i){function n(){}n.prototype=o.fn,this.fn=new n,this.fn.$input=t,this.fn.validatorInstance=i,this.fn.$tooltipContainer=null,this.fn.type=null};return o.prototype={removeAll:function(){this.fn.removeInvalid()},isInvalidOn:function(){return this.fn.isInvalidOn()},setOptions:function(t){this.fn.setOptions(t)},showInvalid:function(t){this.fn.showInvalid(t)},showValid:function(){this.fn.removeInvalid()},destroy:function(){this.fn.destroy()}},o.fn={removeInvalid:function(){this.$input[this.type]("hide")},isInvalidOn:function(){return!(!this.$input.data()["bs."+this.type]||!this.$input.data()["bs."+this.type].tip().hasClass("in"))},getTooltipContent:function(t){for(var i="",n=0;n"+t[n]+"\n";return this.themeOptions.showClose?s(this.themeOptions.contentClose.replace("{message}",i)):s(this.themeOptions.content.replace("{message}",i))},setOptions:function(t){(this.themeOptions=t).popoverOptions?this.type="popover":this.type="tooltip"},destroy:function(){this.$input[this.type]("destroy"),this.$tooltipContainer.detach(),this.$tooltipContainer=null},showInvalid:function(t){var i=this.getTooltipContent(t);if(this.$tooltipContainer)this.$input.data("bs."+this.type).options.content=i;else{this.$tooltipContainer=s('
'),this.$tooltipContainer.insertAfter(this.$input);var n={container:this.$tooltipContainer,placement:this.themeOptions.placement};n="tooltip"==this.type?(n.title=i,s.extend({},n,this.themeOptions.tooltipOptions)):(n.content=i,s.extend({},n,this.themeOptions.popoverOptions)),this.$input[this.type](n)}this.$input[this.type]("show");var o=this.$input.data()["bs."+this.type].tip(),e=this;o.find("button").click(function(){e.removeInvalid()}),this.validatorInstance.setScrollTo(o.offset().top)}},o}(jQuery); \ No newline at end of file diff --git a/dist/themes/presenters/default.min.js b/dist/themes/presenters/default.min.js index 80def9d..95d2e1e 100644 --- a/dist/themes/presenters/default.min.js +++ b/dist/themes/presenters/default.min.js @@ -1 +1 @@ -bValidator.DefaultPresenter=function(a){"use strict";var b=function(a,c){var d=function(){};d.prototype=b.fn,this.fn=new d,this.fn.instance=this,this.fn.$input=a,this.fn.validatorInstance=c,this.fn.$tooltipContainer=null,this.fn.themeOptions=null,this.fn.chkboxOrRadio=null},c={showInvalid:function(a){this.fn.showInvalid(a)},showValid:function(){this.fn.showValid()},removeAll:function(){this.fn.removeAll()},setOptions:function(a){this.fn.setOptions(a)},isInvalidOn:function(){return this.fn.isInvalidOn()}};return b.prototype=c,b.fn={createTooltip:function(b){var c,d=a('
').css({position:"absolute",visibility:"hidden"}),e="",f=this.instance;d.insertAfter(this.$input);for(var g=0;g"+b[g]+"\n";c=a(this.themeOptions.showClose?this.themeOptions.templateClose.replace("{message}",e):this.themeOptions.template.replace("{message}",e)),c.appendTo(d),c.find(this.themeOptions.closeIconSelector).click(function(a){a.preventDefault(),f.fn.removeInvalid(!0)});var h=this.getTooltipPosition(c,d);return c.css({top:h.top,left:h.left}),{$tooltipContainer:d,$tooltip:c}},getTooltipPosition:function(a,b){var c=this.themeOptions.offset.split(","),d=-(b.offset().top-this.$input.offset().top+a.outerHeight()-parseInt(c[1],10)),e=this.$input.offset().left+this.$input.outerWidth()-b.offset().left+parseInt(c[0],10),f=this.themeOptions.position.split(","),g=f[0],h=f[1];if("center"==h||"bottom"==h){var i=a.outerHeight()+this.$input.outerHeight();"center"==h&&(d+=i/2),"bottom"==h&&(d+=i)}if("center"==g||"left"==g){var j=this.$input.outerWidth();"center"==g&&(e-=j/2),"left"==g&&(e-=j)}return{top:d,left:e}},showInvalid:function(a){this.$tooltipContainer&&this.removeInvalid(!0);var b=this.createTooltip(a);b.$tooltip.css({display:"none"}),b.$tooltipContainer.css({visibility:"visible"}),b.$tooltip.fadeIn(this.themeOptions.msgShowSpeed),this.validatorInstance&&this.validatorInstance.setScrollTo(b.$tooltip.offset().top),this.$tooltipContainer=b.$tooltipContainer,!this.chkboxOrRadio&&this.themeOptions.invalidClass&&this.$input.addClass(this.themeOptions.invalidClass)},showValid:function(){this.$tooltipContainer&&this.removeInvalid(),!this.chkboxOrRadio&&this.themeOptions.validClass&&this.$input.addClass(this.themeOptions.validClass)},removeInvalid:function(a){null!==this.$tooltipContainer&&(this.$tooltipContainer.remove(),this.$tooltipContainer=null),!a&&this.themeOptions&&this.themeOptions.invalidClass&&this.$input.removeClass(this.themeOptions.invalidClass)},removeValid:function(){!this.chkboxOrRadio&&this.themeOptions&&this.themeOptions.invalidClass&&this.$input.removeClass(this.themeOptions.validClass)},removeAll:function(){this.removeValid(),this.removeInvalid()},setOptions:function(a){this.themeOptions=a,"checkbox"==this.$input[0].type||"radio"==this.$input[0].type?this.chkboxOrRadio=!0:this.chkboxOrRadio=!1},isInvalidOn:function(){return null!==this.$tooltipContainer?!0:!1}},b}(jQuery); \ No newline at end of file +bValidator.DefaultPresenter=function(h){"use strict";var n=function(t,i){function o(){}o.prototype=n.fn,this.fn=new o,(this.fn.instance=this).fn.$input=t,this.fn.validatorInstance=i,this.fn.$tooltipContainer=null,this.fn.themeOptions=null,this.fn.chkboxOrRadio=null};return n.prototype={showInvalid:function(t){this.fn.showInvalid(t)},showValid:function(){this.fn.showValid()},removeAll:function(){this.fn.removeAll()},setOptions:function(t){this.fn.setOptions(t)},isInvalidOn:function(){return this.fn.isInvalidOn()}},n.fn={createTooltip:function(t){var i,o=h('
').css({position:"absolute",visibility:"hidden"}),n="",e=this.instance;o.insertAfter(this.$input);for(var s=0;s"+t[s]+"\n";(i=this.themeOptions.showClose?h(this.themeOptions.templateClose.replace("{message}",n)):h(this.themeOptions.template.replace("{message}",n))).appendTo(o),i.find(this.themeOptions.closeIconSelector).click(function(t){t.preventDefault(),e.fn.removeInvalid(!0)});var l=this.getTooltipPosition(i,o);return i.css({top:l.top,left:l.left}),{$tooltipContainer:o,$tooltip:i}},getTooltipPosition:function(t,i){var o=this.themeOptions.offset.split(","),n=-(i.offset().top-this.$input.offset().top+t.outerHeight()-parseInt(o[1],10)),e=this.$input.offset().left+this.$input.outerWidth()-i.offset().left+parseInt(o[0],10),s=this.themeOptions.position.split(","),l=s[0],h=s[1];if("center"==h||"bottom"==h){var a=t.outerHeight()+this.$input.outerHeight();"center"==h&&(n+=a/2),"bottom"==h&&(n+=a)}if("center"==l||"left"==l){var r=this.$input.outerWidth();"center"==l&&(e-=r/2),"left"==l&&(e-=r)}return{top:n,left:e}},showInvalid:function(t){this.$tooltipContainer&&this.removeInvalid(!0);var i=this.createTooltip(t);i.$tooltip.css({display:"none"}),i.$tooltipContainer.css({visibility:"visible"}),i.$tooltip.fadeIn(this.themeOptions.msgShowSpeed),this.validatorInstance&&this.validatorInstance.setScrollTo(i.$tooltip.offset().top),this.$tooltipContainer=i.$tooltipContainer,!this.chkboxOrRadio&&this.themeOptions.invalidClass&&this.$input.addClass(this.themeOptions.invalidClass)},showValid:function(){this.$tooltipContainer&&this.removeInvalid(),!this.chkboxOrRadio&&this.themeOptions.validClass&&this.$input.addClass(this.themeOptions.validClass)},removeInvalid:function(t){null!==this.$tooltipContainer&&(this.$tooltipContainer.remove(),this.$tooltipContainer=null),!t&&this.themeOptions&&this.themeOptions.invalidClass&&this.$input.removeClass(this.themeOptions.invalidClass)},removeValid:function(){!this.chkboxOrRadio&&this.themeOptions&&this.themeOptions.invalidClass&&this.$input.removeClass(this.themeOptions.validClass)},removeAll:function(){this.removeValid(),this.removeInvalid()},setOptions:function(t){this.themeOptions=t,"checkbox"==this.$input[0].type||"radio"==this.$input[0].type?this.chkboxOrRadio=!0:this.chkboxOrRadio=!1},isInvalidOn:function(){return null!==this.$tooltipContainer}},n}(jQuery); \ No newline at end of file diff --git a/dist/themes/presenters/group.min.js b/dist/themes/presenters/group.min.js index 2d7b215..b137ae7 100644 --- a/dist/themes/presenters/group.min.js +++ b/dist/themes/presenters/group.min.js @@ -1 +1 @@ -bValidator.GroupPresenter=function(a){"use strict";var b=function(a,c){var d=function(){};d.prototype=b.fn,this.fn=new d,this.fn.$input=a,this.fn.validatorInstance=c,this.fn.$msgContainer=null,this.fn.themeOptions=null,this.fn.chkboxOrRadio=null},c={showInvalid:function(a){this.fn.showInvalid(a)},showValid:function(){this.fn.showValid()},removeAll:function(){this.fn.removeAll()},setOptions:function(a){this.fn.setOptions(a)},isInvalidOn:function(){return this.fn.isInvalidOn()}};return b.prototype=c,b.fn={makeMsgContainer:function(b){var c=a('
');return b.prepend(c),c},getIntoElement:function(){var a;return this.validatorInstance&&this.validatorInstance.$groupThemeMsg?this.validatorInstance.$groupThemeMsg:("function"==typeof this.themeOptions.makeMsgContainer?a=this.validatorInstance?this.themeOptions.makeMsgContainer(this.validatorInstance.fn.$mainElement,this.$input):this.themeOptions.makeMsgContainer(null,this.$input):this.validatorInstance&&(a=this.makeMsgContainer(this.validatorInstance.fn.$mainElement,this.$input)),this.validatorInstance&&(this.validatorInstance.$groupThemeMsg=a),a)},createMsg:function(b){for(var c="",d=0;d"+b[d]+"\n";var e=a("
"+c+"
\n");return this.getIntoElement().append(e),e},showInvalid:function(a){this.$msgContainer&&this.removeInvalid(!0),this.$msgContainer=this.createMsg(a),this.validatorInstance&&this.validatorInstance.setScrollTo(this.getIntoElement().offset().top),!this.chkboxOrRadio&&this.themeOptions.invalidClass&&this.$input.addClass(this.themeOptions.invalidClass)},showValid:function(){this.$msgContainer&&this.removeInvalid(),!this.chkboxOrRadio&&this.themeOptions.validClass&&this.$input.addClass(this.themeOptions.validClass)},removeInvalid:function(a){null!==this.$msgContainer&&(this.$msgContainer.remove(),this.$msgContainer=null),!a&&this.themeOptions&&this.themeOptions.invalidClass&&this.$input.removeClass(this.themeOptions.invalidClass),this.validatorInstance&&this.validatorInstance.$groupThemeMsg&&(this.validatorInstance.$groupThemeMsg.children().length||(this.validatorInstance.$groupThemeMsg.remove(),this.validatorInstance.$groupThemeMsg=null))},removeValid:function(){!this.chkboxOrRadio&&this.themeOptions&&this.themeOptions.invalidClass&&this.$input.removeClass(this.themeOptions.validClass)},removeAll:function(){this.removeValid(),this.removeInvalid()},setOptions:function(a){this.themeOptions=a,"checkbox"==this.$input[0].type||"radio"==this.$input[0].type?this.chkboxOrRadio=!0:this.chkboxOrRadio=!1},isInvalidOn:function(){return null!==this.$msgContainer?!0:!1}},b}(jQuery); \ No newline at end of file +bValidator.GroupPresenter=function(e){"use strict";var s=function(t,i){function n(){}n.prototype=s.fn,this.fn=new n,this.fn.$input=t,this.fn.validatorInstance=i,this.fn.$msgContainer=null,this.fn.themeOptions=null,this.fn.chkboxOrRadio=null};return s.prototype={showInvalid:function(t){this.fn.showInvalid(t)},showValid:function(){this.fn.showValid()},removeAll:function(){this.fn.removeAll()},setOptions:function(t){this.fn.setOptions(t)},isInvalidOn:function(){return this.fn.isInvalidOn()}},s.fn={makeMsgContainer:function(t){var i=e('
');return t.prepend(i),i},getIntoElement:function(){var t;return this.validatorInstance&&this.validatorInstance.$groupThemeMsg?this.validatorInstance.$groupThemeMsg:("function"==typeof this.themeOptions.makeMsgContainer?t=this.validatorInstance?this.themeOptions.makeMsgContainer(this.validatorInstance.fn.$mainElement,this.$input):this.themeOptions.makeMsgContainer(null,this.$input):this.validatorInstance&&(t=this.makeMsgContainer(this.validatorInstance.fn.$mainElement,this.$input)),this.validatorInstance&&(this.validatorInstance.$groupThemeMsg=t),t)},createMsg:function(t){for(var i="",n=0;n"+t[n]+"\n";var s=e("
"+i+"
\n");return this.getIntoElement().append(s),s},showInvalid:function(t){this.$msgContainer&&this.removeInvalid(!0),this.$msgContainer=this.createMsg(t),this.validatorInstance&&this.validatorInstance.setScrollTo(this.getIntoElement().offset().top),!this.chkboxOrRadio&&this.themeOptions.invalidClass&&this.$input.addClass(this.themeOptions.invalidClass)},showValid:function(){this.$msgContainer&&this.removeInvalid(),!this.chkboxOrRadio&&this.themeOptions.validClass&&this.$input.addClass(this.themeOptions.validClass)},removeInvalid:function(t){null!==this.$msgContainer&&(this.$msgContainer.remove(),this.$msgContainer=null),!t&&this.themeOptions&&this.themeOptions.invalidClass&&this.$input.removeClass(this.themeOptions.invalidClass),this.validatorInstance&&this.validatorInstance.$groupThemeMsg&&(this.validatorInstance.$groupThemeMsg.children().length||(this.validatorInstance.$groupThemeMsg.remove(),this.validatorInstance.$groupThemeMsg=null))},removeValid:function(){!this.chkboxOrRadio&&this.themeOptions&&this.themeOptions.invalidClass&&this.$input.removeClass(this.themeOptions.validClass)},removeAll:function(){this.removeValid(),this.removeInvalid()},setOptions:function(t){this.themeOptions=t,"checkbox"==this.$input[0].type||"radio"==this.$input[0].type?this.chkboxOrRadio=!0:this.chkboxOrRadio=!1},isInvalidOn:function(){return null!==this.$msgContainer}},s}(jQuery); \ No newline at end of file diff --git a/dist/themes/presenters/insert.min.js b/dist/themes/presenters/insert.min.js index 3e1557c..744cd1a 100644 --- a/dist/themes/presenters/insert.min.js +++ b/dist/themes/presenters/insert.min.js @@ -1 +1 @@ -bValidator.InsertPresenter=function(a){"use strict";var b=function(a,c){var d=function(){};d.prototype=b.fn,this.fn=new d,this.fn.$input=a,this.fn.validatorInstance=c,this.fn.$msgContainer=null,this.fn.themeOptions=null,this.fn.chkboxOrRadio=null},c={showInvalid:function(a){this.fn.showInvalid(a)},showValid:function(){this.fn.showValid()},removeAll:function(){this.fn.removeAll()},setOptions:function(a){this.fn.setOptions(a)},isInvalidOn:function(){return this.fn.isInvalidOn()}};return b.prototype=c,b.fn={createMsg:function(b){var c="",d=0;if(this.themeOptions.template){for(var e=0;e"+b[e]+"\n";d=a(this.themeOptions.template.replace("{message}",c).replace("{msgClass}",this.themeOptions.msgClass)),"before"==this.themeOptions.placement?d.insertBefore(this.$input):"after"==this.themeOptions.placement&&d.insertAfter(this.$input)}return d},showInvalid:function(a){this.removeInvalid(!0);var b=this.createMsg(a);this.validatorInstance&&(b?this.validatorInstance.setScrollTo(b.offset().top):this.validatorInstance.setScrollTo(this.$input.offset().top)),this.$msgContainer=b,!this.chkboxOrRadio&&this.themeOptions.invalidClass&&this.$input.addClass(this.themeOptions.invalidClass)},showValid:function(){this.removeInvalid(),!this.chkboxOrRadio&&this.themeOptions.validClass&&this.$input.addClass(this.themeOptions.validClass)},removeInvalid:function(a){null!==this.$msgContainer&&(this.$msgContainer&&this.$msgContainer.remove(),this.$msgContainer=null),!a&&this.themeOptions&&this.themeOptions.invalidClass&&this.$input.removeClass(this.themeOptions.invalidClass)},removeValid:function(){!this.chkboxOrRadio&&this.themeOptions&&this.themeOptions.invalidClass&&this.$input.removeClass(this.themeOptions.validClass)},removeAll:function(){this.removeValid(),this.removeInvalid()},setOptions:function(a){this.themeOptions=a,"checkbox"==this.$input[0].type||"radio"==this.$input[0].type?this.chkboxOrRadio=!0:this.chkboxOrRadio=!1},isInvalidOn:function(){return null!==this.$msgContainer?!0:!1}},b}(jQuery); \ No newline at end of file +bValidator.InsertPresenter=function(e){"use strict";var n=function(t,i){function s(){}s.prototype=n.fn,this.fn=new s,this.fn.$input=t,this.fn.validatorInstance=i,this.fn.$msgContainer=null,this.fn.themeOptions=null,this.fn.chkboxOrRadio=null};return n.prototype={showInvalid:function(t){this.fn.showInvalid(t)},showValid:function(){this.fn.showValid()},removeAll:function(){this.fn.removeAll()},setOptions:function(t){this.fn.setOptions(t)},isInvalidOn:function(){return this.fn.isInvalidOn()}},n.fn={createMsg:function(t){var i="",s=0;if(this.themeOptions.template){for(var n=0;n"+t[n]+"\n";s=e(this.themeOptions.template.replace("{message}",i).replace("{msgClass}",this.themeOptions.msgClass)),"before"==this.themeOptions.placement?s.insertBefore(this.$input):"after"==this.themeOptions.placement&&s.insertAfter(this.$input)}return s},showInvalid:function(t){this.removeInvalid(!0);var i=this.createMsg(t);this.validatorInstance&&(i?this.validatorInstance.setScrollTo(i.offset().top):this.validatorInstance.setScrollTo(this.$input.offset().top)),this.$msgContainer=i,!this.chkboxOrRadio&&this.themeOptions.invalidClass&&this.$input.addClass(this.themeOptions.invalidClass)},showValid:function(){this.removeInvalid(),!this.chkboxOrRadio&&this.themeOptions.validClass&&this.$input.addClass(this.themeOptions.validClass)},removeInvalid:function(t){null!==this.$msgContainer&&(this.$msgContainer&&this.$msgContainer.remove(),this.$msgContainer=null),!t&&this.themeOptions&&this.themeOptions.invalidClass&&this.$input.removeClass(this.themeOptions.invalidClass)},removeValid:function(){!this.chkboxOrRadio&&this.themeOptions&&this.themeOptions.invalidClass&&this.$input.removeClass(this.themeOptions.validClass)},removeAll:function(){this.removeValid(),this.removeInvalid()},setOptions:function(t){this.themeOptions=t,"checkbox"==this.$input[0].type||"radio"==this.$input[0].type?this.chkboxOrRadio=!0:this.chkboxOrRadio=!1},isInvalidOn:function(){return null!==this.$msgContainer}},n}(jQuery); \ No newline at end of file diff --git a/package.json b/package.json index 69a9732..95440a1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bvalidator", "description": "Form validation jQuery plug-in.", - "version": "1.0.4", + "version": "1.0.5", "keywords": [ "form", "validation", @@ -20,22 +20,22 @@ }, "license": "MIT", "devDependencies": { - "bootstrap": "^3.3", - "codemirror": "^5.8", - "grunt": "^0.4.5", - "grunt-autoprefixer": "^3.0.3", - "grunt-contrib-clean": "^0.6.0", - "grunt-contrib-compress": "^0.14.0", - "grunt-contrib-concat": "^0.5.1", - "grunt-contrib-copy": "^0.8.2", - "grunt-contrib-csslint": "^0.5.0", - "grunt-contrib-cssmin": "^0.14.0", - "grunt-contrib-jshint": "^0.11.3", - "grunt-contrib-less": "^1.0.1", - "grunt-contrib-uglify": "^0.9.2", - "grunt-contrib-watch": "^0.6.1", - "grunt-ejs": "^0.3.0", - "grunt-jscs": "^2.6.0", + "bootstrap": "^3.4.1", + "codemirror": "^5.48.0", + "grunt": "^1.0.4", + "grunt-autoprefixer": "latest", + "grunt-contrib-clean": "latest", + "grunt-contrib-compress": "latest", + "grunt-contrib-concat": "latest", + "grunt-contrib-copy": "latest", + "grunt-contrib-csslint": "latest", + "grunt-contrib-cssmin": "latest", + "grunt-contrib-jshint": "latest", + "grunt-contrib-less": "latest", + "grunt-contrib-uglify": "latest", + "grunt-contrib-watch": "latest", + "grunt-ejs": "latest", + "grunt-jscs": "latest", "jquery": "^2" }, "files": [ @@ -43,5 +43,9 @@ "!.DEV", "!dist-docs", "!documentation" - ] + ], + "dependencies": { + "grunt-cli": "^1.3.2", + "npm": "^6.10.0" + } }