jquery-inputmask-rails 2.0.1 → 2.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/jquery-inputmask-rails/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.inputmask.bundle.js +2727 -0
- data/vendor/assets/javascripts/jquery.inputmask.bundle.min.js +92 -0
- data/vendor/assets/javascripts/jquery.inputmask.date.extensions.js +16 -479
- data/vendor/assets/javascripts/jquery.inputmask.extensions.js +4 -93
- data/vendor/assets/javascripts/jquery.inputmask.js +58 -1201
- data/vendor/assets/javascripts/jquery.inputmask.numeric.extensions.js +7 -128
- data/vendor/assets/javascripts/jquery.inputmask.phone.extensions.js +1 -0
- data/vendor/assets/javascripts/jquery.inputmask.regex.extensions.js +5 -0
- metadata +27 -44
@@ -0,0 +1,92 @@
|
|
1
|
+
/*
|
2
|
+
Input Mask plugin for jquery
|
3
|
+
http://github.com/RobinHerbots/jquery.inputmask
|
4
|
+
Copyright (c) 2010 - 2014 Robin Herbots
|
5
|
+
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
6
|
+
Version: 2.5.5
|
7
|
+
*/
|
8
|
+
(function(e){if(void 0===e.fn.inputmask){var a=function(a){var c=document.createElement("input");a="on"+a;var d=a in c;d||(c.setAttribute(a,"return;"),d="function"==typeof c[a]);return d},b=function(a,c,d){return(a=d.aliases[a])?(a.alias&&b(a.alias,void 0,d),e.extend(!0,d,a),e.extend(!0,d,c),!0):!1},f=function(a){function c(d){a.numericInput&&(d=d.split("").reverse().join(""));var b=!1,f=0,g=a.greedy,x=a.repeat;"*"==x&&(g=!1);1==d.length&&!1==g&&0!=x&&(a.placeholder="");d=e.map(d.split(""),function(d,
|
9
|
+
c){var e=[];if(d==a.escapeChar)b=!0;else if(d!=a.optionalmarker.start&&d!=a.optionalmarker.end||b){var g=a.definitions[d];if(g&&!b)for(var x=0;x<g.cardinality;x++)e.push(a.placeholder.charAt((f+x)%a.placeholder.length));else e.push(d),b=!1;f+=e.length;return e}});for(var h=d.slice(),T=1;T<x&&g;T++)h=h.concat(d.slice());return{mask:h,repeat:x,greedy:g}}function d(d){a.numericInput&&(d=d.split("").reverse().join(""));var c=!1,b=!1,f=!1;return e.map(d.split(""),function(d,e){var g=[];if(d==a.escapeChar)b=
|
10
|
+
!0;else{if(d!=a.optionalmarker.start||b){if(d!=a.optionalmarker.end||b){var x=a.definitions[d];if(x&&!b){for(var h=x.prevalidator,T=h?h.length:0,m=1;m<x.cardinality;m++){var z=T>=m?h[m-1]:[],k=z.validator,z=z.cardinality;g.push({fn:k?"string"==typeof k?RegExp(k):new function(){this.test=k}:/./,cardinality:z?z:1,optionality:c,newBlockMarker:!0==c?f:!1,offset:0,casing:x.casing,def:x.definitionSymbol||d});!0==c&&(f=!1)}g.push({fn:x.validator?"string"==typeof x.validator?RegExp(x.validator):new function(){this.test=
|
11
|
+
x.validator}:/./,cardinality:x.cardinality,optionality:c,newBlockMarker:f,offset:0,casing:x.casing,def:x.definitionSymbol||d})}else g.push({fn:null,cardinality:0,optionality:c,newBlockMarker:f,offset:0,casing:null,def:d}),b=!1;f=!1;return g}c=!1}else c=!0;f=!0}})}function f(d){for(var c=d.length,e=0;e<c&&d.charAt(e)!=a.optionalmarker.start;e++);var b=[d.substring(0,e)];e<c&&b.push(d.substring(e+1,c));return b}function b(m,k,l){for(var r=0,u=0,n=k.length,p=0;p<n&&!(k.charAt(p)==a.optionalmarker.start&&
|
12
|
+
r++,k.charAt(p)==a.optionalmarker.end&&u++,0<r&&r==u);p++);r=[k.substring(0,p)];p<n&&r.push(k.substring(p+1,n));p=f(r[0]);1<p.length?(k=m+p[0]+(a.optionalmarker.start+p[1]+a.optionalmarker.end)+(1<r.length?r[1]:""),-1==e.inArray(k,h)&&""!=k&&(h.push(k),n=c(k),g.push({mask:k,_buffer:n.mask,buffer:n.mask.slice(),tests:d(k),lastValidPosition:-1,greedy:n.greedy,repeat:n.repeat,metadata:l})),k=m+p[0]+(1<r.length?r[1]:""),-1==e.inArray(k,h)&&""!=k&&(h.push(k),n=c(k),g.push({mask:k,_buffer:n.mask,buffer:n.mask.slice(),
|
13
|
+
tests:d(k),lastValidPosition:-1,greedy:n.greedy,repeat:n.repeat,metadata:l})),1<f(p[1]).length&&b(m+p[0],p[1]+r[1],l),1<r.length&&1<f(r[1]).length&&(b(m+p[0]+(a.optionalmarker.start+p[1]+a.optionalmarker.end),r[1],l),b(m+p[0],r[1],l))):(k=m+r,-1==e.inArray(k,h)&&""!=k&&(h.push(k),n=c(k),g.push({mask:k,_buffer:n.mask,buffer:n.mask.slice(),tests:d(k),lastValidPosition:-1,greedy:n.greedy,repeat:n.repeat,metadata:l})))}var g=[],h=[];e.isFunction(a.mask)&&(a.mask=a.mask.call(this,a));e.isArray(a.mask)?
|
14
|
+
e.each(a.mask,function(a,d){void 0!=d.mask?b("",d.mask.toString(),d):b("",d.toString())}):b("",a.mask.toString());return a.greedy?g:g.sort(function(a,d){return a.mask.length-d.mask.length})},g="function"===typeof ScriptEngineMajorVersion?ScriptEngineMajorVersion():10<=(new Function("/*@cc_on return @_jscript_version; @*/"))(),c=navigator.userAgent,h=null!==c.match(/iphone/i),k=null!==c.match(/android.*safari.*/i),l=null!==c.match(/android.*chrome.*/i),u=null!==c.match(/android.*firefox.*/i),M=/Kindle/i.test(c)||
|
15
|
+
/Silk/i.test(c)||/KFTT/i.test(c)||/KFOT/i.test(c)||/KFJWA/i.test(c)||/KFJWI/i.test(c)||/KFSOWI/i.test(c)||/KFTHWA/i.test(c)||/KFTHWI/i.test(c)||/KFAPWA/i.test(c)||/KFAPWI/i.test(c),P=a("paste")?"paste":a("input")?"input":"propertychange",q=function(a,c,d,b){function f(){return a[c]}function q(){return f().tests}function t(){return f()._buffer}function m(){return f().buffer}function R(N,b,v){function y(a,c,f,N){for(var b=D(a),e=f?1:0,v="",da=c.buffer,y=c.tests[b].cardinality;y>e;y--)v+=H(da,b-(y-1));
|
16
|
+
f&&(v+=f);return null!=c.tests[b].fn?c.tests[b].fn.test(v,da,a,N,d):f==H(c._buffer.slice(),a,!0)||f==d.skipOptionalPartCharacter?{refresh:!0,c:H(c._buffer.slice(),a,!0),pos:a}:!1}if(v=!0===v){var g=y(N,f(),b,v);!0===g&&(g={pos:N});return g}var h=[],g=!1,k=c,z=m().slice(),t=f().lastValidPosition;F(N);var l=[];e.each(a,function(a,d){if("object"==typeof d){c=a;var e=N,B=f().lastValidPosition,q;if(B==t){if(1<e-t)for(B=-1==B?0:B;B<e&&(q=y(B,f(),z[B],!0),!1!==q);B++)G(m(),B,z[B],!0),!0===q&&(q={pos:B}),
|
17
|
+
q=q.pos||B,f().lastValidPosition<q&&(f().lastValidPosition=q);if(!r(e)&&!y(e,f(),b,v)){B=p(e)-e;for(q=0;q<B&&!1===y(++e,f(),b,v);q++);l.push(c)}}(f().lastValidPosition>=t||c==k)&&0<=e&&e<n()&&(g=y(e,f(),b,v),!1!==g&&(!0===g&&(g={pos:e}),q=g.pos||e,f().lastValidPosition<q&&(f().lastValidPosition=q)),h.push({activeMasksetIndex:a,result:g}))}});c=k;return function(c,d){var f=!1;e.each(d,function(a,d){if(f=-1==e.inArray(d.activeMasksetIndex,c)&&!1!==d.result)return!1});if(f)d=e.map(d,function(d,f){if(-1==
|
18
|
+
e.inArray(d.activeMasksetIndex,c))return d;a[d.activeMasksetIndex].lastValidPosition=t});else{var v=-1,g=-1,h;e.each(d,function(a,d){-1!=e.inArray(d.activeMasksetIndex,c)&&!1!==d.result&(-1==v||v>d.result.pos)&&(v=d.result.pos,g=d.activeMasksetIndex)});d=e.map(d,function(d,f){if(-1!=e.inArray(d.activeMasksetIndex,c)){if(d.result.pos==v)return d;if(!1!==d.result){for(var k=N;k<v;k++)if(h=y(k,a[d.activeMasksetIndex],a[g].buffer[k],!0),!1===h){a[d.activeMasksetIndex].lastValidPosition=v-1;break}else G(a[d.activeMasksetIndex].buffer,
|
19
|
+
k,a[g].buffer[k],!0),a[d.activeMasksetIndex].lastValidPosition=k;h=y(v,a[d.activeMasksetIndex],b,!0);!1!==h&&(G(a[d.activeMasksetIndex].buffer,v,b,!0),a[d.activeMasksetIndex].lastValidPosition=v);return d}}})}return d}(l,h)}function ba(){var d=c,b={activeMasksetIndex:0,lastValidPosition:-1,next:-1};e.each(a,function(a,d){"object"==typeof d&&(c=a,f().lastValidPosition>b.lastValidPosition?(b.activeMasksetIndex=a,b.lastValidPosition=f().lastValidPosition,b.next=p(f().lastValidPosition)):f().lastValidPosition==
|
20
|
+
b.lastValidPosition&&(-1==b.next||b.next>p(f().lastValidPosition))&&(b.activeMasksetIndex=a,b.lastValidPosition=f().lastValidPosition,b.next=p(f().lastValidPosition)))});c=-1!=b.lastValidPosition&&a[d].lastValidPosition==b.lastValidPosition?d:b.activeMasksetIndex;d!=c&&(W(m(),p(b.lastValidPosition),n()),f().writeOutBuffer=!0);s.data("_inputmask").activeMasksetIndex=c}function r(a){a=D(a);a=q()[a];return void 0!=a?a.fn:!1}function D(a){return a%q().length}function n(){var a=t(),c=f().greedy,b=f().repeat,
|
21
|
+
y=m();if(e.isFunction(d.getMaskLength))return d.getMaskLength(a,c,b,y,d);var g=a.length;c||("*"==b?g=y.length+1:1<b&&(g+=a.length*(b-1)));return g}function p(a){var d=n();if(a>=d)return d;for(;++a<d&&!r(a););return a}function F(a){if(0>=a)return 0;for(;0<--a&&!r(a););return a}function G(a,d,c,f){f&&(d=ca(a,d));f=q()[D(d)];var b=c;if(void 0!=b&&void 0!=f)switch(f.casing){case "upper":b=c.toUpperCase();break;case "lower":b=c.toLowerCase()}a[d]=b}function H(a,d,c){c&&(d=ca(a,d));return a[d]}function ca(a,
|
22
|
+
d){for(var c;void 0==a[d]&&a.length<n();)for(c=0;void 0!==t()[c];)a.push(t()[c++]);return d}function I(a,d,c){a._valueSet(d.join(""));void 0!=c&&w(a,c)}function W(a,d,c,f){for(var b=n();d<c&&d<b;d++)!0===f?r(d)||G(a,d,""):G(a,d,H(t().slice(),d,!0))}function U(a,d){var c=D(d);G(a,d,H(t(),c))}function O(a){return d.placeholder.charAt(a%d.placeholder.length)}function J(d,b,v,g,h){g=void 0!=g?g.slice():X(d._valueGet()).split("");e.each(a,function(a,d){"object"==typeof d&&(d.buffer=d._buffer.slice(),d.lastValidPosition=
|
23
|
+
-1,d.p=-1)});!0!==v&&(c=0);b&&d._valueSet("");n();e.each(g,function(a,c){if(!0===h){var g=f().p,g=-1==g?g:F(g),y=-1==g?a:p(g);-1==e.inArray(c,t().slice(g+1,y))&&V.call(d,void 0,!0,c.charCodeAt(0),b,v,a)}else V.call(d,void 0,!0,c.charCodeAt(0),b,v,a),v=v||0<a&&a>f().p});!0===v&&-1!=f().p&&(f().lastValidPosition=F(f().p))}function ea(a){return e.inputmask.escapeRegex.call(this,a)}function X(a){return a.replace(RegExp("("+ea(t().join(""))+")*$"),"")}function Y(a){var d=m(),c=d.slice(),f,b;for(b=c.length-
|
24
|
+
1;0<=b;b--)if(f=D(b),q()[f].optionality)if(r(b)&&R(b,d[b],!0))break;else c.pop();else break;I(a,c)}function la(a,c){if(!q()||!0!==c&&a.hasClass("hasDatepicker"))return a[0]._valueGet();var f=e.map(m(),function(a,d){return r(d)&&R(d,a,!0)?a:null}),f=(A?f.reverse():f).join("");return e.isFunction(d.onUnMask)?d.onUnMask.call(a,m().join(""),f,d):f}function K(a){!A||"number"!=typeof a||d.greedy&&""==d.placeholder||(a=m().length-a);return a}function w(a,c,f){var b=a.jquery&&0<a.length?a[0]:a;if("number"==
|
25
|
+
typeof c)c=K(c),f=K(f),e(b).is(":visible")&&(f="number"==typeof f?f:c,b.scrollLeft=b.scrollWidth,!1==d.insertMode&&c==f&&f++,b.setSelectionRange?(b.selectionStart=c,b.selectionEnd=f):b.createTextRange&&(a=b.createTextRange(),a.collapse(!0),a.moveEnd("character",f),a.moveStart("character",c),a.select()));else{if(!e(a).is(":visible"))return{begin:0,end:0};b.setSelectionRange?(c=b.selectionStart,f=b.selectionEnd):document.selection&&document.selection.createRange&&(a=document.selection.createRange(),
|
26
|
+
c=0-a.duplicate().moveStart("character",-1E5),f=c+a.text.length);c=K(c);f=K(f);return{begin:c,end:f}}}function Q(f){if(e.isFunction(d.isComplete))return d.isComplete.call(s,f,d);if("*"!=d.repeat){var b=!1,g=0,y=c;e.each(a,function(a,d){if("object"==typeof d){c=a;var e=F(n());if(d.lastValidPosition>=g&&d.lastValidPosition==e){for(var y=!0,h=0;h<=e;h++){var k=r(h),m=D(h);if(k&&(void 0==f[h]||f[h]==O(h))||!k&&f[h]!=t()[m]){y=!1;break}}if(b=b||y)return!1}g=d.lastValidPosition}});c=y;return b}}function ma(a){a=
|
27
|
+
e._data(a).events;e.each(a,function(a,d){e.each(d,function(a,d){if("inputmask"==d.namespace&&"setvalue"!=d.type){var c=d.handler;d.handler=function(a){if(this.readOnly||this.disabled)a.preventDefault;else return c.apply(this,arguments)}}})})}function na(a){function d(a){if(void 0==e.valHooks[a]||!0!=e.valHooks[a].inputmaskpatch){var c=e.valHooks[a]&&e.valHooks[a].get?e.valHooks[a].get:function(a){return a.value},f=e.valHooks[a]&&e.valHooks[a].set?e.valHooks[a].set:function(a,d){a.value=d;return a};
|
28
|
+
e.valHooks[a]={get:function(a){var d=e(a);if(d.data("_inputmask")){if(d.data("_inputmask").opts.autoUnmask)return d.inputmask("unmaskedvalue");a=c(a);d=d.data("_inputmask");return a!=d.masksets[d.activeMasksetIndex]._buffer.join("")?a:""}return c(a)},set:function(a,d){var c=e(a),b=f(a,d);c.data("_inputmask")&&c.triggerHandler("setvalue.inputmask");return b},inputmaskpatch:!0}}}var c;Object.getOwnPropertyDescriptor&&(c=Object.getOwnPropertyDescriptor(a,"value"));if(c&&c.get){if(!a._valueGet){var f=
|
29
|
+
c.get,b=c.set;a._valueGet=function(){return A?f.call(this).split("").reverse().join(""):f.call(this)};a._valueSet=function(a){b.call(this,A?a.split("").reverse().join(""):a)};Object.defineProperty(a,"value",{get:function(){var a=e(this),d=e(this).data("_inputmask"),c=d.masksets,b=d.activeMasksetIndex;return d&&d.opts.autoUnmask?a.inputmask("unmaskedvalue"):f.call(this)!=c[b]._buffer.join("")?f.call(this):""},set:function(a){b.call(this,a);e(this).triggerHandler("setvalue.inputmask")}})}}else document.__lookupGetter__&&
|
30
|
+
a.__lookupGetter__("value")?a._valueGet||(f=a.__lookupGetter__("value"),b=a.__lookupSetter__("value"),a._valueGet=function(){return A?f.call(this).split("").reverse().join(""):f.call(this)},a._valueSet=function(a){b.call(this,A?a.split("").reverse().join(""):a)},a.__defineGetter__("value",function(){var a=e(this),d=e(this).data("_inputmask"),c=d.masksets,b=d.activeMasksetIndex;return d&&d.opts.autoUnmask?a.inputmask("unmaskedvalue"):f.call(this)!=c[b]._buffer.join("")?f.call(this):""}),a.__defineSetter__("value",
|
31
|
+
function(a){b.call(this,a);e(this).triggerHandler("setvalue.inputmask")})):(a._valueGet||(a._valueGet=function(){return A?this.value.split("").reverse().join(""):this.value},a._valueSet=function(a){this.value=A?a.split("").reverse().join(""):a}),d(a.type))}function fa(a,d,c,b){var e=m();if(!1!==b)for(;!r(a)&&0<=a-1;)a--;for(b=a;b<d&&b<n();b++)if(r(b)){U(e,b);var g=p(b),h=H(e,g);if(h!=O(g))if(g<n()&&!1!==R(b,h,!0)&&q()[D(b)].def==q()[D(g)].def)G(e,b,h,!0);else if(r(b))break}else U(e,b);void 0!=c&&
|
32
|
+
G(e,F(d),c);if(!1==f().greedy){d=X(e.join("")).split("");e.length=d.length;b=0;for(c=e.length;b<c;b++)e[b]=d[b];0==e.length&&(f().buffer=t().slice())}return a}function ga(a,d,c){var b=m();if(H(b,a,!0)!=O(a))for(var e=F(d);e>a&&0<=e;e--)if(r(e)){var g=F(e),h=H(b,g);h!=O(g)&&!1!==R(e,h,!0)&&q()[D(e)].def==q()[D(g)].def&&(G(b,e,h,!0),U(b,g))}else U(b,e);void 0!=c&&H(b,a)==O(a)&&G(b,a,c);a=b.length;if(!1==f().greedy){c=X(b.join("")).split("");b.length=c.length;e=0;for(g=b.length;e<g;e++)b[e]=c[e];0==
|
33
|
+
b.length&&(f().buffer=t().slice())}return d-(a-b.length)}function ha(a,c,b){if(d.numericInput||A){switch(c){case d.keyCode.BACKSPACE:c=d.keyCode.DELETE;break;case d.keyCode.DELETE:c=d.keyCode.BACKSPACE}if(A){var e=b.end;b.end=b.begin;b.begin=e}}e=!0;b.begin==b.end?(e=c==d.keyCode.BACKSPACE?b.begin-1:b.begin,d.isNumeric&&""!=d.radixPoint&&m()[e]==d.radixPoint&&(b.begin=m().length-1==e?b.begin:c==d.keyCode.BACKSPACE?e:p(e),b.end=b.begin),e=!1,c==d.keyCode.BACKSPACE?b.begin--:c==d.keyCode.DELETE&&b.end++):
|
34
|
+
1!=b.end-b.begin||d.insertMode||(e=!1,c==d.keyCode.BACKSPACE&&b.begin--);W(m(),b.begin,b.end);var g=n();if(!1==d.greedy&&(isNaN(d.repeat)||0<d.repeat))fa(b.begin,g,void 0,!A&&c==d.keyCode.BACKSPACE&&!e);else{for(var h=b.begin,k=b.begin;k<b.end;k++)if(r(k)||!e)h=fa(b.begin,g,void 0,!A&&c==d.keyCode.BACKSPACE&&!e);e||(b.begin=h)}c=p(-1);W(m(),b.begin,b.end,!0);J(a,!1,!1,m());f().lastValidPosition<c?(f().lastValidPosition=-1,f().p=c):f().p=b.begin}function Z(a){$=!1;var c=this,b=e(c),g=a.keyCode,k=w(c);
|
35
|
+
g==d.keyCode.BACKSPACE||g==d.keyCode.DELETE||h&&127==g||a.ctrlKey&&88==g?(a.preventDefault(),88==g&&(L=m().join("")),ha(c,g,k),ba(),I(c,m(),f().p),c._valueGet()==t().join("")&&b.trigger("cleared"),d.showTooltip&&b.prop("title",f().mask)):g==d.keyCode.END||g==d.keyCode.PAGE_DOWN?setTimeout(function(){var b=p(f().lastValidPosition);d.insertMode||b!=n()||a.shiftKey||b--;w(c,a.shiftKey?k.begin:b,b)},0):g==d.keyCode.HOME&&!a.shiftKey||g==d.keyCode.PAGE_UP?w(c,0,a.shiftKey?k.begin:0):g==d.keyCode.ESCAPE||
|
36
|
+
90==g&&a.ctrlKey?(J(c,!0,!1,L.split("")),b.click()):g!=d.keyCode.INSERT||a.shiftKey||a.ctrlKey?!1!=d.insertMode||a.shiftKey||(g==d.keyCode.RIGHT?setTimeout(function(){var a=w(c);w(c,a.begin)},0):g==d.keyCode.LEFT&&setTimeout(function(){var a=w(c);w(c,a.begin-1)},0)):(d.insertMode=!d.insertMode,w(c,d.insertMode||k.begin!=n()?k.begin:k.begin-1));b=w(c);!0===d.onKeyDown.call(this,a,m(),d)&&w(c,b.begin,b.end);ia=-1!=e.inArray(g,d.ignorables)}function V(b,g,h,k,z,t){if(void 0==h&&$)return!1;$=!0;var q=
|
37
|
+
e(this);b=b||window.event;h=g?h:b.which||b.charCode||b.keyCode;if(!(!0===g||b.ctrlKey&&b.altKey)&&(b.ctrlKey||b.metaKey||ia))return!0;if(h){!0!==g&&46==h&&!1==b.shiftKey&&","==d.radixPoint&&(h=44);var l,s,r=String.fromCharCode(h);g?(h=z?t:f().lastValidPosition+1,l={begin:h,end:h}):l=w(this);t=A?1<l.begin-l.end||1==l.begin-l.end&&d.insertMode:1<l.end-l.begin||1==l.end-l.begin&&d.insertMode;var u=c;t&&(e.each(a,function(a,d){"object"==typeof d&&(c=a,f().undoBuffer=m().join(""))}),c=u,ha(this,d.keyCode.DELETE,
|
38
|
+
l),d.insertMode||e.each(a,function(a,d){"object"==typeof d&&(c=a,ga(l.begin,n()),f().lastValidPosition=p(f().lastValidPosition))}),c=u);var S=m().join("").indexOf(d.radixPoint);d.isNumeric&&!0!==g&&-1!=S&&(d.greedy&&l.begin<=S?(l.begin=F(l.begin),l.end=l.begin):r==d.radixPoint&&(l.begin=S,l.end=l.begin));var C=l.begin;h=R(C,r,z);!0===z&&(h=[{activeMasksetIndex:c,result:h}]);var E=-1;e.each(h,function(a,b){c=b.activeMasksetIndex;f().writeOutBuffer=!0;var e=b.result;if(!1!==e){var g=!1,h=m();!0!==e&&
|
39
|
+
(g=e.refresh,C=void 0!=e.pos?e.pos:C,r=void 0!=e.c?e.c:r);if(!0!==g){if(!0==d.insertMode){e=n();for(h=h.slice();H(h,e,!0)!=O(e)&&e>=C;)e=0==e?-1:F(e);e>=C?(ga(C,n(),r),h=f().lastValidPosition,e=p(h),e!=n()&&h>=C&&H(m().slice(),e,!0)!=O(e)&&(f().lastValidPosition=e)):f().writeOutBuffer=!1}else G(h,C,r,!0);if(-1==E||E>p(C))E=p(C)}else!z&&(h=C<n()?C+1:C,-1==E||E>h)&&(E=h);E>f().p&&(f().p=E)}});!0!==z&&(c=u,ba());if(!1!==k)if(e.each(h,function(a,d){if(d.activeMasksetIndex==c)return s=d,!1}),void 0!=s){var D=
|
40
|
+
this;setTimeout(function(){d.onKeyValidation.call(D,s.result,d)},0);if(f().writeOutBuffer&&!1!==s.result){var J=m();k=g?void 0:d.numericInput?C>S?F(E):r==d.radixPoint?E-1:F(E-1):E;I(this,J,k);!0!==g&&setTimeout(function(){!0===Q(J)&&q.trigger("complete");aa=!0;q.trigger("input")},0)}else t&&(f().buffer=f().undoBuffer.split(""))}else t&&(f().buffer=f().undoBuffer.split(""));d.showTooltip&&q.prop("title",f().mask);b&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}}function ja(a){var c=e(this),
|
41
|
+
b=a.keyCode,f=m();d.onKeyUp.call(this,a,f,d);b==d.keyCode.TAB&&d.showMaskOnFocus&&(c.hasClass("focus.inputmask")&&0==this._valueGet().length?(f=t().slice(),I(this,f),w(this,0),L=m().join("")):(I(this,f),f.join("")==t().join("")&&-1!=e.inArray(d.radixPoint,f)?(w(this,K(0)),c.click()):w(this,K(0),K(n()))))}function ka(a){if(!0===aa&&"input"==a.type)return aa=!1,!0;var c=this,b=e(c);if("propertychange"==a.type&&c._valueGet().length<=n())return!0;setTimeout(function(){var a=e.isFunction(d.onBeforePaste)?
|
42
|
+
d.onBeforePaste.call(c,c._valueGet(),d):c._valueGet();J(c,!1,!1,a.split(""),!0);I(c,m());!0===Q(m())&&b.trigger("complete");b.click()},0)}function oa(a){var c=e(this),b=w(this),f=this._valueGet(),f=f.replace(RegExp("("+ea(t().join(""))+")*"),"");b.begin>f.length&&(w(this,f.length),b=w(this));1!=m().length-f.length||f.charAt(b.begin)==m()[b.begin]||f.charAt(b.begin+1)==m()[b.begin]||r(b.begin)?(J(this,!1,!1,f.split("")),I(this,m()),!0===Q(m())&&c.trigger("complete"),c.click()):(a.keyCode=d.keyCode.BACKSPACE,
|
43
|
+
Z.call(this,a));a.preventDefault()}function pa(b){s=e(b);if(s.is(":input")){s.data("_inputmask",{masksets:a,activeMasksetIndex:c,opts:d,isRTL:!1});d.showTooltip&&s.prop("title",f().mask);f().greedy=f().greedy?f().greedy:0==f().repeat;if(null!=s.attr("maxLength")){var h=s.prop("maxLength");-1<h&&e.each(a,function(a,d){"object"==typeof d&&"*"==d.repeat&&(d.repeat=h)});n()>=h&&-1<h&&(h<t().length&&(t().length=h),!1==f().greedy&&(f().repeat=Math.round(h/t().length)),s.prop("maxLength",2*n()))}na(b);d.numericInput&&
|
44
|
+
(d.isNumeric=d.numericInput);("rtl"==b.dir||d.numericInput&&d.rightAlignNumerics||d.isNumeric&&d.rightAlignNumerics)&&s.css("text-align","right");if("rtl"==b.dir||d.numericInput){b.dir="ltr";s.removeAttr("dir");var z=s.data("_inputmask");z.isRTL=!0;s.data("_inputmask",z);A=!0}s.unbind(".inputmask");s.removeClass("focus.inputmask");s.closest("form").bind("submit",function(){L!=m().join("")&&s.change()}).bind("reset",function(){setTimeout(function(){s.trigger("setvalue")},0)});s.bind("mouseenter.inputmask",
|
45
|
+
function(){!e(this).hasClass("focus.inputmask")&&d.showMaskOnHover&&this._valueGet()!=m().join("")&&I(this,m())}).bind("blur.inputmask",function(){var b=e(this),f=this._valueGet(),g=m();b.removeClass("focus.inputmask");L!=m().join("")&&b.change();d.clearMaskOnLostFocus&&""!=f&&(f==t().join("")?this._valueSet(""):Y(this));!1===Q(g)&&(b.trigger("incomplete"),d.clearIncomplete&&(e.each(a,function(a,d){"object"==typeof d&&(d.buffer=d._buffer.slice(),d.lastValidPosition=-1)}),c=0,d.clearMaskOnLostFocus?
|
46
|
+
this._valueSet(""):(g=t().slice(),I(this,g))))}).bind("focus.inputmask",function(){var a=e(this),b=this._valueGet();d.showMaskOnFocus&&!a.hasClass("focus.inputmask")&&(!d.showMaskOnHover||d.showMaskOnHover&&""==b)&&this._valueGet()!=m().join("")&&I(this,m(),p(f().lastValidPosition));a.addClass("focus.inputmask");L=m().join("")}).bind("mouseleave.inputmask",function(){var a=e(this);d.clearMaskOnLostFocus&&(a.hasClass("focus.inputmask")||this._valueGet()==a.attr("placeholder")||(this._valueGet()==t().join("")||
|
47
|
+
""==this._valueGet()?this._valueSet(""):Y(this)))}).bind("click.inputmask",function(){var a=this;setTimeout(function(){var b=w(a),c=m();if(b.begin==b.end){var b=A?K(b.begin):b.begin,g=f().lastValidPosition,c=d.isNumeric?!1===d.skipRadixDance&&""!=d.radixPoint&&-1!=e.inArray(d.radixPoint,c)?d.numericInput?p(e.inArray(d.radixPoint,c)):e.inArray(d.radixPoint,c):p(g):p(g);b<c?r(b)?w(a,b):w(a,p(b)):w(a,c)}},0)}).bind("dblclick.inputmask",function(){var a=this;setTimeout(function(){w(a,0,p(f().lastValidPosition))},
|
48
|
+
0)}).bind(P+".inputmask dragdrop.inputmask drop.inputmask",ka).bind("setvalue.inputmask",function(){J(this,!0);L=m().join("");this._valueGet()==t().join("")&&this._valueSet("")}).bind("complete.inputmask",d.oncomplete).bind("incomplete.inputmask",d.onincomplete).bind("cleared.inputmask",d.oncleared);s.bind("keydown.inputmask",Z).bind("keypress.inputmask",V).bind("keyup.inputmask",ja);if(k||u||l||M)if(s.attr("autocomplete","off").attr("autocorrect","off").attr("autocapitalize","off").attr("spellcheck",
|
49
|
+
!1),u||M)s.unbind("keydown.inputmask",Z).unbind("keypress.inputmask",V).unbind("keyup.inputmask",ja),"input"==P&&s.unbind(P+".inputmask"),s.bind("input.inputmask",oa);g&&s.bind("input.inputmask",ka);z=e.isFunction(d.onBeforeMask)?d.onBeforeMask.call(b,b._valueGet(),d):b._valueGet();J(b,!0,!1,z.split(""));L=m().join("");var q;try{q=document.activeElement}catch(S){}q===b?(s.addClass("focus.inputmask"),w(b,p(f().lastValidPosition))):d.clearMaskOnLostFocus?m().join("")==t().join("")?b._valueSet(""):Y(b):
|
50
|
+
I(b,m());ma(b)}}var A=!1,L=m().join(""),s,$=!1,aa=!1,ia=!1;if(void 0!=b)switch(b.action){case "isComplete":return Q(b.buffer);case "unmaskedvalue":return A=b.$input.data("_inputmask").isRTL,la(b.$input,b.skipDatepickerCheck);case "mask":pa(b.el);break;case "format":return s=e({}),s.data("_inputmask",{masksets:a,activeMasksetIndex:c,opts:d,isRTL:d.numericInput}),d.numericInput&&(d.isNumeric=d.numericInput,A=!0),J(s,!1,!1,b.value.split(""),!0),m().join("");case "isValid":return s=e({}),s.data("_inputmask",
|
51
|
+
{masksets:a,activeMasksetIndex:c,opts:d,isRTL:d.numericInput}),d.numericInput&&(d.isNumeric=d.numericInput,A=!0),J(s,!1,!0,b.value.split("")),Q(m())}};e.inputmask={defaults:{placeholder:"_",optionalmarker:{start:"[",end:"]"},quantifiermarker:{start:"{",end:"}"},groupmarker:{start:"(",end:")"},escapeChar:"\\",mask:null,oncomplete:e.noop,onincomplete:e.noop,oncleared:e.noop,repeat:0,greedy:!0,autoUnmask:!1,clearMaskOnLostFocus:!0,insertMode:!0,clearIncomplete:!1,aliases:{},onKeyUp:e.noop,onKeyDown:e.noop,
|
52
|
+
onBeforeMask:void 0,onBeforePaste:void 0,onUnMask:void 0,showMaskOnFocus:!0,showMaskOnHover:!0,onKeyValidation:e.noop,skipOptionalPartCharacter:" ",showTooltip:!1,numericInput:!1,isNumeric:!1,radixPoint:"",skipRadixDance:!1,rightAlignNumerics:!0,definitions:{9:{validator:"[0-9]",cardinality:1,definitionSymbol:"*"},a:{validator:"[A-Za-z\u0410-\u044f\u0401\u0451]",cardinality:1,definitionSymbol:"*"},"*":{validator:"[A-Za-z\u0410-\u044f\u0401\u04510-9]",cardinality:1}},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,
|
53
|
+
COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91},ignorables:[8,9,13,19,27,33,34,35,36,37,38,39,40,45,46,93,112,113,114,115,116,117,118,119,120,121,122,123],getMaskLength:void 0,isComplete:void 0},escapeRegex:function(a){return a.replace(RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\)",
|
54
|
+
"gim"),"\\$1")},format:function(a,c){var d=e.extend(!0,{},e.inputmask.defaults,c);b(d.alias,c,d);return q(f(d),0,d,{action:"format",value:a})},isValid:function(a,c){var d=e.extend(!0,{},e.inputmask.defaults,c);b(d.alias,c,d);return q(f(d),0,d,{action:"isValid",value:a})}};e.fn.inputmask=function(a,c){var d=e.extend(!0,{},e.inputmask.defaults,c),g,h=0;if("string"===typeof a)switch(a){case "mask":return b(d.alias,c,d),g=f(d),0==g.length?this:this.each(function(){q(e.extend(!0,{},g),0,d,{action:"mask",
|
55
|
+
el:this})});case "unmaskedvalue":var k=e(this);return k.data("_inputmask")?(g=k.data("_inputmask").masksets,h=k.data("_inputmask").activeMasksetIndex,d=k.data("_inputmask").opts,q(g,h,d,{action:"unmaskedvalue",$input:k})):k.val();case "remove":return this.each(function(){var a=e(this);if(a.data("_inputmask")){g=a.data("_inputmask").masksets;h=a.data("_inputmask").activeMasksetIndex;d=a.data("_inputmask").opts;this._valueSet(q(g,h,d,{action:"unmaskedvalue",$input:a,skipDatepickerCheck:!0}));a.removeData("_inputmask");
|
56
|
+
a.unbind(".inputmask");a.removeClass("focus.inputmask");var c;Object.getOwnPropertyDescriptor&&(c=Object.getOwnPropertyDescriptor(this,"value"));c&&c.get?this._valueGet&&Object.defineProperty(this,"value",{get:this._valueGet,set:this._valueSet}):document.__lookupGetter__&&this.__lookupGetter__("value")&&this._valueGet&&(this.__defineGetter__("value",this._valueGet),this.__defineSetter__("value",this._valueSet));try{delete this._valueGet,delete this._valueSet}catch(b){this._valueSet=this._valueGet=
|
57
|
+
void 0}}});case "getemptymask":return this.data("_inputmask")?(g=this.data("_inputmask").masksets,h=this.data("_inputmask").activeMasksetIndex,g[h]._buffer.join("")):"";case "hasMaskedValue":return this.data("_inputmask")?!this.data("_inputmask").opts.autoUnmask:!1;case "isComplete":return g=this.data("_inputmask").masksets,h=this.data("_inputmask").activeMasksetIndex,d=this.data("_inputmask").opts,q(g,h,d,{action:"isComplete",buffer:this[0]._valueGet().split("")});case "getmetadata":if(this.data("_inputmask"))return g=
|
58
|
+
this.data("_inputmask").masksets,h=this.data("_inputmask").activeMasksetIndex,g[h].metadata;break;default:return b(a,c,d)||(d.mask=a),g=f(d),0==g.length?this:this.each(function(){q(e.extend(!0,{},g),h,d,{action:"mask",el:this})})}else{if("object"==typeof a)return d=e.extend(!0,{},e.inputmask.defaults,a),b(d.alias,a,d),g=f(d),0==g.length?this:this.each(function(){q(e.extend(!0,{},g),h,d,{action:"mask",el:this})});if(void 0==a)return this.each(function(){var a=e(this).attr("data-inputmask");if(a&&""!=
|
59
|
+
a)try{var a=a.replace(RegExp("'","g"),'"'),f=e.parseJSON("{"+a+"}");e.extend(!0,f,c);d=e.extend(!0,{},e.inputmask.defaults,f);b(d.alias,f,d);d.alias=void 0;e(this).inputmask(d)}catch(g){}})}}}})(jQuery);
|
60
|
+
(function(e){e.extend(e.inputmask.defaults.definitions,{A:{validator:"[A-Za-z]",cardinality:1,casing:"upper"},"#":{validator:"[A-Za-z\u0410-\u044f\u0401\u04510-9]",cardinality:1,casing:"upper"}});e.extend(e.inputmask.defaults.aliases,{url:{mask:"ir",placeholder:"",separator:"",defaultPrefix:"http://",regex:{urlpre1:/[fh]/,urlpre2:/(ft|ht)/,urlpre3:/(ftp|htt)/,urlpre4:/(ftp:|http|ftps)/,urlpre5:/(ftp:\/|ftps:|http:|https)/,urlpre6:/(ftp:\/\/|ftps:\/|http:\/|https:)/,urlpre7:/(ftp:\/\/|ftps:\/\/|http:\/\/|https:\/)/,
|
61
|
+
urlpre8:/(ftp:\/\/|ftps:\/\/|http:\/\/|https:\/\/)/},definitions:{i:{validator:function(a,b,f,e,c){return!0},cardinality:8,prevalidator:function(){for(var a=[],b=0;8>b;b++)a[b]=function(){var a=b;return{validator:function(b,c,e,k,l){if(l.regex["urlpre"+(a+1)]){var u=b;0<a+1-b.length&&(u=c.join("").substring(0,a+1-b.length)+""+u);b=l.regex["urlpre"+(a+1)].test(u);if(!k&&!b){e-=a;for(k=0;k<l.defaultPrefix.length;k++)c[e]=l.defaultPrefix[k],e++;for(k=0;k<u.length-1;k++)c[e]=u[k],e++;return{pos:e}}return b}return!1},
|
62
|
+
cardinality:a}}();return a}()},r:{validator:".",cardinality:50}},insertMode:!1,autoUnmask:!1},ip:{mask:["[[x]y]z.[[x]y]z.[[x]y]z.x[yz]","[[x]y]z.[[x]y]z.[[x]y]z.[[x]y][z]"],definitions:{x:{validator:"[012]",cardinality:1,definitionSymbol:"i"},y:{validator:function(a,b,f,e,c){a=-1<f-1&&"."!=b[f-1]?b[f-1]+a:"0"+a;return/2[0-5]|[01][0-9]/.test(a)},cardinality:1,definitionSymbol:"i"},z:{validator:function(a,b,f,e,c){-1<f-1&&"."!=b[f-1]?(a=b[f-1]+a,a=-1<f-2&&"."!=b[f-2]?b[f-2]+a:"0"+a):a="00"+a;return/25[0-5]|2[0-4][0-9]|[01][0-9][0-9]/.test(a)},
|
63
|
+
cardinality:1,definitionSymbol:"i"}}}})})(jQuery);
|
64
|
+
(function(e){e.extend(e.inputmask.defaults.definitions,{h:{validator:"[01][0-9]|2[0-3]",cardinality:2,prevalidator:[{validator:"[0-2]",cardinality:1}]},s:{validator:"[0-5][0-9]",cardinality:2,prevalidator:[{validator:"[0-5]",cardinality:1}]},d:{validator:"0[1-9]|[12][0-9]|3[01]",cardinality:2,prevalidator:[{validator:"[0-3]",cardinality:1}]},m:{validator:"0[1-9]|1[012]",cardinality:2,prevalidator:[{validator:"[01]",cardinality:1}]},y:{validator:"(19|20)\\d{2}",cardinality:4,prevalidator:[{validator:"[12]",
|
65
|
+
cardinality:1},{validator:"(19|20)",cardinality:2},{validator:"(19|20)\\d",cardinality:3}]}});e.extend(e.inputmask.defaults.aliases,{"dd/mm/yyyy":{mask:"1/2/y",placeholder:"dd/mm/yyyy",regex:{val1pre:/[0-3]/,val1:/0[1-9]|[12][0-9]|3[01]/,val2pre:function(a){a=e.inputmask.escapeRegex.call(this,a);return RegExp("((0[1-9]|[12][0-9]|3[01])"+a+"[01])")},val2:function(a){a=e.inputmask.escapeRegex.call(this,a);return RegExp("((0[1-9]|[12][0-9])"+a+"(0[1-9]|1[012]))|(30"+a+"(0[13-9]|1[012]))|(31"+a+"(0[13578]|1[02]))")}},
|
66
|
+
leapday:"29/02/",separator:"/",yearrange:{minyear:1900,maxyear:2099},isInYearRange:function(a,b,f){var e=parseInt(a.concat(b.toString().slice(a.length)));a=parseInt(a.concat(f.toString().slice(a.length)));return(NaN!=e?b<=e&&e<=f:!1)||(NaN!=a?b<=a&&a<=f:!1)},determinebaseyear:function(a,b,f){var e=(new Date).getFullYear();if(a>e)return a;if(b<e){for(var e=b.toString().slice(0,2),c=b.toString().slice(2,4);b<e+f;)e--;b=e+c;return a>b?a:b}return e},onKeyUp:function(a,b,f){b=e(this);a.ctrlKey&&a.keyCode==
|
67
|
+
f.keyCode.RIGHT&&(a=new Date,b.val(a.getDate().toString()+(a.getMonth()+1).toString()+a.getFullYear().toString()))},definitions:{1:{validator:function(a,b,f,e,c){var h=c.regex.val1.test(a);return e||h||a.charAt(1)!=c.separator&&-1=="-./".indexOf(a.charAt(1))||!(h=c.regex.val1.test("0"+a.charAt(0)))?h:(b[f-1]="0",{pos:f,c:a.charAt(0)})},cardinality:2,prevalidator:[{validator:function(a,b,f,e,c){var h=c.regex.val1pre.test(a);return e||h||!(h=c.regex.val1.test("0"+a))?h:(b[f]="0",f++,{pos:f})},cardinality:1}]},
|
68
|
+
2:{validator:function(a,b,f,e,c){var h=b.join("").substr(0,3);-1!=h.indexOf(c.placeholder[0])&&(h="01"+c.separator);var k=c.regex.val2(c.separator).test(h+a);return e||k||a.charAt(1)!=c.separator&&-1=="-./".indexOf(a.charAt(1))||!(k=c.regex.val2(c.separator).test(h+"0"+a.charAt(0)))?k:(b[f-1]="0",{pos:f,c:a.charAt(0)})},cardinality:2,prevalidator:[{validator:function(a,b,f,e,c){var h=b.join("").substr(0,3);-1!=h.indexOf(c.placeholder[0])&&(h="01"+c.separator);var k=c.regex.val2pre(c.separator).test(h+
|
69
|
+
a);return e||k||!(k=c.regex.val2(c.separator).test(h+"0"+a))?k:(b[f]="0",f++,{pos:f})},cardinality:1}]},y:{validator:function(a,b,f,e,c){if(c.isInYearRange(a,c.yearrange.minyear,c.yearrange.maxyear)){if(b.join("").substr(0,6)!=c.leapday)return!0;a=parseInt(a,10);return 0===a%4?0===a%100?0===a%400?!0:!1:!0:!1}return!1},cardinality:4,prevalidator:[{validator:function(a,b,f,e,c){var h=c.isInYearRange(a,c.yearrange.minyear,c.yearrange.maxyear);if(!e&&!h){e=c.determinebaseyear(c.yearrange.minyear,c.yearrange.maxyear,
|
70
|
+
a+"0").toString().slice(0,1);if(h=c.isInYearRange(e+a,c.yearrange.minyear,c.yearrange.maxyear))return b[f++]=e[0],{pos:f};e=c.determinebaseyear(c.yearrange.minyear,c.yearrange.maxyear,a+"0").toString().slice(0,2);if(h=c.isInYearRange(e+a,c.yearrange.minyear,c.yearrange.maxyear))return b[f++]=e[0],b[f++]=e[1],{pos:f}}return h},cardinality:1},{validator:function(a,b,f,e,c){var h=c.isInYearRange(a,c.yearrange.minyear,c.yearrange.maxyear);if(!e&&!h){e=c.determinebaseyear(c.yearrange.minyear,c.yearrange.maxyear,
|
71
|
+
a).toString().slice(0,2);if(h=c.isInYearRange(a[0]+e[1]+a[1],c.yearrange.minyear,c.yearrange.maxyear))return b[f++]=e[1],{pos:f};e=c.determinebaseyear(c.yearrange.minyear,c.yearrange.maxyear,a).toString().slice(0,2);c.isInYearRange(e+a,c.yearrange.minyear,c.yearrange.maxyear)?b.join("").substr(0,6)!=c.leapday?h=!0:(c=parseInt(a,10),h=0===c%4?0===c%100?0===c%400?!0:!1:!0:!1):h=!1;if(h)return b[f-1]=e[0],b[f++]=e[1],b[f++]=a[0],{pos:f}}return h},cardinality:2},{validator:function(a,b,e,g,c){return c.isInYearRange(a,
|
72
|
+
c.yearrange.minyear,c.yearrange.maxyear)},cardinality:3}]}},insertMode:!1,autoUnmask:!1},"mm/dd/yyyy":{placeholder:"mm/dd/yyyy",alias:"dd/mm/yyyy",regex:{val2pre:function(a){a=e.inputmask.escapeRegex.call(this,a);return RegExp("((0[13-9]|1[012])"+a+"[0-3])|(02"+a+"[0-2])")},val2:function(a){a=e.inputmask.escapeRegex.call(this,a);return RegExp("((0[1-9]|1[012])"+a+"(0[1-9]|[12][0-9]))|((0[13-9]|1[012])"+a+"30)|((0[13578]|1[02])"+a+"31)")},val1pre:/[01]/,val1:/0[1-9]|1[012]/},leapday:"02/29/",onKeyUp:function(a,
|
73
|
+
b,f){b=e(this);a.ctrlKey&&a.keyCode==f.keyCode.RIGHT&&(a=new Date,b.val((a.getMonth()+1).toString()+a.getDate().toString()+a.getFullYear().toString()))}},"yyyy/mm/dd":{mask:"y/1/2",placeholder:"yyyy/mm/dd",alias:"mm/dd/yyyy",leapday:"/02/29",onKeyUp:function(a,b,f){b=e(this);a.ctrlKey&&a.keyCode==f.keyCode.RIGHT&&(a=new Date,b.val(a.getFullYear().toString()+(a.getMonth()+1).toString()+a.getDate().toString()))},definitions:{2:{validator:function(a,b,e,g,c){var h=b.join("").substr(5,3);-1!=h.indexOf(c.placeholder[5])&&
|
74
|
+
(h="01"+c.separator);var k=c.regex.val2(c.separator).test(h+a);if(!(g||k||a.charAt(1)!=c.separator&&-1=="-./".indexOf(a.charAt(1)))&&(k=c.regex.val2(c.separator).test(h+"0"+a.charAt(0))))return b[e-1]="0",{pos:e,c:a.charAt(0)};if(k){if(b.join("").substr(4,4)+a!=c.leapday)return!0;a=parseInt(b.join("").substr(0,4),10);return 0===a%4?0===a%100?0===a%400?!0:!1:!0:!1}return k},cardinality:2,prevalidator:[{validator:function(a,b,e,g,c){var h=b.join("").substr(5,3);-1!=h.indexOf(c.placeholder[5])&&(h="01"+
|
75
|
+
c.separator);var k=c.regex.val2pre(c.separator).test(h+a);return g||k||!(k=c.regex.val2(c.separator).test(h+"0"+a))?k:(b[e]="0",e++,{pos:e})},cardinality:1}]}}},"dd.mm.yyyy":{mask:"1.2.y",placeholder:"dd.mm.yyyy",leapday:"29.02.",separator:".",alias:"dd/mm/yyyy"},"dd-mm-yyyy":{mask:"1-2-y",placeholder:"dd-mm-yyyy",leapday:"29-02-",separator:"-",alias:"dd/mm/yyyy"},"mm.dd.yyyy":{mask:"1.2.y",placeholder:"mm.dd.yyyy",leapday:"02.29.",separator:".",alias:"mm/dd/yyyy"},"mm-dd-yyyy":{mask:"1-2-y",placeholder:"mm-dd-yyyy",
|
76
|
+
leapday:"02-29-",separator:"-",alias:"mm/dd/yyyy"},"yyyy.mm.dd":{mask:"y.1.2",placeholder:"yyyy.mm.dd",leapday:".02.29",separator:".",alias:"yyyy/mm/dd"},"yyyy-mm-dd":{mask:"y-1-2",placeholder:"yyyy-mm-dd",leapday:"-02-29",separator:"-",alias:"yyyy/mm/dd"},datetime:{mask:"1/2/y h:s",placeholder:"dd/mm/yyyy hh:mm",alias:"dd/mm/yyyy",regex:{hrspre:/[012]/,hrs24:/2[0-9]|1[3-9]/,hrs:/[01][0-9]|2[0-3]/,ampm:/^[a|p|A|P][m|M]/},timeseparator:":",hourFormat:"24",definitions:{h:{validator:function(a,b,e,g,
|
77
|
+
c){var h=c.regex.hrs.test(a);return g||h||a.charAt(1)!=c.timeseparator&&-1=="-.:".indexOf(a.charAt(1))||!(h=c.regex.hrs.test("0"+a.charAt(0)))?h&&"24"!==c.hourFormat&&c.regex.hrs24.test(a)?(a=parseInt(a,10),b[e+5]=24==a?"a":"p",b[e+6]="m",a-=12,10>a?(b[e]=a.toString(),b[e-1]="0"):(b[e]=a.toString().charAt(1),b[e-1]=a.toString().charAt(0)),{pos:e,c:b[e]}):h:(b[e-1]="0",b[e]=a.charAt(0),e++,{pos:e})},cardinality:2,prevalidator:[{validator:function(a,b,e,g,c){var h=c.regex.hrspre.test(a);return g||h||
|
78
|
+
!(h=c.regex.hrs.test("0"+a))?h:(b[e]="0",e++,{pos:e})},cardinality:1}]},t:{validator:function(a,b,e,g,c){return c.regex.ampm.test(a+"m")},casing:"lower",cardinality:1}},insertMode:!1,autoUnmask:!1},datetime12:{mask:"1/2/y h:s t\\m",placeholder:"dd/mm/yyyy hh:mm xm",alias:"datetime",hourFormat:"12"},"hh:mm t":{mask:"h:s t\\m",placeholder:"hh:mm xm",alias:"datetime",hourFormat:"12"},"h:s t":{mask:"h:s t\\m",placeholder:"hh:mm xm",alias:"datetime",hourFormat:"12"},"hh:mm:ss":{mask:"h:s:s",autoUnmask:!1},
|
79
|
+
"hh:mm":{mask:"h:s",autoUnmask:!1},date:{alias:"dd/mm/yyyy"},"mm/yyyy":{mask:"1/y",placeholder:"mm/yyyy",leapday:"donotuse",separator:"/",alias:"mm/dd/yyyy"}})})(jQuery);
|
80
|
+
(function(e){e.extend(e.inputmask.defaults.aliases,{decimal:{mask:"~",placeholder:"",repeat:"*",greedy:!1,numericInput:!1,isNumeric:!0,digits:"*",groupSeparator:"",radixPoint:".",groupSize:3,autoGroup:!1,allowPlus:!0,allowMinus:!0,integerDigits:"*",defaultValue:"",prefix:"",suffix:"",getMaskLength:function(a,b,f,g,c){var h=a.length;b||("*"==f?h=g.length+1:1<f&&(h+=a.length*(f-1)));a=e.inputmask.escapeRegex.call(this,c.groupSeparator);c=e.inputmask.escapeRegex.call(this,c.radixPoint);g=g.join("");
|
81
|
+
c=g.replace(RegExp(a,"g"),"").replace(RegExp(c),"");return h+(g.length-c.length)},postFormat:function(a,b,f,g){if(""==g.groupSeparator)return b;var c=a.slice();e.inArray(g.radixPoint,a);f||c.splice(b,0,"?");c=c.join("");if(g.autoGroup||f&&-1!=c.indexOf(g.groupSeparator)){for(var h=e.inputmask.escapeRegex.call(this,g.groupSeparator),c=c.replace(RegExp(h,"g"),""),h=c.split(g.radixPoint),c=h[0],k=RegExp("([-+]?[\\d?]+)([\\d?]{"+g.groupSize+"})");k.test(c);)c=c.replace(k,"$1"+g.groupSeparator+"$2"),c=
|
82
|
+
c.replace(g.groupSeparator+g.groupSeparator,g.groupSeparator);1<h.length&&(c+=g.radixPoint+h[1])}a.length=c.length;g=0;for(h=c.length;g<h;g++)a[g]=c.charAt(g);c=e.inArray("?",a);f||a.splice(c,1);return f?b:c},regex:{number:function(a){var b=e.inputmask.escapeRegex.call(this,a.groupSeparator),f=e.inputmask.escapeRegex.call(this,a.radixPoint),g=isNaN(a.digits)?a.digits:"{0,"+a.digits+"}";return RegExp("^"+(a.allowPlus||a.allowMinus?"["+(a.allowPlus?"+":"")+(a.allowMinus?"-":"")+"]?":"")+"(\\d+|\\d{1,"+
|
83
|
+
a.groupSize+"}(("+b+"\\d{"+a.groupSize+"})?)+)("+f+"\\d"+g+")?$")}},onKeyDown:function(a,b,f){var g=e(this);if(a.keyCode==f.keyCode.TAB){if(a=e.inArray(f.radixPoint,b),-1!=a){for(var c=g.data("_inputmask").masksets,g=g.data("_inputmask").activeMasksetIndex,h=1;h<=f.digits&&h<f.getMaskLength(c[g]._buffer,c[g].greedy,c[g].repeat,b,f);h++)if(void 0==b[a+h]||""==b[a+h])b[a+h]="0";this._valueSet(b.join(""))}}else if(a.keyCode==f.keyCode.DELETE||a.keyCode==f.keyCode.BACKSPACE)return f.postFormat(b,0,!0,
|
84
|
+
f),this._valueSet(b.join("")),!0},definitions:{"~":{validator:function(a,b,f,g,c){var h=e.extend({},c,{digits:g?"*":c.digits});if(""==a)return!1;if(!g&&1>=f&&"0"===b[0]&&/[\d-]/.test(a)&&1==b.join("").length)return b[0]="",{pos:0};var k=g?b.slice(0,f):b.slice();k.splice(f,0,a);var k=k.join(""),l=e.inputmask.escapeRegex.call(this,c.groupSeparator),k=k.replace(RegExp(l,"g"),"");g&&k.lastIndexOf(c.radixPoint)==k.length-1&&(l=e.inputmask.escapeRegex.call(this,c.radixPoint),k=k.replace(RegExp(l,"g"),""));
|
85
|
+
if(!g&&""==k)return!1;l=c.regex.number(h).test(k);if(!l&&(k+="0",l=c.regex.number(h).test(k),!l)){l=k.lastIndexOf(c.groupSeparator);for(l=k.length-l;3>=l;l++)k+="0";l=c.regex.number(h).test(k);if(!l&&!g&&a==c.radixPoint&&(l=c.regex.number(h).test("0"+k+"0")))return b[f]="0",f++,{pos:f}}return!1==l||g||a==c.radixPoint?l:{pos:c.postFormat(b,f,"-"==a||"+"==a?!0:!1,c)}},cardinality:1,prevalidator:null}},insertMode:!0,autoUnmask:!1},integer:{regex:{number:function(a){var b=e.inputmask.escapeRegex.call(this,
|
86
|
+
a.groupSeparator);return RegExp("^"+(a.allowPlus||a.allowMinus?"["+(a.allowPlus?"+":"")+(a.allowMinus?"-":"")+"]?":"")+"(\\d+|\\d{1,"+a.groupSize+"}(("+b+"\\d{"+a.groupSize+"})?)+)$")}},alias:"decimal"}})})(jQuery);
|
87
|
+
(function(e){e.extend(e.inputmask.defaults.aliases,{Regex:{mask:"r",greedy:!1,repeat:"*",regex:null,regexTokens:null,tokenizer:/\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,quantifierFilter:/[0-9]+[^,]/,definitions:{r:{validator:function(a,b,e,g,c){function h(a,b){this.matches=[];this.isGroup=a||!1;this.isQuantifier=b||!1;this.quantifier=
|
88
|
+
{min:1,max:1};this.repeaterPart=void 0}function k(){var a=new h,b,e=[];for(c.regexTokens=[];b=c.tokenizer.exec(c.regex);)switch(b=b[0],b.charAt(0)){case "(":e.push(new h(!0));break;case ")":var d=e.pop();0<e.length?e[e.length-1].matches.push(d):a.matches.push(d);break;case "{":case "+":case "*":var f=new h(!1,!0);b=b.replace(/[{}]/g,"");d=b.split(",");b=isNaN(d[0])?d[0]:parseInt(d[0]);d=1==d.length?b:isNaN(d[1])?d[1]:parseInt(d[1]);f.quantifier={min:b,max:d};if(0<e.length){var g=e[e.length-1].matches;
|
89
|
+
b=g.pop();b.isGroup||(d=new h(!0),d.matches.push(b),b=d);g.push(b);g.push(f)}else b=a.matches.pop(),b.isGroup||(d=new h(!0),d.matches.push(b),b=d),a.matches.push(b),a.matches.push(f);break;default:0<e.length?e[e.length-1].matches.push(b):a.matches.push(b)}0<a.matches.length&&c.regexTokens.push(a)}function l(a,b){var c=!1;b&&(u+="(",M++);for(var d=0;d<a.matches.length;d++){var e=a.matches[d];if(!0==e.isGroup)c=l(e,!0);else if(!0==e.isQuantifier){var f=a.matches.indexOf(e),f=a.matches[f-1],g=u;if(isNaN(e.quantifier.max)){for(;e.repeaterPart&&
|
90
|
+
e.repeaterPart!=u&&e.repeaterPart.length>u.length&&!(c=l(f,!0)););(c=c||l(f,!0))&&(e.repeaterPart=u);u=g+e.quantifier.max}else{for(var h=0,k=e.quantifier.max-1;h<k&&!(c=l(f,!0));h++);u=g+"{"+e.quantifier.min+","+e.quantifier.max+"}"}}else if(void 0!=e.matches)for(f=0;f<e.length&&!(c=l(e[f],b));f++);else{if("["==e[0]){c=u;c+=e;for(h=0;h<M;h++)c+=")";c=RegExp("^("+c+")$");c=c.test(P)}else for(f=0,g=e.length;f<g;f++)if("\\"!=e[f]){c=u;c+=e.substr(0,f+1);c=c.replace(/\|$/,"");for(h=0;h<M;h++)c+=")";c=
|
91
|
+
RegExp("^("+c+")$");if(c=c.test(P))break}u+=e}if(c)break}b&&(u+=")",M--);return c}null==c.regexTokens&&k();g=b.slice();var u="";b=!1;var M=0;g.splice(e,0,a);var P=g.join("");for(a=0;a<c.regexTokens.length&&!(h=c.regexTokens[a],b=l(h,h.isGroup));a++);return b},cardinality:1}}}})})(jQuery);
|
92
|
+
(function(e){e.extend(e.inputmask.defaults.aliases,{phone:{url:"phone-codes/phone-codes.json",mask:function(a){a.definitions={p:{validator:function(){return!1},cardinality:1},"#":{validator:"[0-9]",cardinality:1}};var b=[];e.ajax({url:a.url,async:!1,dataType:"json",success:function(a){b=a}});b.splice(0,0,"+p(ppp)ppp-pppp");return b}}})})(jQuery);
|
@@ -1,479 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
(function(
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
},
|
18
|
-
's': { //seconds || minutes
|
19
|
-
validator: "[0-5][0-9]",
|
20
|
-
cardinality: 2,
|
21
|
-
prevalidator: [{ validator: "[0-5]", cardinality: 1}]
|
22
|
-
},
|
23
|
-
'd': { //basic day
|
24
|
-
validator: "0[1-9]|[12][0-9]|3[01]",
|
25
|
-
cardinality: 2,
|
26
|
-
prevalidator: [{ validator: "[0-3]", cardinality: 1}]
|
27
|
-
},
|
28
|
-
'm': { //basic month
|
29
|
-
validator: "0[1-9]|1[012]",
|
30
|
-
cardinality: 2,
|
31
|
-
prevalidator: [{ validator: "[01]", cardinality: 1}]
|
32
|
-
},
|
33
|
-
'y': { //basic year
|
34
|
-
validator: "(19|20)\\d{2}",
|
35
|
-
cardinality: 4,
|
36
|
-
prevalidator: [
|
37
|
-
{ validator: "[12]", cardinality: 1 },
|
38
|
-
{ validator: "(19|20)", cardinality: 2 },
|
39
|
-
{ validator: "(19|20)\\d", cardinality: 3 }
|
40
|
-
]
|
41
|
-
}
|
42
|
-
});
|
43
|
-
$.extend($.inputmask.defaults.aliases, {
|
44
|
-
'dd/mm/yyyy': {
|
45
|
-
mask: "1/2/y",
|
46
|
-
placeholder: "dd/mm/yyyy",
|
47
|
-
regex: {
|
48
|
-
val1pre: new RegExp("[0-3]"), //daypre
|
49
|
-
val1: new RegExp("0[1-9]|[12][0-9]|3[01]"), //day
|
50
|
-
val2pre: function(separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|[12][0-9]|3[01])" + escapedSeparator + "[01])"); }, //monthpre
|
51
|
-
val2: function(separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|[12][0-9])" + escapedSeparator + "(0[1-9]|1[012]))|(30" + escapedSeparator + "(0[13-9]|1[012]))|(31" + escapedSeparator + "(0[13578]|1[02]))"); }//month
|
52
|
-
},
|
53
|
-
leapday: "29/02/",
|
54
|
-
separator: '/',
|
55
|
-
yearrange: { minyear: 1900, maxyear: 2099 },
|
56
|
-
isInYearRange: function(chrs, minyear, maxyear){
|
57
|
-
var enteredyear = parseInt(chrs.concat(minyear.toString().slice(chrs.length)));
|
58
|
-
var enteredyear2 = parseInt(chrs.concat(maxyear.toString().slice(chrs.length)));
|
59
|
-
return (enteredyear != NaN ? minyear <= enteredyear && enteredyear <= maxyear : false) ||
|
60
|
-
(enteredyear2 != NaN ? minyear <= enteredyear2 && enteredyear2 <= maxyear : false);
|
61
|
-
},
|
62
|
-
determinebaseyear: function(minyear, maxyear){
|
63
|
-
var currentyear = (new Date()).getFullYear();
|
64
|
-
if(minyear > currentyear) return minyear;
|
65
|
-
if(maxyear < currentyear) return maxyear;
|
66
|
-
|
67
|
-
return currentyear;
|
68
|
-
},
|
69
|
-
onKeyUp: function(e, opts) {
|
70
|
-
var $input = $(this), input = this;
|
71
|
-
if (e.ctrlKey && e.keyCode == opts.keyCode.RIGHT) {
|
72
|
-
var today = new Date();
|
73
|
-
$input.val(today.getDate().toString() + (today.getMonth() + 1).toString() + today.getFullYear().toString());
|
74
|
-
}
|
75
|
-
},
|
76
|
-
definitions: {
|
77
|
-
'1': { //val1 ~ day or month
|
78
|
-
validator: function(chrs, buffer, pos, strict, opts) {
|
79
|
-
var isValid = opts.regex.val1.test(chrs);
|
80
|
-
if (!strict && !isValid) {
|
81
|
-
if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1 ) {
|
82
|
-
isValid = opts.regex.val1.test("0" + chrs.charAt(0));
|
83
|
-
if (isValid) {
|
84
|
-
buffer[pos - 1] = "0";
|
85
|
-
return { "pos": pos ,"c": chrs.charAt(0) };
|
86
|
-
}
|
87
|
-
}
|
88
|
-
}
|
89
|
-
return isValid;
|
90
|
-
},
|
91
|
-
cardinality: 2,
|
92
|
-
prevalidator: [{ validator: function(chrs, buffer, pos, strict, opts) {
|
93
|
-
var isValid = opts.regex.val1pre.test(chrs);
|
94
|
-
if (!strict && !isValid) {
|
95
|
-
isValid = opts.regex.val1.test("0" + chrs);
|
96
|
-
if (isValid) {
|
97
|
-
buffer[pos] = "0";
|
98
|
-
pos++;
|
99
|
-
return { "pos": pos };
|
100
|
-
}
|
101
|
-
}
|
102
|
-
return isValid;
|
103
|
-
}, cardinality: 1}]
|
104
|
-
},
|
105
|
-
'2': { //val2 ~ day or month
|
106
|
-
validator: function(chrs, buffer, pos, strict, opts) {
|
107
|
-
var frontValue = buffer.join('').substr(0, 3);
|
108
|
-
var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
|
109
|
-
if (!strict && !isValid) {
|
110
|
-
if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1 ) {
|
111
|
-
isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0));
|
112
|
-
if (isValid) {
|
113
|
-
buffer[pos - 1] = "0";
|
114
|
-
return { "pos": pos, "c": chrs.charAt(0) };
|
115
|
-
}
|
116
|
-
}
|
117
|
-
}
|
118
|
-
return isValid;
|
119
|
-
},
|
120
|
-
cardinality: 2,
|
121
|
-
prevalidator: [{ validator: function(chrs, buffer, pos, strict, opts) {
|
122
|
-
var frontValue = buffer.join('').substr(0, 3);
|
123
|
-
var isValid = opts.regex.val2pre(opts.separator).test(frontValue + chrs);
|
124
|
-
if (!strict && !isValid) {
|
125
|
-
isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs);
|
126
|
-
if (isValid) {
|
127
|
-
buffer[pos] = "0";
|
128
|
-
pos++;
|
129
|
-
return { "pos": pos };
|
130
|
-
}
|
131
|
-
}
|
132
|
-
return isValid;
|
133
|
-
}, cardinality: 1}]
|
134
|
-
},
|
135
|
-
'y': { //year
|
136
|
-
validator: function(chrs, buffer, pos, strict, opts) {
|
137
|
-
if (opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) {
|
138
|
-
var dayMonthValue = buffer.join('').substr(0, 6);
|
139
|
-
if (dayMonthValue != opts.leapday)
|
140
|
-
return true;
|
141
|
-
else {
|
142
|
-
var year = parseInt(chrs,10);//detect leap year
|
143
|
-
if (year % 4 === 0)
|
144
|
-
if (year % 100 === 0)
|
145
|
-
if (year % 400 === 0)
|
146
|
-
return true;
|
147
|
-
else return false;
|
148
|
-
else return true;
|
149
|
-
else return false;
|
150
|
-
}
|
151
|
-
} else return false;
|
152
|
-
},
|
153
|
-
cardinality: 4,
|
154
|
-
prevalidator: [
|
155
|
-
{ validator: function(chrs, buffer, pos, strict, opts) {
|
156
|
-
var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
|
157
|
-
if (!strict && !isValid) {
|
158
|
-
var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear).toString().slice(0, 1);
|
159
|
-
|
160
|
-
isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
|
161
|
-
if (isValid) {
|
162
|
-
buffer[pos++] = yearPrefix[0];
|
163
|
-
return { "pos": pos };
|
164
|
-
}
|
165
|
-
yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear).toString().slice(0, 2);
|
166
|
-
|
167
|
-
isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
|
168
|
-
if (isValid) {
|
169
|
-
buffer[pos++] = yearPrefix[0];
|
170
|
-
buffer[pos++] = yearPrefix[1];
|
171
|
-
return { "pos": pos };
|
172
|
-
}
|
173
|
-
}
|
174
|
-
return isValid;
|
175
|
-
},
|
176
|
-
cardinality: 1
|
177
|
-
},
|
178
|
-
{ validator: function(chrs, buffer, pos, strict, opts) {
|
179
|
-
var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
|
180
|
-
if (!strict && !isValid) {
|
181
|
-
var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear).toString().slice(0, 2);
|
182
|
-
|
183
|
-
isValid = opts.isInYearRange(yearPrefix + chrs[1], opts.yearrange.minyear, opts.yearrange.maxyear);
|
184
|
-
if (isValid) {
|
185
|
-
buffer[pos++] = yearPrefix[1];
|
186
|
-
return { "pos": pos };
|
187
|
-
}
|
188
|
-
|
189
|
-
yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear).toString().slice(0, 2);
|
190
|
-
if (opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) {
|
191
|
-
var dayMonthValue = buffer.join('').substr(0, 6);
|
192
|
-
if (dayMonthValue != opts.leapday)
|
193
|
-
isValid = true;
|
194
|
-
else {
|
195
|
-
var year = parseInt(chrs,10);//detect leap year
|
196
|
-
if (year % 4 === 0)
|
197
|
-
if (year % 100 === 0)
|
198
|
-
if (year % 400 === 0)
|
199
|
-
isValid = true;
|
200
|
-
else isValid = false;
|
201
|
-
else isValid = true;
|
202
|
-
else isValid = false;
|
203
|
-
}
|
204
|
-
} else isValid = false;
|
205
|
-
if (isValid) {
|
206
|
-
buffer[pos-1] = yearPrefix[0];
|
207
|
-
buffer[pos++] = yearPrefix[1];
|
208
|
-
buffer[pos++] = chrs[0];
|
209
|
-
return { "pos": pos };
|
210
|
-
}
|
211
|
-
}
|
212
|
-
return isValid;
|
213
|
-
}, cardinality: 2 },
|
214
|
-
{ validator: function(chrs, buffer, pos, strict, opts) {
|
215
|
-
return opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
|
216
|
-
}, cardinality: 3 }
|
217
|
-
]
|
218
|
-
}
|
219
|
-
},
|
220
|
-
insertMode: false,
|
221
|
-
autoUnmask: false
|
222
|
-
},
|
223
|
-
'mm/dd/yyyy': {
|
224
|
-
placeholder: "mm/dd/yyyy",
|
225
|
-
alias: "dd/mm/yyyy", //reuse functionality of dd/mm/yyyy alias
|
226
|
-
regex: {
|
227
|
-
val2pre: function(separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[13-9]|1[012])" + escapedSeparator + "[0-3])|(02" + escapedSeparator + "[0-2])"); }, //daypre
|
228
|
-
val2: function(separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + escapedSeparator + "30)|((0[13578]|1[02])" + escapedSeparator + "31)"); }, //day
|
229
|
-
val1pre: new RegExp("[01]"), //monthpre
|
230
|
-
val1: new RegExp("0[1-9]|1[012]") //month
|
231
|
-
},
|
232
|
-
leapday: "02/29/",
|
233
|
-
onKeyUp: function(e, opts) {
|
234
|
-
var $input = $(this), input = this;
|
235
|
-
if (e.ctrlKey && e.keyCode == opts.keyCode.RIGHT) {
|
236
|
-
var today = new Date();
|
237
|
-
$input.val((today.getMonth() + 1).toString() + today.getDate().toString() + today.getFullYear().toString());
|
238
|
-
}
|
239
|
-
}
|
240
|
-
},
|
241
|
-
'yyyy/mm/dd': {
|
242
|
-
mask: "y/1/2",
|
243
|
-
placeholder: "yyyy/mm/dd",
|
244
|
-
alias: "mm/dd/yyyy",
|
245
|
-
leapday: "/02/29",
|
246
|
-
onKeyUp: function(e, opts) {
|
247
|
-
var $input = $(this), input = this;
|
248
|
-
if (e.ctrlKey && e.keyCode == opts.keyCode.RIGHT) {
|
249
|
-
var today = new Date();
|
250
|
-
$input.val(today.getFullYear().toString() + (today.getMonth() + 1).toString() + today.getDate().toString());
|
251
|
-
}
|
252
|
-
},
|
253
|
-
definitions: {
|
254
|
-
'2': { //val2 ~ day or month
|
255
|
-
validator: function(chrs, buffer, pos, strict, opts) {
|
256
|
-
var frontValue = buffer.join('').substr(5, 3);
|
257
|
-
var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
|
258
|
-
if (!strict && !isValid) {
|
259
|
-
if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1 ) {
|
260
|
-
isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0));
|
261
|
-
if (isValid) {
|
262
|
-
buffer[pos - 1] = "0";
|
263
|
-
return { "pos": pos, "c": chrs.charAt(0) };
|
264
|
-
}
|
265
|
-
}
|
266
|
-
}
|
267
|
-
|
268
|
-
//check leap yeap
|
269
|
-
if (isValid) {
|
270
|
-
var dayMonthValue = buffer.join('').substr(4, 4) + chrs;
|
271
|
-
if (dayMonthValue != opts.leapday)
|
272
|
-
return true;
|
273
|
-
else {
|
274
|
-
var year = parseInt(buffer.join('').substr(0, 4),10); //detect leap year
|
275
|
-
if (year % 4 === 0)
|
276
|
-
if (year % 100 === 0)
|
277
|
-
if (year % 400 === 0)
|
278
|
-
return true;
|
279
|
-
else return false;
|
280
|
-
else return true;
|
281
|
-
else return false;
|
282
|
-
}
|
283
|
-
}
|
284
|
-
|
285
|
-
return isValid;
|
286
|
-
},
|
287
|
-
cardinality: 2,
|
288
|
-
prevalidator: [{ validator: function(chrs, buffer, pos, strict, opts) {
|
289
|
-
var frontValue = buffer.join('').substr(5, 3);
|
290
|
-
var isValid = opts.regex.val2pre(opts.separator).test(frontValue + chrs);
|
291
|
-
if (!strict && !isValid) {
|
292
|
-
isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs);
|
293
|
-
if (isValid) {
|
294
|
-
buffer[pos] = "0";
|
295
|
-
pos++;
|
296
|
-
return { "pos": pos };
|
297
|
-
}
|
298
|
-
}
|
299
|
-
return isValid;
|
300
|
-
}, cardinality: 1}]
|
301
|
-
}
|
302
|
-
}
|
303
|
-
},
|
304
|
-
'dd.mm.yyyy': {
|
305
|
-
mask: "1.2.y",
|
306
|
-
placeholder: "dd.mm.yyyy",
|
307
|
-
leapday: "29.02.",
|
308
|
-
separator: '.',
|
309
|
-
alias: "dd/mm/yyyy"
|
310
|
-
},
|
311
|
-
'dd-mm-yyyy': {
|
312
|
-
mask: "1-2-y",
|
313
|
-
placeholder: "dd-mm-yyyy",
|
314
|
-
leapday: "29-02-",
|
315
|
-
separator: '-',
|
316
|
-
alias: "dd/mm/yyyy"
|
317
|
-
},
|
318
|
-
'mm.dd.yyyy': {
|
319
|
-
mask: "1.2.y",
|
320
|
-
placeholder: "mm.dd.yyyy",
|
321
|
-
leapday: "02.29.",
|
322
|
-
separator: '.',
|
323
|
-
alias: "mm/dd/yyyy"
|
324
|
-
},
|
325
|
-
'mm-dd-yyyy': {
|
326
|
-
mask: "1-2-y",
|
327
|
-
placeholder: "mm-dd-yyyy",
|
328
|
-
leapday: "02-29-",
|
329
|
-
separator: '-',
|
330
|
-
alias: "mm/dd/yyyy"
|
331
|
-
},
|
332
|
-
'yyyy.mm.dd': {
|
333
|
-
mask: "y.1.2",
|
334
|
-
placeholder: "yyyy.mm.dd",
|
335
|
-
leapday: ".02.29",
|
336
|
-
separator: '.',
|
337
|
-
alias: "yyyy/mm/dd"
|
338
|
-
},
|
339
|
-
'yyyy-mm-dd': {
|
340
|
-
mask: "y-1-2",
|
341
|
-
placeholder: "yyyy-mm-dd",
|
342
|
-
leapday: "-02-29",
|
343
|
-
separator: '-',
|
344
|
-
alias: "yyyy/mm/dd"
|
345
|
-
},
|
346
|
-
'datetime': {
|
347
|
-
mask: "1/2/y h:s",
|
348
|
-
placeholder: "dd/mm/yyyy hh:mm",
|
349
|
-
alias: "dd/mm/yyyy",
|
350
|
-
regex: {
|
351
|
-
hrspre: new RegExp("[012]"), //hours pre
|
352
|
-
hrs24: new RegExp("2[0-9]|1[3-9]"),
|
353
|
-
hrs: new RegExp("[01][0-9]|2[0-3]"), //hours
|
354
|
-
ampmpre: new RegExp("[apAP]"),
|
355
|
-
ampm: new RegExp("^[a|p|A|P][m|M]")
|
356
|
-
},
|
357
|
-
timeseparator: ':',
|
358
|
-
hourFormat: "24", // or 12
|
359
|
-
definitions: {
|
360
|
-
'h': { //hours
|
361
|
-
validator: function(chrs, buffer, pos, strict, opts) {
|
362
|
-
var isValid = opts.regex.hrs.test(chrs);
|
363
|
-
if (!strict && !isValid) {
|
364
|
-
if (chrs.charAt(1) == opts.timeseparator || "-.:".indexOf(chrs.charAt(1)) != -1 ) {
|
365
|
-
isValid = opts.regex.hrs.test("0" + chrs.charAt(0));
|
366
|
-
if (isValid) {
|
367
|
-
buffer[pos - 1] = "0";
|
368
|
-
buffer[pos] = chrs.charAt(0);
|
369
|
-
pos++;
|
370
|
-
return { "pos": pos };
|
371
|
-
}
|
372
|
-
}
|
373
|
-
}
|
374
|
-
|
375
|
-
if ( isValid && opts.hourFormat !== "24" && opts.regex.hrs24.test(chrs) ) {
|
376
|
-
|
377
|
-
var tmp = parseInt(chrs,10);
|
378
|
-
|
379
|
-
if ( tmp == 24 ) {
|
380
|
-
buffer[pos+5] = "a";
|
381
|
-
buffer[pos+6] = "m";
|
382
|
-
} else {
|
383
|
-
buffer[pos+5] = "p";
|
384
|
-
buffer[pos+6] = "m";
|
385
|
-
}
|
386
|
-
|
387
|
-
tmp = tmp - 12;
|
388
|
-
|
389
|
-
if ( tmp < 10 ) {
|
390
|
-
buffer[pos] = tmp.toString();
|
391
|
-
buffer[pos-1] = "0";
|
392
|
-
} else {
|
393
|
-
buffer[pos] = tmp.toString().charAt(1);
|
394
|
-
buffer[pos-1] = tmp.toString().charAt(0);
|
395
|
-
}
|
396
|
-
|
397
|
-
return { "pos": pos, "c" : buffer[pos] };
|
398
|
-
}
|
399
|
-
|
400
|
-
return isValid;
|
401
|
-
},
|
402
|
-
cardinality: 2,
|
403
|
-
prevalidator: [{ validator: function(chrs, buffer, pos, strict, opts) {
|
404
|
-
var isValid = opts.regex.hrspre.test(chrs);
|
405
|
-
if (!strict && !isValid) {
|
406
|
-
isValid = opts.regex.hrs.test("0" + chrs);
|
407
|
-
if (isValid) {
|
408
|
-
buffer[pos] = "0";
|
409
|
-
pos++;
|
410
|
-
return { "pos": pos };
|
411
|
-
}
|
412
|
-
}
|
413
|
-
return isValid;
|
414
|
-
}, cardinality: 1}]
|
415
|
-
},
|
416
|
-
't': { //am/pm
|
417
|
-
validator: function(chrs, buffer, pos, strict, opts) {
|
418
|
-
var isValid = opts.regex.ampm.test(chrs);
|
419
|
-
if (!strict && !isValid) {
|
420
|
-
isValid = opts.regex.ampm.test(chrs+'m');
|
421
|
-
if (isValid) {
|
422
|
-
buffer[pos - 1] = chrs.charAt(0);
|
423
|
-
buffer[pos] = "m";
|
424
|
-
pos++;
|
425
|
-
return pos;
|
426
|
-
}
|
427
|
-
}
|
428
|
-
return isValid;
|
429
|
-
},
|
430
|
-
casing: "lower",
|
431
|
-
cardinality: 2,
|
432
|
-
prevalidator: [{ validator: function(chrs, buffer, pos, strict, opts) {
|
433
|
-
var isValid = opts.regex.ampmpre.test(chrs);
|
434
|
-
if (isValid) {
|
435
|
-
isValid = opts.regex.ampm.test(chrs+"m");
|
436
|
-
if (isValid) {
|
437
|
-
buffer[pos] = chrs;
|
438
|
-
buffer[pos+1] = 'm';
|
439
|
-
return pos;
|
440
|
-
}
|
441
|
-
}
|
442
|
-
return isValid;
|
443
|
-
}, cardinality: 1}]
|
444
|
-
}
|
445
|
-
},
|
446
|
-
insertMode: false,
|
447
|
-
autoUnmask: false
|
448
|
-
},
|
449
|
-
'datetime12': {
|
450
|
-
mask: "1/2/y h:s t",
|
451
|
-
placeholder: "dd/mm/yyyy hh:mm xm",
|
452
|
-
alias: "datetime",
|
453
|
-
hourFormat: "12"
|
454
|
-
},
|
455
|
-
'hh:mm t': {
|
456
|
-
mask: "h:s t",
|
457
|
-
placeholder: "hh:mm xm",
|
458
|
-
alias: "datetime",
|
459
|
-
hourFormat: "12"
|
460
|
-
},
|
461
|
-
'h:s t': {
|
462
|
-
mask: "h:s t",
|
463
|
-
placeholder: "hh:mm xm",
|
464
|
-
alias: "datetime",
|
465
|
-
hourFormat: "12"
|
466
|
-
},
|
467
|
-
'hh:mm:ss': {
|
468
|
-
mask: "h:s:s",
|
469
|
-
autoUnmask: false
|
470
|
-
},
|
471
|
-
'hh:mm': {
|
472
|
-
mask: "h:s",
|
473
|
-
autoUnmask: false
|
474
|
-
},
|
475
|
-
'date': {
|
476
|
-
alias: "dd/mm/yyyy" // "mm/dd/yyyy"
|
477
|
-
}
|
478
|
-
});
|
479
|
-
})(jQuery);
|
1
|
+
(function(h){h.extend(h.inputmask.defaults.definitions,{h:{validator:"[01][0-9]|2[0-3]",cardinality:2,prevalidator:[{validator:"[0-2]",cardinality:1}]},s:{validator:"[0-5][0-9]",cardinality:2,prevalidator:[{validator:"[0-5]",cardinality:1}]},d:{validator:"0[1-9]|[12][0-9]|3[01]",cardinality:2,prevalidator:[{validator:"[0-3]",cardinality:1}]},m:{validator:"0[1-9]|1[012]",cardinality:2,prevalidator:[{validator:"[01]",cardinality:1}]},y:{validator:"(19|20)\\d{2}",cardinality:4,prevalidator:[{validator:"[12]",
|
2
|
+
cardinality:1},{validator:"(19|20)",cardinality:2},{validator:"(19|20)\\d",cardinality:3}]}});h.extend(h.inputmask.defaults.aliases,{"dd/mm/yyyy":{mask:"1/2/y",placeholder:"dd/mm/yyyy",regex:{val1pre:/[0-3]/,val1:/0[1-9]|[12][0-9]|3[01]/,val2pre:function(a){a=h.inputmask.escapeRegex.call(this,a);return RegExp("((0[1-9]|[12][0-9]|3[01])"+a+"[01])")},val2:function(a){a=h.inputmask.escapeRegex.call(this,a);return RegExp("((0[1-9]|[12][0-9])"+a+"(0[1-9]|1[012]))|(30"+a+"(0[13-9]|1[012]))|(31"+a+"(0[13578]|1[02]))")}},
|
3
|
+
leapday:"29/02/",separator:"/",yearrange:{minyear:1900,maxyear:2099},isInYearRange:function(a,d,c){var f=parseInt(a.concat(d.toString().slice(a.length)));a=parseInt(a.concat(c.toString().slice(a.length)));return(NaN!=f?d<=f&&f<=c:!1)||(NaN!=a?d<=a&&a<=c:!1)},determinebaseyear:function(a,d,c){var f=(new Date).getFullYear();if(a>f)return a;if(d<f){for(var f=d.toString().slice(0,2),b=d.toString().slice(2,4);d<f+c;)f--;d=f+b;return a>d?a:d}return f},onKeyUp:function(a,d,c){d=h(this);a.ctrlKey&&a.keyCode==
|
4
|
+
c.keyCode.RIGHT&&(a=new Date,d.val(a.getDate().toString()+(a.getMonth()+1).toString()+a.getFullYear().toString()))},definitions:{1:{validator:function(a,d,c,f,b){var e=b.regex.val1.test(a);return f||e||a.charAt(1)!=b.separator&&-1=="-./".indexOf(a.charAt(1))||!(e=b.regex.val1.test("0"+a.charAt(0)))?e:(d[c-1]="0",{pos:c,c:a.charAt(0)})},cardinality:2,prevalidator:[{validator:function(a,d,c,f,b){var e=b.regex.val1pre.test(a);return f||e||!(e=b.regex.val1.test("0"+a))?e:(d[c]="0",c++,{pos:c})},cardinality:1}]},
|
5
|
+
2:{validator:function(a,d,c,f,b){var e=d.join("").substr(0,3);-1!=e.indexOf(b.placeholder[0])&&(e="01"+b.separator);var g=b.regex.val2(b.separator).test(e+a);return f||g||a.charAt(1)!=b.separator&&-1=="-./".indexOf(a.charAt(1))||!(g=b.regex.val2(b.separator).test(e+"0"+a.charAt(0)))?g:(d[c-1]="0",{pos:c,c:a.charAt(0)})},cardinality:2,prevalidator:[{validator:function(a,d,c,f,b){var e=d.join("").substr(0,3);-1!=e.indexOf(b.placeholder[0])&&(e="01"+b.separator);var g=b.regex.val2pre(b.separator).test(e+
|
6
|
+
a);return f||g||!(g=b.regex.val2(b.separator).test(e+"0"+a))?g:(d[c]="0",c++,{pos:c})},cardinality:1}]},y:{validator:function(a,d,c,f,b){if(b.isInYearRange(a,b.yearrange.minyear,b.yearrange.maxyear)){if(d.join("").substr(0,6)!=b.leapday)return!0;a=parseInt(a,10);return 0===a%4?0===a%100?0===a%400?!0:!1:!0:!1}return!1},cardinality:4,prevalidator:[{validator:function(a,d,c,f,b){var e=b.isInYearRange(a,b.yearrange.minyear,b.yearrange.maxyear);if(!f&&!e){f=b.determinebaseyear(b.yearrange.minyear,b.yearrange.maxyear,
|
7
|
+
a+"0").toString().slice(0,1);if(e=b.isInYearRange(f+a,b.yearrange.minyear,b.yearrange.maxyear))return d[c++]=f[0],{pos:c};f=b.determinebaseyear(b.yearrange.minyear,b.yearrange.maxyear,a+"0").toString().slice(0,2);if(e=b.isInYearRange(f+a,b.yearrange.minyear,b.yearrange.maxyear))return d[c++]=f[0],d[c++]=f[1],{pos:c}}return e},cardinality:1},{validator:function(a,d,c,f,b){var e=b.isInYearRange(a,b.yearrange.minyear,b.yearrange.maxyear);if(!f&&!e){f=b.determinebaseyear(b.yearrange.minyear,b.yearrange.maxyear,
|
8
|
+
a).toString().slice(0,2);if(e=b.isInYearRange(a[0]+f[1]+a[1],b.yearrange.minyear,b.yearrange.maxyear))return d[c++]=f[1],{pos:c};f=b.determinebaseyear(b.yearrange.minyear,b.yearrange.maxyear,a).toString().slice(0,2);b.isInYearRange(f+a,b.yearrange.minyear,b.yearrange.maxyear)?d.join("").substr(0,6)!=b.leapday?e=!0:(b=parseInt(a,10),e=0===b%4?0===b%100?0===b%400?!0:!1:!0:!1):e=!1;if(e)return d[c-1]=f[0],d[c++]=f[1],d[c++]=a[0],{pos:c}}return e},cardinality:2},{validator:function(a,d,c,f,b){return b.isInYearRange(a,
|
9
|
+
b.yearrange.minyear,b.yearrange.maxyear)},cardinality:3}]}},insertMode:!1,autoUnmask:!1},"mm/dd/yyyy":{placeholder:"mm/dd/yyyy",alias:"dd/mm/yyyy",regex:{val2pre:function(a){a=h.inputmask.escapeRegex.call(this,a);return RegExp("((0[13-9]|1[012])"+a+"[0-3])|(02"+a+"[0-2])")},val2:function(a){a=h.inputmask.escapeRegex.call(this,a);return RegExp("((0[1-9]|1[012])"+a+"(0[1-9]|[12][0-9]))|((0[13-9]|1[012])"+a+"30)|((0[13578]|1[02])"+a+"31)")},val1pre:/[01]/,val1:/0[1-9]|1[012]/},leapday:"02/29/",onKeyUp:function(a,
|
10
|
+
d,c){d=h(this);a.ctrlKey&&a.keyCode==c.keyCode.RIGHT&&(a=new Date,d.val((a.getMonth()+1).toString()+a.getDate().toString()+a.getFullYear().toString()))}},"yyyy/mm/dd":{mask:"y/1/2",placeholder:"yyyy/mm/dd",alias:"mm/dd/yyyy",leapday:"/02/29",onKeyUp:function(a,d,c){d=h(this);a.ctrlKey&&a.keyCode==c.keyCode.RIGHT&&(a=new Date,d.val(a.getFullYear().toString()+(a.getMonth()+1).toString()+a.getDate().toString()))},definitions:{2:{validator:function(a,d,c,f,b){var e=d.join("").substr(5,3);-1!=e.indexOf(b.placeholder[5])&&
|
11
|
+
(e="01"+b.separator);var g=b.regex.val2(b.separator).test(e+a);if(!(f||g||a.charAt(1)!=b.separator&&-1=="-./".indexOf(a.charAt(1)))&&(g=b.regex.val2(b.separator).test(e+"0"+a.charAt(0))))return d[c-1]="0",{pos:c,c:a.charAt(0)};if(g){if(d.join("").substr(4,4)+a!=b.leapday)return!0;a=parseInt(d.join("").substr(0,4),10);return 0===a%4?0===a%100?0===a%400?!0:!1:!0:!1}return g},cardinality:2,prevalidator:[{validator:function(a,d,c,f,b){var e=d.join("").substr(5,3);-1!=e.indexOf(b.placeholder[5])&&(e="01"+
|
12
|
+
b.separator);var g=b.regex.val2pre(b.separator).test(e+a);return f||g||!(g=b.regex.val2(b.separator).test(e+"0"+a))?g:(d[c]="0",c++,{pos:c})},cardinality:1}]}}},"dd.mm.yyyy":{mask:"1.2.y",placeholder:"dd.mm.yyyy",leapday:"29.02.",separator:".",alias:"dd/mm/yyyy"},"dd-mm-yyyy":{mask:"1-2-y",placeholder:"dd-mm-yyyy",leapday:"29-02-",separator:"-",alias:"dd/mm/yyyy"},"mm.dd.yyyy":{mask:"1.2.y",placeholder:"mm.dd.yyyy",leapday:"02.29.",separator:".",alias:"mm/dd/yyyy"},"mm-dd-yyyy":{mask:"1-2-y",placeholder:"mm-dd-yyyy",
|
13
|
+
leapday:"02-29-",separator:"-",alias:"mm/dd/yyyy"},"yyyy.mm.dd":{mask:"y.1.2",placeholder:"yyyy.mm.dd",leapday:".02.29",separator:".",alias:"yyyy/mm/dd"},"yyyy-mm-dd":{mask:"y-1-2",placeholder:"yyyy-mm-dd",leapday:"-02-29",separator:"-",alias:"yyyy/mm/dd"},datetime:{mask:"1/2/y h:s",placeholder:"dd/mm/yyyy hh:mm",alias:"dd/mm/yyyy",regex:{hrspre:/[012]/,hrs24:/2[0-9]|1[3-9]/,hrs:/[01][0-9]|2[0-3]/,ampm:/^[a|p|A|P][m|M]/},timeseparator:":",hourFormat:"24",definitions:{h:{validator:function(a,d,c,f,
|
14
|
+
b){var e=b.regex.hrs.test(a);return f||e||a.charAt(1)!=b.timeseparator&&-1=="-.:".indexOf(a.charAt(1))||!(e=b.regex.hrs.test("0"+a.charAt(0)))?e&&"24"!==b.hourFormat&&b.regex.hrs24.test(a)?(a=parseInt(a,10),d[c+5]=24==a?"a":"p",d[c+6]="m",a-=12,10>a?(d[c]=a.toString(),d[c-1]="0"):(d[c]=a.toString().charAt(1),d[c-1]=a.toString().charAt(0)),{pos:c,c:d[c]}):e:(d[c-1]="0",d[c]=a.charAt(0),c++,{pos:c})},cardinality:2,prevalidator:[{validator:function(a,d,c,f,b){var e=b.regex.hrspre.test(a);return f||e||
|
15
|
+
!(e=b.regex.hrs.test("0"+a))?e:(d[c]="0",c++,{pos:c})},cardinality:1}]},t:{validator:function(a,d,c,f,b){return b.regex.ampm.test(a+"m")},casing:"lower",cardinality:1}},insertMode:!1,autoUnmask:!1},datetime12:{mask:"1/2/y h:s t\\m",placeholder:"dd/mm/yyyy hh:mm xm",alias:"datetime",hourFormat:"12"},"hh:mm t":{mask:"h:s t\\m",placeholder:"hh:mm xm",alias:"datetime",hourFormat:"12"},"h:s t":{mask:"h:s t\\m",placeholder:"hh:mm xm",alias:"datetime",hourFormat:"12"},"hh:mm:ss":{mask:"h:s:s",autoUnmask:!1},
|
16
|
+
"hh:mm":{mask:"h:s",autoUnmask:!1},date:{alias:"dd/mm/yyyy"},"mm/yyyy":{mask:"1/y",placeholder:"mm/yyyy",leapday:"donotuse",separator:"/",alias:"mm/dd/yyyy"}})})(jQuery);
|