|
|
@@ -3,7 +3,7 @@
|
|
|
* http://github.com/RobinHerbots/jquery.inputmask
|
|
|
* Copyright (c) 2010 - 2015 Robin Herbots
|
|
|
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
|
-* Version: 3.1.63-2
|
|
|
+* Version: 3.1.63-7
|
|
|
*/
|
|
|
!function($) {
|
|
|
function isInputEventSupported(eventName) {
|
|
|
@@ -202,9 +202,8 @@
|
|
|
if (baseOnInput === !0 && getMaskSet().validPositions[pos]) {
|
|
|
var validPos = getMaskSet().validPositions[pos];
|
|
|
test = validPos.match, ndxIntlzr = validPos.locator.slice(), maskTemplate.push(includeInput === !0 ? validPos.input : getPlaceholder(pos, test));
|
|
|
- } else console.log("getmasktemplate " + pos + " " + JSON.stringify(ndxIntlzr)),
|
|
|
- testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), test = testPos.match, ndxIntlzr = testPos.locator.slice(),
|
|
|
- maskTemplate.push(getPlaceholder(pos, test));
|
|
|
+ } else testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), test = testPos.match,
|
|
|
+ ndxIntlzr = testPos.locator.slice(), maskTemplate.push(getPlaceholder(pos, test));
|
|
|
pos++;
|
|
|
} while ((void 0 == maxLength || maxLength > pos - 1) && null != test.fn || null == test.fn && "" != test.def || minimalPos >= pos);
|
|
|
return maskTemplate.pop(), maskTemplate;
|
|
|
@@ -271,7 +270,7 @@
|
|
|
}
|
|
|
function getTestTemplate(pos, ndxIntlzr, tstPs) {
|
|
|
var testPos = getMaskSet().validPositions[pos];
|
|
|
- if (void 0 == testPos) for (var testPositions = getTests(pos, ndxIntlzr, tstPs), lvp = getLastValidPosition(), lvTest = getMaskSet().validPositions[lvp] || getTests(0, void 0, void 0)[0], lvTestAltArr = void 0 != lvTest.alternation ? lvTest.locator[lvTest.alternation].toString().split(",") : [], ndx = 0; ndx < testPositions.length && (testPos = testPositions[ndx],
|
|
|
+ if (void 0 == testPos) for (var testPositions = getTests(pos, ndxIntlzr, tstPs), lvp = getLastValidPosition(), lvTest = getMaskSet().validPositions[lvp] || getTests(0)[0], lvTestAltArr = void 0 != lvTest.alternation ? lvTest.locator[lvTest.alternation].toString().split(",") : [], ndx = 0; ndx < testPositions.length && (testPos = testPositions[ndx],
|
|
|
!(testPos.match && (opts.greedy && testPos.match.optionalQuantifier !== !0 || (testPos.match.optionality === !1 || testPos.match.newBlockMarker === !1) && testPos.match.optionalQuantifier !== !0) && (void 0 == lvTest.alternation || lvTest.alternation != testPos.alternation || void 0 != testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAltArr)))); ndx++) ;
|
|
|
return testPos;
|
|
|
}
|
|
|
@@ -311,12 +310,12 @@
|
|
|
"string" == typeof altIndex && (altIndexArr = altIndex.split(","));
|
|
|
for (var amndx = 0; amndx < alternateToken.matches.length; amndx++) {
|
|
|
if (matches = [], match = handleMatch(alternateToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse) || match,
|
|
|
- match !== !0) {
|
|
|
+ match !== !0 && void 0 != match && altIndexArr[altIndexArr.length - 1] < alternateToken.matches.length) {
|
|
|
var ntndx = maskToken.matches.indexOf(match) + 1;
|
|
|
- match = handleMatch(maskToken.matches[ntndx], [ ntndx ].concat(loopNdx.slice(1, loopNdx.length)), quantifierRecurse),
|
|
|
+ maskToken.matches.length > ntndx && (match = handleMatch(maskToken.matches[ntndx], [ ntndx ].concat(loopNdx.slice(1, loopNdx.length)), quantifierRecurse),
|
|
|
match && (altIndexArr.push(ntndx.toString()), $.each(matches, function(ndx, lmnt) {
|
|
|
lmnt.alternation = loopNdx.length - 1;
|
|
|
- }));
|
|
|
+ })));
|
|
|
}
|
|
|
maltMatches = matches.slice(), testPos = currentPos, matches = [];
|
|
|
for (var i = 0; i < ndxInitializerClone.length; i++) ndxInitializer[i] = ndxInitializerClone[i];
|
|
|
@@ -326,7 +325,7 @@
|
|
|
for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {
|
|
|
var altMatch2 = malternateMatches[ndx2];
|
|
|
if (altMatch.match.mask == altMatch2.match.mask && ("string" != typeof altIndex || -1 != $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr))) {
|
|
|
- maltMatches.splice(ndx1, 1), altMatch2.locator[altMatch.alternation] = altMatch2.locator[altMatch.alternation] + "," + altMatch.locator[altMatch.alternation],
|
|
|
+ maltMatches.splice(ndx1, 1), ndx1--, altMatch2.locator[altMatch.alternation] = altMatch2.locator[altMatch.alternation] + "," + altMatch.locator[altMatch.alternation],
|
|
|
altMatch2.alternation = altMatch.alternation;
|
|
|
break;
|
|
|
}
|
|
|
@@ -344,7 +343,7 @@
|
|
|
lmnt.alternation = alternation);
|
|
|
if (void 0 != lmnt.locator[alternation]) return lmnt;
|
|
|
}
|
|
|
- })), matches = currentMatches.concat(malternateMatches), testPos = pos, insertStop = !0;
|
|
|
+ })), matches = currentMatches.concat(malternateMatches), testPos = pos, insertStop = matches.length > 0;
|
|
|
} else match = alternateToken.matches[altIndex] ? handleMatch(alternateToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse) : !1;
|
|
|
if (match) return !0;
|
|
|
} else if (match.isQuantifier && quantifierRecurse !== !0) for (var qt = match, qndx = ndxInitializer.length > 0 && quantifierRecurse !== !0 ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && pos >= testPos; qndx++) {
|
|
|
@@ -372,6 +371,7 @@
|
|
|
}
|
|
|
}
|
|
|
var maskTokens = getMaskSet().maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr || [ 0 ], matches = [], insertStop = !1;
|
|
|
+ if (cacheable === !0 && getMaskSet().tests[pos]) return getMaskSet().tests[pos];
|
|
|
if (void 0 == ndxIntlzr) {
|
|
|
for (var test, previousPos = pos - 1; void 0 == (test = getMaskSet().validPositions[previousPos]) && previousPos > -1; ) previousPos--;
|
|
|
if (void 0 != test && previousPos > -1) testPos = previousPos, ndxInitializer = test.locator.slice(); else {
|
|
|
@@ -392,8 +392,7 @@
|
|
|
def: ""
|
|
|
},
|
|
|
locator: []
|
|
|
- }), getMaskSet().tests[pos] = $.extend(!0, [], matches), console.log(pos + " - " + JSON.stringify(matches)),
|
|
|
- getMaskSet().tests[pos];
|
|
|
+ }), getMaskSet().tests[pos] = $.extend(!0, [], matches), getMaskSet().tests[pos];
|
|
|
}
|
|
|
function getBufferTemplate() {
|
|
|
return void 0 == getMaskSet()._buffer && (getMaskSet()._buffer = getMaskTemplate(!1, 1)),
|
|
|
@@ -2251,21 +2250,9 @@
|
|
|
return $.extend($.inputmask.defaults.aliases, {
|
|
|
phone: {
|
|
|
url: "phone-codes/phone-codes.js",
|
|
|
- maskInit: "+pp(pp)pppppppp",
|
|
|
countrycode: "",
|
|
|
mask: function(opts) {
|
|
|
- opts.definitions = {
|
|
|
- p: {
|
|
|
- validator: function() {
|
|
|
- return !1;
|
|
|
- },
|
|
|
- cardinality: 1
|
|
|
- },
|
|
|
- "#": {
|
|
|
- validator: "[0-9]",
|
|
|
- cardinality: 1
|
|
|
- }
|
|
|
- };
|
|
|
+ opts.definitions["#"] = opts.definitions[9];
|
|
|
var maskList = [];
|
|
|
return $.ajax({
|
|
|
url: opts.url,
|
|
|
@@ -2279,9 +2266,9 @@
|
|
|
}
|
|
|
}), maskList = maskList.sort(function(a, b) {
|
|
|
return (a.mask || a) < (b.mask || b) ? -1 : 1;
|
|
|
- }), "" != opts.countrycode && (opts.maskInit = "+" + opts.countrycode + opts.maskInit.substring(3)),
|
|
|
- maskList.splice(0, 0, opts.maskInit), maskList;
|
|
|
+ });
|
|
|
},
|
|
|
+ keepStatic: !1,
|
|
|
nojumps: !0,
|
|
|
nojumpsThreshold: 1,
|
|
|
onBeforeMask: function(value, opts) {
|