diff --git a/ajax/libs/parsley.js/1.1.16/parsley-standalone.min.js b/ajax/libs/parsley.js/1.1.16/parsley-standalone.min.js new file mode 100755 index 000000000..e60724330 --- /dev/null +++ b/ajax/libs/parsley.js/1.1.16/parsley-standalone.min.js @@ -0,0 +1,85 @@ +/* Parsley dist/parsley-standalone.min.js build version 1.1.16 http://parsleyjs.org */ +(function(b){String.prototype.trim===b&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")});Array.prototype.reduce===b&&(Array.prototype.reduce=function(l){if(void 0===this||null===this)throw new TypeError;var q=Object(this),p=q.length>>>0,m=0,a;if("function"!=typeof l)throw new TypeError;if(0==p&&1==arguments.length)throw new TypeError;if(2<=arguments.length)a=arguments[1];else{do{if(m in q){a=q[m++];break}if(++m>=p)throw new TypeError;}while(1)}for(;m]*>/,N=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,I=/^(?:body|html)$/i,O="val css html text data width height offset".split(" "),F=r.createElement("table"),J=r.createElement("tr"), +K={tr:r.createElement("tbody"),tbody:F,thead:F,tfoot:F,td:J,th:J,"*":r.createElement("div")},P=/complete|loaded|interactive/,Q=/^\.([\w-]+)$/,R=/^#([\w-]*)$/,S=/^[\w-]+$/,M={}.toString,t={},G,E,L=r.createElement("div");t.matches=function(f,a){if(!f||1!==f.nodeType)return!1;var d=f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.matchesSelector;if(d)return d.call(f,a);var b;b=f.parentNode;(d=!b)&&(b=L).appendChild(f);b=~t.qsa(b,a).indexOf(f);d&&L.removeChild(f);return b};G=function(f){return f.replace(/-+(.)?/g, +function(f,a){return a?a.toUpperCase():""})};E=function(f){return v.call(f,function(a,d){return f.indexOf(a)==d})};t.fragment=function(f,a,b){f.replace&&(f=f.replace(N,"<$1>"));a===n&&(a=H.test(f)&&RegExp.$1);a in K||(a="*");var c,e=K[a];e.innerHTML=""+f;f=d.each(u.call(e.childNodes),function(){e.removeChild(this)});q(b)&&(c=d(f),d.each(b,function(f,a){if(-1e.indexOf(a)&&c.push(a)})}return d(c)},has:function(a){return this.filter(function(){return l(a)? +d.contains(this,a):d(this).find(a).size()})},eq:function(a){return-1===a?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!l(a)?a:d(a)},last:function(){var a=this[this.length-1];return a&&!l(a)?a:d(a)},find:function(a){return 1==this.length?d(t.qsa(this[0],a)):this.map(function(){return t.qsa(this,a)})},closest:function(a,b){for(var c=this[0];c&&!t.matches(c,a);)c=c!==b&&c!==r&&c.parentNode;return d(c)},parents:function(a){for(var b=[],c=this;0b.indexOf(a))return b.push(a),a});return j(b,a)},parent:function(a){return j(E(this.pluck("parentNode")),a)},children:function(a){return j(this.map(function(){return e(this)}),a)},contents:function(){return this.map(function(){return u.call(this.childNodes)})},siblings:function(a){return j(this.map(function(a,f){return v.call(e(f.parentNode),function(a){return a!==f})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return d.map(this, +function(d){return d[a]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=null);if("none"==C(this,"").getPropertyValue("display")){var a=this.style,d=this.nodeName,b,c;h[d]||(b=r.createElement(d),r.body.appendChild(b),c=C(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),"none"==c&&(c="block"),h[d]=c);a.display=h[d]}})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){var c=b(a);if(this[0]&&!c)var e=d(a).get(0),r=e.parentNode|| +1arguments.length&&"string"==typeof d)return 0==this.length?n:this[0].style[G(d)]||C(this[0],"").getPropertyValue(d);var c="";for(s in d)!d[s]&&0!==d[s]?this.each(function(){this.style.removeProperty(a(s))}):c+=a(s)+":"+("number"==typeof d[s]&&!D[a(s)]?d[s]+"px":d[s])+";";"string"==typeof d&&(!b&& +0!==b?this.each(function(){this.style.removeProperty(a(d))}):c=a(d)+":"+("number"==typeof b&&!D[a(d)]?b+"px":b));return this.each(function(){this.style.cssText+=";"+c})},index:function(a){return a?this.indexOf(d(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return 1>this.length?!1:c(a).test(w(this[0]))},addClass:function(a){return this.each(function(b){y=[];var c=w(this);k(this,a,b,c).split(/\s+/g).forEach(function(a){d(this).hasClass(a)||y.push(a)},this);y.length&&w(this, +c+(c?" ":"")+y.join(" "))})},removeClass:function(a){return this.each(function(d){if(a===n)return w(this,"");y=w(this);k(this,a,d,y).split(/\s+/g).forEach(function(a){y=y.replace(c(a)," ")});w(this,y.trim())})},toggleClass:function(a,b){return this.each(function(c){c=k(this,a,c,w(this));(b===n?!d(this).hasClass(c):b)?d(this).addClass(c):d(this).removeClass(c)})},scrollTop:function(){if(this.length)return"scrollTop"in this[0]?this[0].scrollTop:this[0].scrollY},position:function(){if(this.length){var a= +this[0],b=this.offsetParent(),c=this.offset(),e=I.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d(a).css("margin-top"))||0;c.left-=parseFloat(d(a).css("margin-left"))||0;e.top+=parseFloat(d(b[0]).css("border-top-width"))||0;e.left+=parseFloat(d(b[0]).css("border-left-width"))||0;return{top:c.top-e.top,left:c.left-e.left}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||r.body;a&&!I.test(a.nodeName)&&"static"==d(a).css("position");)a=a.offsetParent; +return a})}};["width","height"].forEach(function(a){d.fn[a]=function(b){var c,e=a.replace(/./,function(a){return a[0].toUpperCase()});return b===n?this[0]==window?window["inner"+e]:this[0]==r?r.documentElement["offset"+e]:(c=this.offset())&&c[a]:this.each(function(c){var e=d(this);e.css(a,k(this,b,c,e[a]()))})}});["after","prepend","before","append"].forEach(function(a,b){var c=b%2;d.fn[a]=function(){var a=d.map(arguments,function(a){return l(a)?a:t.fragment(a)}),e,f=1a.length? +this:this.each(function(r,h){e=c?h:h.parentNode;h=0==b?h.nextSibling:1==b?h.firstChild:2==b?h:null;a.forEach(function(a){if(f)a=a.cloneNode(!0);else if(!e)return d(a).remove();A(e.insertBefore(a,h),function(a){null!=a.nodeName&&("SCRIPT"===a.nodeName.toUpperCase()&&(!a.type||"text/javascript"===a.type)&&!a.src)&&window.eval.call(window,a.innerHTML)})})})};d.fn[c?a+"To":"insert"+(b?"Before":"After")]=function(b){d(b)[a](this);return this}});t.Z.prototype=d.fn;t.uniq=E;t.deserializeValue=x;d.zepto= +t;return d}();window.Zepto=Zepto;"$"in window||(window.$=Zepto); +(function(b){function l(a){return a._zid||(a._zid=j++)}function q(a,b,c,e){b=p(b);if(b.ns)var j=RegExp("(?:^| )"+b.ns.replace(" "," .* ?")+"(?: |$)");return(g[l(a)]||[]).filter(function(a){return a&&(!b.e||a.e==b.e)&&(!b.ns||j.test(a.ns))&&(!c||l(a.fn)===l(c))&&(!e||a.sel==e)})}function p(a){a=(""+a).split(".");return{e:a[0],ns:a.slice(1).sort().join(" ")}}function m(a,c,e){b.isObject(a)?b.each(a,e):a.split(/\s/).forEach(function(a){e(a,c)})}function a(a,c,e,j,n,r){var h=l(a),B=g[h]||(g[h]=[]);m(c, +e,function(c,e){var h=p(c);h.fn=e;h.sel=j;h.e in w&&(e=function(a){var d=a.relatedTarget;if(!d||d!==this&&!b.contains(this,d))return h.fn.apply(this,arguments)});h.del=n&&n(e,c);var g=h.del||e;h.proxy=function(b){var c=g.apply(a,[b].concat(b.data));!1===c&&(b.preventDefault(),b.stopPropagation());return c};h.i=B.length;B.push(h);a.addEventListener(w[h.e]||h.e,h.proxy,h.del&&("focus"==h.e||"blur"==h.e)||!!r)})}function c(a,b,c,e,j){var r=l(a);m(b||"",c,function(b,c){q(a,b,c,e).forEach(function(b){delete g[r][b.i]; +a.removeEventListener(w[b.e]||b.e,b.proxy,b.del&&("focus"==b.e||"blur"==b.e)||!!j)})})}function e(a){var c,e={originalEvent:a};for(c in a)!n.test(c)&&void 0!==a[c]&&(e[c]=a[c]);b.each(s,function(b,c){e[b]=function(){this[c]=x;return a[b].apply(a,arguments)};e[c]=A});return e}var g={},j=1,k={},w={mouseenter:"mouseover",mouseleave:"mouseout"};k.click=k.mousedown=k.mouseup=k.mousemove="MouseEvents";b.event={add:a,remove:c};b.proxy=function(a,c){if(b.isFunction(a)){var e=function(){return a.apply(c,arguments)}; +e._zid=l(a);return e}if("string"==typeof c)return b.proxy(a[c],a);throw new TypeError("expected function");};b.fn.bind=function(b,c){return this.each(function(){a(this,b,c)})};b.fn.unbind=function(a,b){return this.each(function(){c(this,a,b)})};b.fn.one=function(b,e){return this.each(function(g,j){a(this,b,e,null,function(a,b){return function(){var d=a.apply(j,arguments);c(j,b,a);return d}})})};var x=function(){return!0},A=function(){return!1},n=/^([A-Z]|layer[XY]$)/,s={preventDefault:"isDefaultPrevented", +stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};b.fn.delegate=function(c,g,j){return this.each(function(n,k){a(k,g,j,c,function(a){return function(h){var g,j=b(h.target).closest(c,k).get(0);if(j)return g=b.extend(e(h),{currentTarget:j,liveFired:k}),a.apply(j,[g].concat([].slice.call(arguments,1)))}})})};b.fn.undelegate=function(a,b,e){return this.each(function(){c(this,b,e,a)})};b.fn.live=function(a,c){b(document.body).delegate(this.selector,a,c);return this}; +b.fn.die=function(a,c){b(document.body).undelegate(this.selector,a,c);return this};b.fn.on=function(a,c,e){return!c||b.isFunction(c)?this.bind(a,c||e):this.delegate(c,a,e)};b.fn.off=function(a,c,e){return!c||b.isFunction(c)?this.unbind(a,c||e):this.undelegate(c,a,e)};b.fn.trigger=function(a,c){if("string"==typeof a||b.isPlainObject(a))a=b.Event(a);var e=a;if(!("defaultPrevented"in e)){e.defaultPrevented=!1;var g=e.preventDefault;e.preventDefault=function(){this.defaultPrevented=!0;g.call(this)}}a.data= +c;return this.each(function(){"dispatchEvent"in this&&this.dispatchEvent(a)})};b.fn.triggerHandler=function(a,c){var g,j;this.each(function(n,r){g=e("string"==typeof a?b.Event(a):a);g.data=c;g.target=r;b.each(q(r,a.type||a),function(a,b){j=b.proxy(g);if(g.isImmediatePropagationStopped())return!1})});return j};"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(a){b.fn[a]= +function(b){return b?this.bind(a,b):this.trigger(a)}});["focus","blur"].forEach(function(a){b.fn[a]=function(b){b?this.bind(a,b):this.each(function(){try{this[a]()}catch(b){}});return this}});b.Event=function(a,b){"string"!=typeof a&&(b=a,a=b.type);var c=document.createEvent(k[a]||"Events"),e=!0;if(b)for(var g in b)"bubbles"==g?e=!!b[g]:c[g]=b[g];c.initEvent(a,e,!0,null,null,null,null,null,null,null,null,null,null,null,null);c.isDefaultPrevented=function(){return this.defaultPrevented};return c}})(Zepto); +(function(b,l){function q(a){return a.toLowerCase()}var p="",m,a=window.document.createElement("div"),c=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,e,g,j,k,w,x,A,n={};b.each({Webkit:"webkit",Moz:"",O:"o",ms:"MS"},function(b,c){if(a.style[b+"TransitionProperty"]!==l)return p="-"+q(b)+"-",m=c,!1});e=p+"transform";n[g=p+"transition-property"]=n[j=p+"transition-duration"]=n[k=p+"transition-timing-function"]=n[w=p+"animation-name"]=n[x=p+"animation-duration"]=n[A=p+"animation-timing-function"]= +"";b.fx={off:m===l&&a.style.transitionProperty===l,speeds:{_default:400,fast:200,slow:600},cssPrefix:p,transitionEnd:m?m+"TransitionEnd":q("TransitionEnd"),animationEnd:m?m+"AnimationEnd":q("AnimationEnd")};b.fn.animate=function(a,c,e,g){b.isObject(c)&&(e=c.easing,g=c.complete,c=c.duration);c&&(c=("number"==typeof c?c:b.fx.speeds[c]||b.fx.speeds._default)/1E3);return this.anim(a,c,e,g)};b.fn.anim=function(a,d,m,p){var u,v={},r,h="",B=this,C,D=b.fx.transitionEnd;d===l&&(d=0.4);b.fx.off&&(d=0);if("string"== +typeof a)v[w]=a,v[x]=d+"s",v[A]=m||"linear",D=b.fx.animationEnd;else{r=[];for(u in a)c.test(u)?h+=u+"("+a[u]+") ":(v[u]=a[u],r.push(q(u.replace(/([a-z])([A-Z])/,"$1-$2"))));h&&(v[e]=h,r.push(e));0=d&&setTimeout(function(){B.each(function(){C.call(this)})}, +0);return this};a=null})(Zepto); +(function(b){function l(a,c,e,d){if(a.global)return a=c||w,e=b.Event(e),b(a).trigger(e,d),!e.defaultPrevented}function q(a,b,c){var e=c.context;c.success.call(e,a,"success",b);l(c,e,"ajaxSuccess",[b,c,a]);m("success",b,c)}function p(a,b,c,e){var d=e.context;e.error.call(d,c,b,a);l(e,d,"ajaxError",[c,e,a]);m(b,c,e)}function m(a,c,e){var d=e.context;e.complete.call(d,c,a);l(e,d,"ajaxComplete",[c,e]);e.global&&!--b.active&&l(e,null,"ajaxStop")}function a(){}function c(a){return a&&(a==z?"html":a==y? +"json":s.test(a)?"script":d.test(a)&&"xml")||"text"}function e(a){a.processData&&k(a.data)&&(a.data=b.param(a.data,a.traditional));if(a.data&&(!a.type||"GET"==a.type.toUpperCase()))a.url=(a.url+"&"+a.data).replace(/[&?]{1,2}/,"?")}function g(a,c,e,d){var j=b.isArray(c);b.each(c,function(c,h){d&&(c=e?d:d+"["+(j?"":c)+"]");!d&&j?a.add(h.name,h.value):(e?b.isArray(h):k(h))?g(a,h,e,c):a.add(c,h)})}var j=0,k=b.isObject,w=window.document,x,A,n=/)<[^<]*)*<\/script>/gi,s=/^(?:text|application)\/javascript/i, +d=/^(?:text|application)\/xml/i,y="application/json",z="text/html",u=/^\s*$/;b.active=0;b.ajaxJSONP=function(c){if(!("type"in c))return b.ajax(c);var d="jsonp"+ ++j,g=w.createElement("script"),n={abort:function(){b(g).remove();d in window&&(window[d]=a);m("abort",n,c)}},k;c.error&&(g.onerror=function(){n.abort();c.error()});window[d]=function(a){clearTimeout(k);b(g).remove();delete window[d];q(a,n,c)};e(c);g.src=c.url.replace(/=\?/,"="+d);b("head").append(g);0k.status||304==k.status||0==k.status&&"file:"==n){g=g||c(k.getResponseHeader("content-type"));a=k.responseText;try{"script"==g?(0,eval)(a):"xml"==g?a=k.responseXML:"json"== +g&&(a=u.test(a)?null:b.parseJSON(a))}catch(d){e=d}e?p(e,"parsererror",k,h):q(a,k,h)}else p(null,"error",k,h)}};k.open(h.type,h.url,"async"in h?h.async:!0);for(A in h.headers)k.setRequestHeader(A,h.headers[A]);d=h.context;!1===h.beforeSend.call(d,k,h)||!1===l(h,d,"ajaxBeforeSend",[k,h])?d=!1:(l(h,d,"ajaxSend",[k,h]),d=void 0);if(!1===d)return k.abort(),!1;0").html(a.replace(n,"")).find(g):a);c&&c.apply(e,arguments)});return this};var v=encodeURIComponent;b.param= +function(a,c){var b=[];b.add=function(a,c){this.push(v(a)+"="+v(c))};g(b,a,c);return b.join("&").replace(/%20/g,"+")}})(Zepto); +(function(b){function l(e,g){var j=e[c],j=j&&p[j];if(void 0===g)return j||q(e);if(j){if(g in j)return j[g];var k=a(g);if(k in j)return j[k]}return m.call(b(e),g)}function q(e,g,j){var k=e[c]||(e[c]=++b.uuid),l;if(!(l=p[k])){l=p;var m={};b.each(e.attributes,function(c,e){0==e.name.indexOf("data-")&&(m[a(e.name.replace("data-",""))]=b.zepto.deserializeValue(e.value))});l=l[k]=m}e=l;void 0!==g&&(e[a(g)]=j);return e}var p={},m=b.fn.data,a=b.camelCase,c=b.expando="Zepto"+ +new Date;b.fn.data=function(a, +c){return void 0===c?b.isPlainObject(a)?this.each(function(c,g){b.each(a,function(a,c){q(g,a,c)})}):0==this.length?void 0:l(this[0],a):this.each(function(){q(this,a,c)})};b.fn.removeData=function(e){"string"==typeof e&&(e=e.split(/\s+/));return this.each(function(){var g=this[c],j=g&&p[g];j&&b.each(e,function(){delete j[a(this)]})})}})(Zepto); +(function(b,l){function q(a,c,j,k,m){"function"==typeof c&&!m&&(m=c,c=l);j={opacity:j};k&&(j.scale=k,a.css(b.fx.cssPrefix+"transform-origin","0 0"));return a.animate(j,c,null,m)}function p(c,g,j,k){return q(c,g,0,j,function(){a.call(b(this));k&&k.call(this)})}var m=b.fn.show,a=b.fn.hide,c=b.fn.toggle;b.fn.show=function(a,c){m.call(this);a===l?a=0:this.css("opacity",0);return q(this,a,1,"1,1",c)};b.fn.hide=function(c,b){return c===l?a.call(this):p(this,c,"0,0",b)};b.fn.toggle=function(a,g){return a=== +l||"boolean"==typeof a?c.call(this,a):this.each(function(){var c=b(this);c["none"==c.css("display")?"show":"hide"](a,g)})};b.fn.fadeTo=function(a,c,b){return q(this,a,c,null,b)};b.fn.fadeIn=function(a,c){var b=this.css("opacity");0=c},maxlength:function(a,c){return a.length<=c},rangelength:function(a,c){return this.minlength(a,c[0])&&this.maxlength(a,c[1])}, +min:function(a,c){return Number(a)>=c},max:function(a,c){return Number(a)<=c},range:function(a,c){return a>=c[0]&&a<=c[1]},equalto:function(a,c,e){e.options.validateIfUnchanged=!0;return a===b(c).val()},remote:function(a,c,e){var g={},j={};g[e.$element.attr("name")]=a;"undefined"!==typeof e.options.remoteDatatype&&(j={dataType:e.options.remoteDatatype});var k=function(a,c){"undefined"!==typeof c&&("undefined"!==typeof e.Validator.messages.remote&&c!==e.Validator.messages.remote)&&b(e.ulError+" .remote").remove(); +e.updtConstraint({name:"remote",valid:a},c);e.manageValidationResult()},m=function(a){if("object"===typeof a)return a;try{a=b.parseJSON(a)}catch(c){}return a},l=function(a){return"object"===typeof a&&null!==a?"undefined"!==typeof a.error?a.error:"undefined"!==typeof a.message?a.message:null:null};b.ajax(b.extend({},{url:c,data:g,type:e.options.remoteMethod||"GET",success:function(a){a=m(a);k(1===a||!0===a||"object"===typeof a&&null!==a&&"undefined"!==typeof a.success,l(a))},error:function(a){a=m(a); +k(!1,l(a))}},j));return null},mincheck:function(a,c){return this.minlength(a,c)},maxcheck:function(a,c){return this.maxlength(a,c)},rangecheck:function(a,c){return this.rangelength(a,c)}},init:function(a){var c=a.validators;a=a.messages;for(var b in c)this.addValidator(b,c[b]);for(b in a)this.addMessage(b,a[b])},formatMesssage:function(a,c){if("object"===typeof c){for(var b in c)a=this.formatMesssage(a,c[b]);return a}return"string"===typeof a?a.replace(/%s/i,c):""},addValidator:function(a,c){this.validators[a]= +c},addMessage:function(a,c,b){if("undefined"!==typeof b&&!0===b)this.messages.type[a]=c;else if("type"===a)for(var g in c)this.messages.type[g]=c[g];else this.messages[a]=c}};var q=function(a,c,b){this.options=c;this.Validator=new l(c);if("ParsleyFieldMultiple"===b)return this;this.init(a,b||"ParsleyField")};q.prototype={constructor:q,init:function(a,c){this.type=c;this.valid=!0;this.element=a;this.validatedOnce=!1;this.$element=b(a);this.val=this.$element.val();this.isRequired=!1;this.constraints= +{};"undefined"===typeof this.isRadioOrCheckbox&&(this.isRadioOrCheckbox=!1,this.hash=this.generateHash(),this.errorClassHandler=this.options.errors.classHandler(a,this.isRadioOrCheckbox)||this.$element);this.ulErrorManagement();this.bindHtml5Constraints();this.addConstraints();this.hasConstraints()&&this.bindValidationEvents()},setParent:function(a){this.$parent=b(a)},getParent:function(){return this.$parent},bindHtml5Constraints:function(){if(this.$element.hasClass("required")||this.$element.prop("required"))this.options.required= +!0;"undefined"!==typeof this.$element.attr("type")&&RegExp(this.$element.attr("type"),"i").test("email url number range")&&(this.options.type=this.$element.attr("type"),RegExp(this.options.type,"i").test("number range")&&(this.options.type="number","undefined"!==typeof this.$element.attr("min")&&this.$element.attr("min").length&&(this.options.min=this.$element.attr("min")),"undefined"!==typeof this.$element.attr("max")&&this.$element.attr("max").length&&(this.options.max=this.$element.attr("max")))); +"string"===typeof this.$element.attr("pattern")&&this.$element.attr("pattern").length&&(this.options.regexp=this.$element.attr("pattern"))},addConstraints:function(){for(var a in this.options){var c={};c[a]=this.options[a];this.addConstraint(c,!0)}},addConstraint:function(a,c){for(var b in a)b=b.toLowerCase(),"function"===typeof this.Validator.validators[b]&&(this.constraints[b]={name:b,requirements:a[b],valid:null},"required"===b&&(this.isRequired=!0),this.addCustomConstraintMessage(b));"undefined"=== +typeof c&&this.bindValidationEvents()},updateConstraint:function(a,c){for(var b in a)this.updtConstraint({name:b,requirements:a[b],valid:null},c)},updtConstraint:function(a,c){this.constraints[a.name]=b.extend(!0,this.constraints[a.name],a);"string"===typeof c&&(this.Validator.messages[a.name]=c);this.bindValidationEvents()},removeConstraint:function(a){a=a.toLowerCase();delete this.constraints[a];"required"===a&&(this.isRequired=!1);this.hasConstraints()?this.bindValidationEvents():"ParsleyForm"=== +typeof this.getParent()?this.getParent().removeItem(this.$element):this.destroy()},addCustomConstraintMessage:function(a){var c=a+("type"===a&&"undefined"!==typeof this.options[a]?this.options[a].charAt(0).toUpperCase()+this.options[a].substr(1):"")+"Message";"undefined"!==typeof this.options[c]&&this.Validator.addMessage("type"===a?this.options[a]:a,this.options[c],"type"===a)},bindValidationEvents:function(){this.valid=null;this.$element.addClass("parsley-validated");this.$element.off("."+this.type); +this.options.remote&&!/change/i.test(this.options.trigger)&&(this.options.trigger=!this.options.trigger?"change":" change");var a=(!this.options.trigger?"":this.options.trigger)+(/key/i.test(this.options.trigger)?"":" keyup");this.$element.is("select")&&(a+=/change/i.test(a)?"":" change");a=a.replace(/^\s+/g,"").replace(/\s+$/g,"");this.$element.on((a+" ").split(" ").join("."+this.type+" "),!1,b.proxy(this.eventValidation,this))},generateHash:function(){return"parsley-"+(Math.random()+"").substring(2)}, +getHash:function(){return this.hash},getVal:function(){return this.$element.data("value")||this.$element.val()},eventValidation:function(a){var c=this.getVal();if("keyup"===a.type&&!/keyup/i.test(this.options.trigger)&&!this.validatedOnce||"change"===a.type&&!/change/i.test(this.options.trigger)&&!this.validatedOnce||!this.isRadioOrCheckbox&&c.length",errorElem:"
  • "},listeners:{onFieldValidate:function(){return!1},onFormSubmit:function(){},onFieldError:function(){},onFieldSuccess:function(){}}};b(window).on("load",function(){b('[data-validate="parsley"]').each(function(){b(this).parsley()})})}(window.jQuery|| +window.Zepto); diff --git a/ajax/libs/parsley.js/1.1.16/parsley.extend.min.js b/ajax/libs/parsley.js/1.1.16/parsley.extend.min.js new file mode 100755 index 000000000..a301110bd --- /dev/null +++ b/ajax/libs/parsley.js/1.1.16/parsley.extend.min.js @@ -0,0 +1,6 @@ +/* Parsley dist/parsley.extend.min.js build version 1.1.16 http://parsleyjs.org */ +window.ParsleyConfig=window.ParsleyConfig||{}; +(function(d){window.ParsleyConfig=d.extend(!0,{},window.ParsleyConfig,{validators:{minwords:function(a,b){a=a.replace(/(^\s*)|(\s*$)/gi,"");a=a.replace(/[ ]{2,}/gi," ");a=a.replace(/\n /,"\n");a=a.split(" ").length;return a>=b},maxwords:function(a,b){a=a.replace(/(^\s*)|(\s*$)/gi,"");a=a.replace(/[ ]{2,}/gi," ");a=a.replace(/\n /,"\n");a=a.split(" ").length;return a<=b},rangewords:function(a,b){a=a.replace(/(^\s*)|(\s*$)/gi,"");a=a.replace(/[ ]{2,}/gi," ");a=a.replace(/\n /,"\n");a=a.split(" ").length; +return a>=b[0]&&a<=b[1]},greaterthan:function(a,b,c){c.options.validateIfUnchanged=!0;return new Number(a)>new Number(d(b).val())},lessthan:function(a,b,c){c.options.validateIfUnchanged=!0;return new Number(a)a?c+a:c+(a-9)):c+=a;return 0===c%10},americandate:function(a){if(!/^([01]?[1-9])[\.\/-]([0-3]?[0-9])[\.\/-]([0-9]{4}|[0-9]{2})$/.test(a))return!1;var b=a.split(/[.\/-]+/);a=parseInt(b[1],10);var c=parseInt(b[0],10),b=parseInt(b[2],10);if(0==b||0==c||12=b},maxlength:function(a,b){return a.length<=b},rangelength:function(a,b){return this.minlength(a,b[0])&&this.maxlength(a,b[1])}, +min:function(a,b){return Number(a)>=b},max:function(a,b){return Number(a)<=b},range:function(a,b){return a>=b[0]&&a<=b[1]},equalto:function(a,b,c){c.options.validateIfUnchanged=!0;return a===d(b).val()},remote:function(a,b,c){var f={},g={};f[c.$element.attr("name")]=a;"undefined"!==typeof c.options.remoteDatatype&&(g={dataType:c.options.remoteDatatype});var m=function(a,b){"undefined"!==typeof b&&("undefined"!==typeof c.Validator.messages.remote&&b!==c.Validator.messages.remote)&&d(c.ulError+" .remote").remove(); +c.updtConstraint({name:"remote",valid:a},b);c.manageValidationResult()},n=function(a){if("object"===typeof a)return a;try{a=d.parseJSON(a)}catch(b){}return a},e=function(a){return"object"===typeof a&&null!==a?"undefined"!==typeof a.error?a.error:"undefined"!==typeof a.message?a.message:null:null};d.ajax(d.extend({},{url:b,data:f,type:c.options.remoteMethod||"GET",success:function(a){a=n(a);m(1===a||!0===a||"object"===typeof a&&null!==a&&"undefined"!==typeof a.success,e(a))},error:function(a){a=n(a); +m(!1,e(a))}},g));return null},mincheck:function(a,b){return this.minlength(a,b)},maxcheck:function(a,b){return this.maxlength(a,b)},rangecheck:function(a,b){return this.rangelength(a,b)}},init:function(a){var b=a.validators;a=a.messages;for(var c in b)this.addValidator(c,b[c]);for(c in a)this.addMessage(c,a[c])},formatMesssage:function(a,b){if("object"===typeof b){for(var c in b)a=this.formatMesssage(a,b[c]);return a}return"string"===typeof a?a.replace(/%s/i,b):""},addValidator:function(a,b){this.validators[a]= +b},addMessage:function(a,b,c){if("undefined"!==typeof c&&!0===c)this.messages.type[a]=b;else if("type"===a)for(var d in b)this.messages.type[d]=b[d];else this.messages[a]=b}};var j=function(a,b,c){this.options=b;this.Validator=new h(b);if("ParsleyFieldMultiple"===c)return this;this.init(a,c||"ParsleyField")};j.prototype={constructor:j,init:function(a,b){this.type=b;this.valid=!0;this.element=a;this.validatedOnce=!1;this.$element=d(a);this.val=this.$element.val();this.isRequired=!1;this.constraints= +{};"undefined"===typeof this.isRadioOrCheckbox&&(this.isRadioOrCheckbox=!1,this.hash=this.generateHash(),this.errorClassHandler=this.options.errors.classHandler(a,this.isRadioOrCheckbox)||this.$element);this.ulErrorManagement();this.bindHtml5Constraints();this.addConstraints();this.hasConstraints()&&this.bindValidationEvents()},setParent:function(a){this.$parent=d(a)},getParent:function(){return this.$parent},bindHtml5Constraints:function(){if(this.$element.hasClass("required")||this.$element.prop("required"))this.options.required= +!0;"undefined"!==typeof this.$element.attr("type")&&RegExp(this.$element.attr("type"),"i").test("email url number range")&&(this.options.type=this.$element.attr("type"),RegExp(this.options.type,"i").test("number range")&&(this.options.type="number","undefined"!==typeof this.$element.attr("min")&&this.$element.attr("min").length&&(this.options.min=this.$element.attr("min")),"undefined"!==typeof this.$element.attr("max")&&this.$element.attr("max").length&&(this.options.max=this.$element.attr("max")))); +"string"===typeof this.$element.attr("pattern")&&this.$element.attr("pattern").length&&(this.options.regexp=this.$element.attr("pattern"))},addConstraints:function(){for(var a in this.options){var b={};b[a]=this.options[a];this.addConstraint(b,!0)}},addConstraint:function(a,b){for(var c in a)c=c.toLowerCase(),"function"===typeof this.Validator.validators[c]&&(this.constraints[c]={name:c,requirements:a[c],valid:null},"required"===c&&(this.isRequired=!0),this.addCustomConstraintMessage(c));"undefined"=== +typeof b&&this.bindValidationEvents()},updateConstraint:function(a,b){for(var c in a)this.updtConstraint({name:c,requirements:a[c],valid:null},b)},updtConstraint:function(a,b){this.constraints[a.name]=d.extend(!0,this.constraints[a.name],a);"string"===typeof b&&(this.Validator.messages[a.name]=b);this.bindValidationEvents()},removeConstraint:function(a){a=a.toLowerCase();delete this.constraints[a];"required"===a&&(this.isRequired=!1);this.hasConstraints()?this.bindValidationEvents():"ParsleyForm"=== +typeof this.getParent()?this.getParent().removeItem(this.$element):this.destroy()},addCustomConstraintMessage:function(a){var b=a+("type"===a&&"undefined"!==typeof this.options[a]?this.options[a].charAt(0).toUpperCase()+this.options[a].substr(1):"")+"Message";"undefined"!==typeof this.options[b]&&this.Validator.addMessage("type"===a?this.options[a]:a,this.options[b],"type"===a)},bindValidationEvents:function(){this.valid=null;this.$element.addClass("parsley-validated");this.$element.off("."+this.type); +this.options.remote&&!/change/i.test(this.options.trigger)&&(this.options.trigger=!this.options.trigger?"change":" change");var a=(!this.options.trigger?"":this.options.trigger)+(/key/i.test(this.options.trigger)?"":" keyup");this.$element.is("select")&&(a+=/change/i.test(a)?"":" change");a=a.replace(/^\s+/g,"").replace(/\s+$/g,"");this.$element.on((a+" ").split(" ").join("."+this.type+" "),!1,d.proxy(this.eventValidation,this))},generateHash:function(){return"parsley-"+(Math.random()+"").substring(2)}, +getHash:function(){return this.hash},getVal:function(){return this.$element.data("value")||this.$element.val()},eventValidation:function(a){var b=this.getVal();if("keyup"===a.type&&!/keyup/i.test(this.options.trigger)&&!this.validatedOnce||"change"===a.type&&!/change/i.test(this.options.trigger)&&!this.validatedOnce||!this.isRadioOrCheckbox&&b.length",errorElem:"
  • "},listeners:{onFieldValidate:function(){return!1},onFormSubmit:function(){},onFieldError:function(){},onFieldSuccess:function(){}}};d(window).on("load",function(){d('[data-validate="parsley"]').each(function(){d(this).parsley()})})}(window.jQuery|| +window.Zepto); diff --git a/ajax/libs/parsley.js/package.json b/ajax/libs/parsley.js/package.json index 621f73c21..5d684e281 100644 --- a/ajax/libs/parsley.js/package.json +++ b/ajax/libs/parsley.js/package.json @@ -1,7 +1,7 @@ { "name": "parsley.js", "filename": "parsley.min.js", - "version": "1.1.10", + "version": "1.1.16", "description": "Validate your forms without writing a single line of javascript", "homepage": "http://parsleyjs.org/", "keywords": [