diff --git a/form-validator/brazil.js b/form-validator/brazil.js index 8afdeb9..8b0b24d 100644 --- a/form-validator/brazil.js +++ b/form-validator/brazil.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/date.js b/form-validator/date.js index a36f295..5d040bc 100644 --- a/form-validator/date.js +++ b/form-validator/date.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/file.js b/form-validator/file.js index 5156fa3..1adc1f4 100644 --- a/form-validator/file.js +++ b/form-validator/file.js @@ -1,9 +1,9 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(a,b){"use strict";var c="undefined"!=typeof b.FileReader,d=function(b){var c=a.split((b.valAttr("allowing")||"").toLowerCase());return a.inArray("jpg",c)>-1&&a.inArray("jpeg",c)===-1?c.push("jpeg"):a.inArray("jpeg",c)>-1&&a.inArray("jpg",c)===-1&&c.push("jpg"),c},e=function(a,b,c,d){var e=d[b]||"";a.errorMessageKey="",a.errorMessage=e.replace("%s",c)},f=function(c,d,e){var f=new FileReader,g=new Image;f.readAsDataURL(c),f.onload=function(c){setTimeout(function(){g.onload=function(){a(b).trigger("imageValidation",[this]),d(this)},g.onerror=function(){e()},g.src=c.target.result},2e3)}};a.formUtils.addValidator({name:"mime",validatorFunction:function(b,f,g,h){if(c){var i=!0,j=f.get(0).files||[],k="",l=d(f);return j.length&&(a.each(j,function(b,c){return i=!1,k=c.type||"",a.each(l,function(a,b){if(i=k.indexOf(b)>-1)return!1}),i}),i||(a.formUtils.warn("Trying to upload a file with mime type "+k+" which is not allowed"),e(this,"wrongFileType",l.join(", "),h))),i}return a.formUtils.warn("FileReader not supported by browser, will check file extension"),a.formUtils.validators.validate_extension.validatorFunction(b,f,g,h)},errorMessage:"",errorMessageKey:"wrongFileType"}),a.formUtils.addValidator({name:"extension",validatorFunction:function(b,c,f,g){var h=!0,i=this,j=d(c);return a.each(c.get(0).files||[b],function(b,c){var d="string"==typeof c?c:c.value||c.fileName||c.name,f=d.substr(d.lastIndexOf(".")+1);if(a.inArray(f.toLowerCase(),j)===-1)return h=!1,e(i,"wrongFileType",j.join(", "),g),!1}),h},errorMessage:"",errorMessageKey:"wrongFileType"}),a.formUtils.addValidator({name:"size",validatorFunction:function(b,d,f,g){var h=d.valAttr("max-size");if(!h)return a.formUtils.warn('Input "'+d.attr("name")+'" is missing data-validation-max-size attribute'),!0;if(!c)return!0;var i=a.formUtils.convertSizeNameToBytes(h),j=!0;return a.each(d.get(0).files||[],function(a,b){return j=b.size<=i}),j||e(this,"wrongFileSize",h,g),j},errorMessage:"",errorMessageKey:"wrongFileSize"}),a.formUtils.convertSizeNameToBytes=function(a){return a=a.toUpperCase(),"M"===a.substr(a.length-1,1)?1024*parseInt(a.substr(0,a.length-1),10)*1024:"MB"===a.substr(a.length-2,2)?1024*parseInt(a.substr(0,a.length-2),10)*1024:"KB"===a.substr(a.length-2,2)?1024*parseInt(a.substr(0,a.length-2),10):"B"===a.substr(a.length-1,1)?parseInt(a.substr(0,a.length-1),10):parseInt(a,10)},a.formUtils.checkImageDimension=function(a,b,c){var d=!1,e={width:0,height:0},f=function(a){a=a.replace("min","").replace("max","");var b=a.split("x");e.width=b[0],e.height=b[1]?b[1]:b[0]},g=!1,h=!1,i=b.split("-");return 1===i.length?0===i[0].indexOf("min")?g=i[0]:h=i[0]:(g=i[0],h=i[1]),g&&(f(g),(a.widthe.width||a.height>e.height)&&(d=a.width>e.width?c.imageTooWide+" "+e.width+"px":c.imageTooTall+" "+e.height+"px",d+=" ("+c.max+" "+e.width+"x"+e.height+"px)")),d},a.formUtils.checkImageRatio=function(a,b,c){var d=a.width/a.height,e=function(a){var b=a.replace("max","").replace("min","").split(":");return b[0]/b[1]},f=b.split("-"),g=function(a,b,c){return a>=b&&a<=c};if(1===f.length){if(d!==e(f[0]))return c.imageRatioNotAccepted}else if(2===f.length&&!g(d,e(f[0]),e(f[1])))return c.imageRatioNotAccepted;return!1},a.formUtils.addValidator({name:"dimension",validatorFunction:function(b,d,e,g,h,i){if(c){var j=this,k=a.formUtils.asyncValidation(this.name,d,h);return k.run(i,function(b){var c=d.get(0).files||[];d.attr("data-validation").indexOf("mime")===-1?(alert("You should validate file type being jpg, gif or png on input "+d[0].name),b(!1)):c.length>1?(alert("Validating image dimensions does not support inputs allowing multiple files"),b(!1)):0===c.length?b(!0):f(c[0],function(c){var e=!1;d.valAttr("dimension")&&(e=a.formUtils.checkImageDimension(c,d.valAttr("dimension"),g)),!e&&d.valAttr("ratio")&&(e=a.formUtils.checkImageRatio(c,d.valAttr("ratio"),g)),e?(j.errorMessage=g.wrongFileDim+" "+d.valAttr("has-not-valid-dim"),b(!1)):b(!0)},function(a){throw a})})}return!0},errorMessage:"",errorMessageKey:""}),a(b).one("validatorsLoaded formValidationSetup",function(b,c,d){var e;e=c?c.find('input[type="file"]'):a('input[type="file"]'),a.formUtils.dialogs.removeInputStylingAndMessage(e,d)})}(a,window)}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(a,b){"use strict";var c="undefined"!=typeof b.FileReader,d=function(b){var c=a.split((b.valAttr("allowing")||"").toLowerCase());return a.inArray("jpg",c)>-1&&a.inArray("jpeg",c)===-1?c.push("jpeg"):a.inArray("jpeg",c)>-1&&a.inArray("jpg",c)===-1&&c.push("jpg"),c},e=function(a,b,c,d){var e=d[b]||"";a.errorMessageKey="",a.errorMessage=e.replace("%s",c)},f=function(c,d,e){var f=new FileReader,g=new Image;f.readAsDataURL(c),f.onload=function(c){g.onload=function(){a(b).trigger("imageValidation",[this]),d(this)},g.onerror=function(){e()},g.src=c.target.result}};a.formUtils.addValidator({name:"mime",validatorFunction:function(b,f,g,h){if(c){var i=!0,j=f.get(0).files||[],k="",l=d(f);return j.length&&(a.each(j,function(b,c){return i=!1,k=c.type||"",a.each(l,function(a,b){if(i=k.indexOf(b)>-1)return!1}),i}),i||(a.formUtils.warn("Trying to upload a file with mime type "+k+" which is not allowed"),e(this,"wrongFileType",l.join(", "),h))),i}return a.formUtils.warn("FileReader not supported by browser, will check file extension"),a.formUtils.validators.validate_extension.validatorFunction(b,f,g,h)},errorMessage:"",errorMessageKey:"wrongFileType"}),a.formUtils.addValidator({name:"extension",validatorFunction:function(b,c,f,g){var h=!0,i=this,j=d(c);return a.each(c.get(0).files||[b],function(b,c){var d="string"==typeof c?c:c.value||c.fileName||c.name,f=d.substr(d.lastIndexOf(".")+1);if(a.inArray(f.toLowerCase(),j)===-1)return h=!1,e(i,"wrongFileType",j.join(", "),g),!1}),h},errorMessage:"",errorMessageKey:"wrongFileType"}),a.formUtils.addValidator({name:"size",validatorFunction:function(b,d,f,g){var h=d.valAttr("max-size");if(!h)return a.formUtils.warn('Input "'+d.attr("name")+'" is missing data-validation-max-size attribute'),!0;if(!c)return!0;var i=a.formUtils.convertSizeNameToBytes(h),j=!0;return a.each(d.get(0).files||[],function(a,b){return j=b.size<=i}),j||e(this,"wrongFileSize",h,g),j},errorMessage:"",errorMessageKey:"wrongFileSize"}),a.formUtils.convertSizeNameToBytes=function(a){return a=a.toUpperCase(),"M"===a.substr(a.length-1,1)?1024*parseInt(a.substr(0,a.length-1),10)*1024:"MB"===a.substr(a.length-2,2)?1024*parseInt(a.substr(0,a.length-2),10)*1024:"KB"===a.substr(a.length-2,2)?1024*parseInt(a.substr(0,a.length-2),10):"B"===a.substr(a.length-1,1)?parseInt(a.substr(0,a.length-1),10):parseInt(a,10)},a.formUtils.checkImageDimension=function(a,b,c){var d=!1,e={width:0,height:0},f=function(a){a=a.replace("min","").replace("max","");var b=a.split("x");e.width=b[0],e.height=b[1]?b[1]:b[0]},g=!1,h=!1,i=b.split("-");return 1===i.length?0===i[0].indexOf("min")?g=i[0]:h=i[0]:(g=i[0],h=i[1]),g&&(f(g),(a.widthe.width||a.height>e.height)&&(d=a.width>e.width?c.imageTooWide+" "+e.width+"px":c.imageTooTall+" "+e.height+"px",d+=" ("+c.max+" "+e.width+"x"+e.height+"px)")),d},a.formUtils.checkImageRatio=function(a,b,c){var d=a.width/a.height,e=function(a){var b=a.replace("max","").replace("min","").split(":");return b[0]/b[1]},f=b.split("-"),g=function(a,b,c){return a>=b&&a<=c};if(1===f.length){if(d!==e(f[0]))return c.imageRatioNotAccepted}else if(2===f.length&&!g(d,e(f[0]),e(f[1])))return c.imageRatioNotAccepted;return!1},a.formUtils.addValidator({name:"dimension",validatorFunction:function(b,d,e,g,h,i){if(c){var j=this,k=a.formUtils.asyncValidation(this.name,d,h);return k.run(i,function(b){var c=d.get(0).files||[];d.attr("data-validation").indexOf("mime")===-1?(alert("You should validate file type being jpg, gif or png on input "+d[0].name),b(!1)):c.length>1?(alert("Validating image dimensions does not support inputs allowing multiple files"),b(!1)):0===c.length?b(!0):f(c[0],function(c){var e=!1;d.valAttr("dimension")&&(e=a.formUtils.checkImageDimension(c,d.valAttr("dimension"),g)),!e&&d.valAttr("ratio")&&(e=a.formUtils.checkImageRatio(c,d.valAttr("ratio"),g)),e?(j.errorMessage=g.wrongFileDim+" "+d.valAttr("has-not-valid-dim"),b(!1)):b(!0)},function(a){throw a})})}return!0},errorMessage:"",errorMessageKey:""}),a(b).one("validatorsLoaded formValidationSetup",function(b,c,d){var e;e=c?c.find('input[type="file"]'):a('input[type="file"]'),a.formUtils.dialogs.removeInputStylingAndMessage(e,d)})}(a,window)}); \ No newline at end of file diff --git a/form-validator/html5.js b/form-validator/html5.js index 5d1512b..168fbe6 100644 --- a/form-validator/html5.js +++ b/form-validator/html5.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/jquery.form-validator.js b/form-validator/jquery.form-validator.js index ef206bb..4e58186 100644 --- a/form-validator/jquery.form-validator.js +++ b/form-validator/jquery.form-validator.js @@ -17,7 +17,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/jquery.form-validator.min.js b/form-validator/jquery.form-validator.min.js index 14c605c..1e85ee9 100644 --- a/form-validator/jquery.form-validator.min.js +++ b/form-validator/jquery.form-validator.min.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/jsconf.js b/form-validator/jsconf.js index 0556a4c..8f6bba6 100644 --- a/form-validator/jsconf.js +++ b/form-validator/jsconf.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/ca.js b/form-validator/lang/ca.js index 0afde9a..b55810e 100644 --- a/form-validator/lang/ca.js +++ b/form-validator/lang/ca.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/cs.js b/form-validator/lang/cs.js index 8f0b180..b4134ee 100644 --- a/form-validator/lang/cs.js +++ b/form-validator/lang/cs.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/da.js b/form-validator/lang/da.js index f00a9ab..2274c45 100644 --- a/form-validator/lang/da.js +++ b/form-validator/lang/da.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/de.js b/form-validator/lang/de.js index 36641ae..809124b 100644 --- a/form-validator/lang/de.js +++ b/form-validator/lang/de.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/es.js b/form-validator/lang/es.js index 94e58cd..a77f61f 100644 --- a/form-validator/lang/es.js +++ b/form-validator/lang/es.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/fr.js b/form-validator/lang/fr.js index b46e01a..18d9457 100644 --- a/form-validator/lang/fr.js +++ b/form-validator/lang/fr.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/it.js b/form-validator/lang/it.js index 674724a..21d0656 100644 --- a/form-validator/lang/it.js +++ b/form-validator/lang/it.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/nl.js b/form-validator/lang/nl.js index 4860bfe..09cacf2 100644 --- a/form-validator/lang/nl.js +++ b/form-validator/lang/nl.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/no.js b/form-validator/lang/no.js index 40d784e..57ab14f 100644 --- a/form-validator/lang/no.js +++ b/form-validator/lang/no.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/pl.js b/form-validator/lang/pl.js index 76d2455..a46f769 100644 --- a/form-validator/lang/pl.js +++ b/form-validator/lang/pl.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/pt.js b/form-validator/lang/pt.js index c5b3ed6..83020c2 100644 --- a/form-validator/lang/pt.js +++ b/form-validator/lang/pt.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/ro.js b/form-validator/lang/ro.js index 77cd309..406a064 100644 --- a/form-validator/lang/ro.js +++ b/form-validator/lang/ro.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/ru.js b/form-validator/lang/ru.js index 6d7b06d..2c9f07d 100644 --- a/form-validator/lang/ru.js +++ b/form-validator/lang/ru.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/sv.js b/form-validator/lang/sv.js index feb9eb6..e635aa2 100644 --- a/form-validator/lang/sv.js +++ b/form-validator/lang/sv.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/lang/vi.js b/form-validator/lang/vi.js index 40f1614..96ad7aa 100644 --- a/form-validator/lang/vi.js +++ b/form-validator/lang/vi.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/location.js b/form-validator/location.js index 832a3d7..032d5e8 100644 --- a/form-validator/location.js +++ b/form-validator/location.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/logic.js b/form-validator/logic.js index a7b1ab3..9dc36cd 100644 --- a/form-validator/logic.js +++ b/form-validator/logic.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/poland.js b/form-validator/poland.js index 7043f0f..994e804 100644 --- a/form-validator/poland.js +++ b/form-validator/poland.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/sanitize.js b/form-validator/sanitize.js index d6ab448..4a15a55 100644 --- a/form-validator/sanitize.js +++ b/form-validator/sanitize.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/security.js b/form-validator/security.js index 93b289f..814b811 100644 --- a/form-validator/security.js +++ b/form-validator/security.js @@ -1,9 +1,9 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.addValidator({name:"spamcheck",validatorFunction:function(a,b){var c=b.valAttr("captcha");return c===a},errorMessage:"",errorMessageKey:"badSecurityAnswer"}),a.formUtils.addValidator({name:"confirmation",validatorFunction:function(b,c,d,e,f){var g,h=c.valAttr("confirm")||c.attr("name")+"_confirmation",i=f.find('[name="'+h+'"]');if(!i.length)return a.formUtils.warn('Password confirmation validator: could not find an input with name "'+h+'"'),!1;if(g=i.val(),d.validateOnBlur&&!i[0].hasValidationCallback){i[0].hasValidationCallback=!0;var j=function(){c.validate()};i.on("keyup",j),f.one("formValidationSetup",function(){i[0].hasValidationCallback=!1,i.off("keyup",j)})}return b===g},errorMessage:"",errorMessageKey:"notConfirmed"});var c={amex:[15,15],diners_club:[14,14],cjb:[16,16],laser:[16,19],visa:[16,16],mastercard:[16,16],maestro:[12,19],discover:[16,16]},d=!1,e=!1;a.formUtils.addValidator({name:"creditcard",validatorFunction:function(b,f){var g=a.split(f.valAttr("allowing")||"");if(e=a.inArray("amex",g)>-1,d=e&&1===g.length,g.length>0){var h=!1;if(a.each(g,function(d,e){if(e in c){if(b.length>=c[e][0]&&b.length<=c[e][1])return h=!0,!1}else a.formUtils.warn('Use of unknown credit card "'+e+'"')}),!h)return!1}if(""!==b.replace(new RegExp("[0-9]","g"),""))return!1;var i=0;return a.each(b.split("").reverse(),function(a,b){b=parseInt(b,10),a%2===0?i+=b:(b*=2,i+=b<10?b:b-9)}),i%10===0},errorMessage:"",errorMessageKey:"badCreditCard"}),a.formUtils.addValidator({name:"cvv",validatorFunction:function(a){return""===a.replace(/[0-9]/g,"")&&(a+="",d?4===a.length:e?3===a.length||4===a.length:3===a.length)},errorMessage:"",errorMessageKey:"badCVV"}),a.formUtils.addValidator({name:"strength",validatorFunction:function(b,c){var d=c.valAttr("strength")||2;return d&&d>3&&(d=3),a.formUtils.validators.validate_strength.calculatePasswordStrength(b)>=d},errorMessage:"",errorMessageKey:"badStrength",calculatePasswordStrength:function(a){if(a.length<4)return 0;var b=0,c=function(a,b){for(var c="",d=0;d100&&(b=100),b<20?0:b<40?1:b<=60?2:3},strengthDisplay:function(b,c){var d={fontSize:"12pt",padding:"4px",bad:"Very bad",weak:"Weak",good:"Good",strong:"Strong"};c&&a.extend(d,c),b.bind("keyup",function(){var b=a(this).val(),c="undefined"==typeof d.parent?a(this).parent():a(d.parent),e=c.find(".strength-meter"),f=a.formUtils.validators.validate_strength.calculatePasswordStrength(b),g={background:"pink",color:"#FF0000",fontWeight:"bold",border:"red solid 1px",borderWidth:"0px 0px 4px",display:"inline-block",fontSize:d.fontSize,padding:d.padding},h=d.bad;0===e.length&&(e=a(""),e.addClass("strength-meter").appendTo(c)),b?e.show():e.hide(),1===f?h=d.weak:2===f?(g.background="lightyellow",g.borderColor="yellow",g.color="goldenrod",h=d.good):f>=3&&(g.background="lightgreen",g.borderColor="darkgreen",g.color="darkgreen",h=d.strong),e.css(g).text(h)})}});var f=function(b,c,d,e,f){var g=c.valAttr("req-params")||c.data("validation-req-params")||{},h=function(a,b){b(a)};g||(g={}),"string"==typeof g&&(g=a.parseJSON(g)),g[c.valAttr("param-name")||c.attr("name")]=d,a.ajax({url:b,type:"POST",cache:!1,data:g,dataType:"json",error:function(a){return h({valid:!1,message:"Connection failed with status: "+a.statusText},f),!1},success:function(a){h(a,f)}})};a.formUtils.addValidator({name:"server",validatorFunction:function(b,c,d,e,g,h){var i=a.formUtils.asyncValidation(this.name,c,g);return i.run(h,function(a){var e=c.valAttr("url")||d.backendUrl||document.location.href;g.addClass("validating-server-side"),c.addClass("validating-server-side"),f(e,c,b,d,function(b){g.removeClass("validating-server-side"),c.removeClass("validating-server-side"),b.message&&c.attr(d.validationErrorMsgAttribute,b.message),a(b.valid)})})},errorMessage:"",errorMessageKey:"badBackend"}),a.formUtils.addValidator({name:"letternumeric",validatorFunction:function(b,c,d,e){var f="^([a-zA-Z0-9ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",g="]+)$",h=c.valAttr("allowing"),i="";if(h){i=f+h+g;var j=h.replace(/\\/g,"");j.indexOf(" ")>-1&&(j=j.replace(" ",""),j+=e.andSpaces||a.formUtils.LANG.andSpaces),this.errorMessage=e.badAlphaNumeric+e.badAlphaNumericExtra+j}else i=f+g,this.errorMessage=e.badAlphaNumeric;return new RegExp(i).test(b)},errorMessage:"",errorMessageKey:"requiredFields"}),a.formUtils.addValidator({name:"complexity",validatorFunction:function(b,c,d,e){var f=c.valAttr("require-uc-letter")||"0",g=c.valAttr("require-lc-letter")||"0",h=c.valAttr("require-special-char")||"0",i=c.valAttr("require-numeral")||"0",j={"uc-letter":{pattern:"^(?=(?:.*[A-Z]){"+f+",}).+",numRequired:f,dialogEnd:e.passwordComplexityUppercaseInfo},"lc-letter":{pattern:"^(?=(?:.*[a-z]){"+g+",}).+",numRequired:g,dialogEnd:e.passwordComplexityLowercaseInfo},"special-char":{pattern:"^(?=(?:.*(_|[!\"#$%&'()*+\\\\,-./:;<=>?@[\\]^_`{|}~])){"+h+",}).+",numRequired:h,dialogEnd:e.passwordComplexitySpecialCharsInfo},numeral:{pattern:"^(?=(?:.*\\d){"+i+",}).+",numRequired:i,dialogEnd:a.formUtils.LANG.passwordComplexityNumericCharsInfo}},k="";return a.each(j,function(a,d){var f=parseInt(d.numRequired,10);if(f){var g=new RegExp(d.pattern);g.test(b)?c.trigger("complexityValidation",[!0,a]):(""===k&&(k=e.passwordComplexityStart),k+=e.passwordComplexitySeparator+f+d.dialogEnd,c.trigger("complexityValidation",[!1,a]))}}),!k||(this.errorMessage=k+e.passwordComplexityEnd,!1)},errorMessage:"",errorMessageKey:""}),a.formUtils.addValidator({name:"recaptcha",validatorFunction:function(a,b){return""!==grecaptcha.getResponse(b.valAttr("recaptcha-widget-id"))},errorMessage:"",errorMessageKey:"badreCaptcha"}),a.fn.displayPasswordStrength=function(b){return new a.formUtils.validators.validate_strength.strengthDisplay(this,b),this};var g=function(b,c,d){if(c||(c=a("form")),"undefined"!=typeof grecaptcha&&!a.formUtils.hasLoadedGrecaptcha)throw new Error("reCaptcha API can not be loaded by hand, delete reCaptcha API snippet.");if(!a.formUtils.hasLoadedGrecaptcha&&a('[data-validation~="recaptcha"]',c).length){a.formUtils.hasLoadedGrecaptcha=!0;var e="//www.google.com/recaptcha/api.js?onload=reCaptchaLoaded&render=explicit"+(d.lang?"&hl="+d.lang:""),f=document.createElement("script");f.type="text/javascript",f.async=!0,f.defer=!0,f.src=e,document.getElementsByTagName("body")[0].appendChild(f)}};b.reCaptchaLoaded=function(b){b&&"object"==typeof b&&b.length||(b=a("form")),b.each(function(){var b=a(this),c=b.context.validationConfig;a('[data-validation~="recaptcha"]',b).each(function(){var b=a(this),d=document.createElement("DIV"),e=c.reCaptchaSiteKey||b.valAttr("recaptcha-sitekey"),f=c.reCaptchaTheme||b.valAttr("recaptcha-theme")||"light";if(!e)throw new Error("Google reCaptcha site key is required.");var g=function(b){a("form").each(function(){a('[data-validation~="recaptcha"]',a(this)).each(function(){a(this).trigger("validation",b&&""!==b)})})},h=grecaptcha.render(d,{sitekey:e,theme:f,callback:g,"expired-callback":g});b.valAttr("recaptcha-widget-id",h).hide().on("beforeValidation",function(a){a.stopImmediatePropagation()}).parent().append(d)})})},a(b).on("validatorsLoaded formValidationSetup",g)}(a,window)}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(a,b){"use strict";a.formUtils.addValidator({name:"spamcheck",validatorFunction:function(a,b){var c=b.valAttr("captcha");return c===a},errorMessage:"",errorMessageKey:"badSecurityAnswer"}),a.formUtils.addValidator({name:"confirmation",validatorFunction:function(b,c,d,e,f){var g,h=c.valAttr("confirm")||c.attr("name")+"_confirmation",i=f.find('[name="'+h+'"]');if(!i.length)return a.formUtils.warn('Password confirmation validator: could not find an input with name "'+h+'"'),!1;if(g=i.val(),d.validateOnBlur&&!i[0].hasValidationCallback){i[0].hasValidationCallback=!0;var j=function(){c.validate()};i.on("keyup",j),f.one("formValidationSetup",function(){i[0].hasValidationCallback=!1,i.off("keyup",j)})}return b===g},errorMessage:"",errorMessageKey:"notConfirmed"});var c={amex:[15,15],diners_club:[14,14],cjb:[16,16],laser:[16,19],visa:[16,16],mastercard:[16,16],maestro:[12,19],discover:[16,16]},d=!1,e=!1;a.formUtils.addValidator({name:"creditcard",validatorFunction:function(b,f){var g=a.split(f.valAttr("allowing")||"");if(e=a.inArray("amex",g)>-1,d=e&&1===g.length,g.length>0){var h=!1;if(a.each(g,function(d,e){if(e in c){if(b.length>=c[e][0]&&b.length<=c[e][1])return h=!0,!1}else a.formUtils.warn('Use of unknown credit card "'+e+'"')}),!h)return!1}if(""!==b.replace(new RegExp("[0-9]","g"),""))return!1;var i=0;return a.each(b.split("").reverse(),function(a,b){b=parseInt(b,10),a%2===0?i+=b:(b*=2,i+=b<10?b:b-9)}),i%10===0},errorMessage:"",errorMessageKey:"badCreditCard"}),a.formUtils.addValidator({name:"cvv",validatorFunction:function(a){return""===a.replace(/[0-9]/g,"")&&(a+="",d?4===a.length:e?3===a.length||4===a.length:3===a.length)},errorMessage:"",errorMessageKey:"badCVV"}),a.formUtils.addValidator({name:"strength",validatorFunction:function(b,c){var d=c.valAttr("strength")||2;return d&&d>3&&(d=3),a.formUtils.validators.validate_strength.calculatePasswordStrength(b)>=d},errorMessage:"",errorMessageKey:"badStrength",calculatePasswordStrength:function(a){if(a.length<4)return 0;var b=0,c=function(a,b){for(var c="",d=0;d100&&(b=100),b<20?0:b<40?1:b<=60?2:3},strengthDisplay:function(b,c){var d={fontSize:"12pt",padding:"4px",bad:"Very bad",weak:"Weak",good:"Good",strong:"Strong"};c&&a.extend(d,c),b.bind("keyup",function(){var b=a(this).val(),c="undefined"==typeof d.parent?a(this).parent():a(d.parent),e=c.find(".strength-meter"),f=a.formUtils.validators.validate_strength.calculatePasswordStrength(b),g={background:"pink",color:"#FF0000",fontWeight:"bold",border:"red solid 1px",borderWidth:"0px 0px 4px",display:"inline-block",fontSize:d.fontSize,padding:d.padding},h=d.bad;0===e.length&&(e=a(""),e.addClass("strength-meter").appendTo(c)),b?e.show():e.hide(),1===f?h=d.weak:2===f?(g.background="lightyellow",g.borderColor="yellow",g.color="goldenrod",h=d.good):f>=3&&(g.background="lightgreen",g.borderColor="darkgreen",g.color="darkgreen",h=d.strong),e.css(g).text(h)})}});var f=function(b,c,d,e,f){var g=c.valAttr("req-params")||c.data("validation-req-params")||{},h=function(a,b){b(a)};g||(g={}),"string"==typeof g&&(g=a.parseJSON(g)),g[c.valAttr("param-name")||c.attr("name")]=d,a.ajax({url:b,type:"POST",cache:!1,data:g,dataType:"json",error:function(a){return h({valid:!1,message:"Connection failed with status: "+a.statusText},f),!1},success:function(a){h(a,f)}})};a.formUtils.addValidator({name:"server",validatorFunction:function(b,c,d,e,g,h){var i=a.formUtils.asyncValidation(this.name,c,g);return i.run(h,function(a){var e=c.valAttr("url")||d.backendUrl||document.location.href;g.addClass("validating-server-side"),c.addClass("validating-server-side"),f(e,c,b,d,function(b){g.removeClass("validating-server-side"),c.removeClass("validating-server-side"),b.message&&c.attr(d.validationErrorMsgAttribute,b.message),a(b.valid)})})},errorMessage:"",errorMessageKey:"badBackend"}),a.formUtils.addValidator({name:"letternumeric",validatorFunction:function(b,c,d,e){var f="^([a-zA-Z0-9ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",g="]+)$",h=c.valAttr("allowing"),i="";if(h){i=f+h+g;var j=h.replace(/\\/g,"");j.indexOf(" ")>-1&&(j=j.replace(" ",""),j+=e.andSpaces||a.formUtils.LANG.andSpaces),this.errorMessage=e.badAlphaNumeric+e.badAlphaNumericExtra+j}else i=f+g,this.errorMessage=e.badAlphaNumeric;return new RegExp(i).test(b)},errorMessage:"",errorMessageKey:"requiredFields"}),a.formUtils.addValidator({name:"complexity",validatorFunction:function(b,c,d,e){var f=c.valAttr("require-uc-letter")||"0",g=c.valAttr("require-lc-letter")||"0",h=c.valAttr("require-special-char")||"0",i=c.valAttr("require-numeral")||"0",j=c.valAttr("require-length")||"0",k={"uc-letter":{pattern:"^(?=(?:.*[A-Z]){"+f+",}).+",numRequired:f,dialogEnd:e.passwordComplexityUppercaseInfo},"lc-letter":{pattern:"^(?=(?:.*[a-z]){"+g+",}).+",numRequired:g,dialogEnd:e.passwordComplexityLowercaseInfo},"special-char":{pattern:"^(?=(?:.*(_|[!\"#$%&'()*+\\\\,-./:;<=>?@[\\]^_`{|}~])){"+h+",}).+",numRequired:h,dialogEnd:e.passwordComplexitySpecialCharsInfo},numeral:{pattern:"^(?=(?:.*\\d){"+i+",}).+",numRequired:i,dialogEnd:a.formUtils.LANG.passwordComplexityNumericCharsInfo},length:{callback:function(a){return a.length>j},numRequired:j,dialogEnd:"Lorem te ipsum"}},l="";return a.each(k,function(a,d){var f=parseInt(d.numRequired,10);if(f){var g=new RegExp(d.pattern),h=!1;h=d.callback?d.callback(b):g.test(b),h?c.trigger("complexityRequirementValidation",[!0,a]):(""===l&&(l=e.passwordComplexityStart),l+=e.passwordComplexitySeparator+f+d.dialogEnd,c.trigger("complexityRequirementValidation",[!1,a]))}}),!l||(this.errorMessage=l+e.passwordComplexityEnd,!1)},errorMessage:"",errorMessageKey:""}),a.formUtils.addValidator({name:"recaptcha",validatorFunction:function(a,b){return""!==grecaptcha.getResponse(b.valAttr("recaptcha-widget-id"))},errorMessage:"",errorMessageKey:"badreCaptcha"}),a.fn.displayPasswordStrength=function(b){return new a.formUtils.validators.validate_strength.strengthDisplay(this,b),this};var g=function(b,c,d){if(c||(c=a("form")),"undefined"!=typeof grecaptcha&&!a.formUtils.hasLoadedGrecaptcha)throw new Error("reCaptcha API can not be loaded by hand, delete reCaptcha API snippet.");if(!a.formUtils.hasLoadedGrecaptcha&&a('[data-validation~="recaptcha"]',c).length){a.formUtils.hasLoadedGrecaptcha=!0;var e="//www.google.com/recaptcha/api.js?onload=reCaptchaLoaded&render=explicit"+(d.lang?"&hl="+d.lang:""),f=document.createElement("script");f.type="text/javascript",f.async=!0,f.defer=!0,f.src=e,document.getElementsByTagName("body")[0].appendChild(f)}};b.reCaptchaLoaded=function(b){b&&"object"==typeof b&&b.length||(b=a("form")),b.each(function(){var b=a(this),c=b.context.validationConfig;a('[data-validation~="recaptcha"]',b).each(function(){var b=a(this),d=document.createElement("DIV"),e=c.reCaptchaSiteKey||b.valAttr("recaptcha-sitekey"),f=c.reCaptchaTheme||b.valAttr("recaptcha-theme")||"light";if(!e)throw new Error("Google reCaptcha site key is required.");var g=function(b){a("form").each(function(){a('[data-validation~="recaptcha"]',a(this)).each(function(){a(this).trigger("validation",b&&""!==b)})})},h=grecaptcha.render(d,{sitekey:e,theme:f,callback:g,"expired-callback":g});b.valAttr("recaptcha-widget-id",h).hide().on("beforeValidation",function(a){a.stopImmediatePropagation()}).parent().append(d)})})},a(b).on("validatorsLoaded formValidationSetup",g)}(a,window)}); \ No newline at end of file diff --git a/form-validator/sepa.js b/form-validator/sepa.js index 6619c6e..1151629 100644 --- a/form-validator/sepa.js +++ b/form-validator/sepa.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/sweden.js b/form-validator/sweden.js index 5e48b96..9ee920a 100644 --- a/form-validator/sweden.js +++ b/form-validator/sweden.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/toggleDisabled.js b/form-validator/toggleDisabled.js index 30de565..ee0446f 100644 --- a/form-validator/toggleDisabled.js +++ b/form-validator/toggleDisabled.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/form-validator/uk.js b/form-validator/uk.js index 64f0f1c..1b00c4c 100644 --- a/form-validator/uk.js +++ b/form-validator/uk.js @@ -1,7 +1,7 @@ /** File generated by Grunt -- do not modify * JQUERY-FORM-VALIDATOR * - * @version 2.3.47 + * @version 2.3.49 * @website http://formvalidator.net/ * @author Victor Jonsson, http://victorjonsson.se * @license MIT diff --git a/formvalidator.jquery.json b/formvalidator.jquery.json index d103130..8fc2f78 100644 --- a/formvalidator.jquery.json +++ b/formvalidator.jquery.json @@ -7,7 +7,7 @@ "validation", "validator" ], - "version": "2.3.47", + "version": "2.3.49", "author": { "name": "Victor Jonsson", "url": "http://victorjonsson.se", diff --git a/package.json b/package.json index beba526..34d2fa3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jquery-form-validator", "description": "With this feature rich jQuery plugin it becomes easy to validate user input while keeping your HTML markup clean from javascript code. Even though this plugin has a wide range of validation functions it's designed to require as little bandwidth as possible. This is achieved by grouping together validation functions in \"modules\", making it possible for the programmer to load only those functions that's needed to validate a particular form.", - "version": "2.3.47", + "version": "2.3.49", "main": "./form-validator/jquery.form-validator.min.js", "keywords": [ "form", diff --git a/src/modules/security.js b/src/modules/security.js index 2521253..045e6fe 100644 --- a/src/modules/security.js +++ b/src/modules/security.js @@ -446,6 +446,7 @@ numRequiredLowercaseChars = $input.valAttr('require-lc-letter') || '0', numRequiredSpecialChars = $input.valAttr('require-special-char') || '0', numRequiredNumericChars = $input.valAttr('require-numeral') || '0', + numRequiredCharsTotal = $input.valAttr('require-length') || '0', subValidators = { 'uc-letter': { pattern: '^(?=(?:.*[A-Z]){'+numRequiredUppercaseChars+',}).+', @@ -466,6 +467,13 @@ pattern: '^(?=(?:.*\\d){'+numRequiredNumericChars+',}).+', numRequired: numRequiredNumericChars, dialogEnd: $.formUtils.LANG.passwordComplexityNumericCharsInfo + }, + 'length': { + callback: function(val) { + return val.length > numRequiredCharsTotal; + }, + numRequired: numRequiredCharsTotal, + dialogEnd: 'Lorem te ipsum' } }, errorMessage = ''; @@ -473,19 +481,26 @@ $.each(subValidators, function(name, subValidator) { var numRequired = parseInt(subValidator.numRequired, 10); if (numRequired) { - var regexp = new RegExp(subValidator.pattern); - if (!regexp.test(value)) { + var regexp = new RegExp(subValidator.pattern), + valid = false; + + if (subValidator.callback) { + valid = subValidator.callback(value); + } else { + valid = regexp.test(value); + } + + if (!valid) { if (errorMessage === '') { errorMessage = language.passwordComplexityStart; } errorMessage += language.passwordComplexitySeparator + numRequired + subValidator.dialogEnd; - $input.trigger('complexityValidation', [false, name]); + $input.trigger('complexityRequirementValidation', [false, name]); } else { - $input.trigger('complexityValidation', [true, name]); + $input.trigger('complexityRequirementValidation', [true, name]); } } }); - if (errorMessage) { this.errorMessage = errorMessage + language.passwordComplexityEnd; return false; @@ -496,7 +511,7 @@ errorMessage : '', errorMessageKey: '' }); - + /* * Google reCaptcha 2 */