|
@@ -3,7 +3,7 @@
|
|
|
* http://github.com/RobinHerbots/jquery.inputmask
|
|
* http://github.com/RobinHerbots/jquery.inputmask
|
|
|
* Copyright (c) 2010 - 2015 Robin Herbots
|
|
* Copyright (c) 2010 - 2015 Robin Herbots
|
|
|
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
|
-* Version: 3.2.5-7
|
|
|
|
|
|
|
+* Version: 3.2.5-18
|
|
|
*/
|
|
*/
|
|
|
!function($) {
|
|
!function($) {
|
|
|
function Inputmask(alias, options) {
|
|
function Inputmask(alias, options) {
|
|
@@ -562,7 +562,7 @@
|
|
|
return !1;
|
|
return !1;
|
|
|
}
|
|
}
|
|
|
function trackbackAlternations(originalPos, newPos) {
|
|
function trackbackAlternations(originalPos, newPos) {
|
|
|
- for (var vp = getMaskSet().validPositions[newPos], targetLocator = vp.locator, tll = targetLocator.length, ps = originalPos; newPos > ps; ps++) if (!isMask(ps)) {
|
|
|
|
|
|
|
+ for (var vp = getMaskSet().validPositions[newPos], targetLocator = vp.locator, tll = targetLocator.length, ps = originalPos; newPos > ps; ps++) if (!isMask(ps, !0)) {
|
|
|
var tests = getTests(ps), bestMatch = tests[0], equality = -1;
|
|
var tests = getTests(ps), bestMatch = tests[0], equality = -1;
|
|
|
$.each(tests, function(ndx, tst) {
|
|
$.each(tests, function(ndx, tst) {
|
|
|
for (var i = 0; tll > i; i++) tst.locator[i] && checkAlternationMatch(tst.locator[i].toString().split(","), targetLocator[i].toString().split(",")) && i > equality && (equality = i,
|
|
for (var i = 0; tll > i; i++) tst.locator[i] && checkAlternationMatch(tst.locator[i].toString().split(","), targetLocator[i].toString().split(",")) && i > equality && (equality = i,
|
|
@@ -580,7 +580,7 @@
|
|
|
(!strict || fromSetValid) && result === !1)) {
|
|
(!strict || fromSetValid) && result === !1)) {
|
|
|
var currentPosValid = getMaskSet().validPositions[maskPos];
|
|
var currentPosValid = getMaskSet().validPositions[maskPos];
|
|
|
if (!currentPosValid || null !== currentPosValid.match.fn || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) {
|
|
if (!currentPosValid || null !== currentPosValid.match.fn || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) {
|
|
|
- if ((opts.insertMode || void 0 === getMaskSet().validPositions[seekNext(maskPos)]) && !isMask(maskPos)) for (var nPos = maskPos + 1, snPos = seekNext(maskPos); snPos >= nPos; nPos++) if (result = _isValid(nPos, c, strict, fromSetValid),
|
|
|
|
|
|
|
+ if ((opts.insertMode || void 0 === getMaskSet().validPositions[seekNext(maskPos)]) && !isMask(maskPos, !0)) for (var nPos = maskPos + 1, snPos = seekNext(maskPos); snPos >= nPos; nPos++) if (result = _isValid(nPos, c, strict, fromSetValid),
|
|
|
result !== !1) {
|
|
result !== !1) {
|
|
|
trackbackAlternations(maskPos, nPos), maskPos = nPos;
|
|
trackbackAlternations(maskPos, nPos), maskPos = nPos;
|
|
|
break;
|
|
break;
|
|
@@ -605,10 +605,10 @@
|
|
|
}
|
|
}
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
- function isMask(pos) {
|
|
|
|
|
|
|
+ function isMask(pos, strict) {
|
|
|
var test = getTest(pos);
|
|
var test = getTest(pos);
|
|
|
if (null != test.fn) return test.fn;
|
|
if (null != test.fn) return test.fn;
|
|
|
- if (pos > -1 && !opts.keepStatic && void 0 === getMaskSet().validPositions[pos]) {
|
|
|
|
|
|
|
+ if (strict !== !0 && pos > -1 && !opts.keepStatic && void 0 === getMaskSet().validPositions[pos]) {
|
|
|
var tests = getTests(pos, void 0, void 0, !0);
|
|
var tests = getTests(pos, void 0, void 0, !0);
|
|
|
return tests.length > 2;
|
|
return tests.length > 2;
|
|
|
}
|
|
}
|
|
@@ -657,14 +657,9 @@
|
|
|
if (test = test || getTest(pos), void 0 !== test.placeholder) return test.placeholder;
|
|
if (test = test || getTest(pos), void 0 !== test.placeholder) return test.placeholder;
|
|
|
if (null === test.fn) {
|
|
if (null === test.fn) {
|
|
|
if (pos > -1 && !opts.keepStatic && void 0 === getMaskSet().validPositions[pos]) {
|
|
if (pos > -1 && !opts.keepStatic && void 0 === getMaskSet().validPositions[pos]) {
|
|
|
- for (var prevTest, tests = getTests(pos), hasAlternations = !1, i = 0; i < tests.length; i++) {
|
|
|
|
|
- if (prevTest && "" !== tests[i].match.def && tests[i].match.def !== prevTest.match.def && (void 0 === tests[i].alternation || tests[i].alternation === prevTest.alternation)) {
|
|
|
|
|
- hasAlternations = !0;
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- tests[i].match.optionality !== !0 && tests[i].match.optionalQuantifier !== !0 && (prevTest = tests[i]);
|
|
|
|
|
- }
|
|
|
|
|
- if (hasAlternations) return opts.placeholder.charAt(pos % opts.placeholder.length);
|
|
|
|
|
|
|
+ var prevTest, tests = getTests(pos), staticAlternations = 0;
|
|
|
|
|
+ if (tests.length > 2) for (var i = 0; i < tests.length; i++) if (tests[i].match.optionality !== !0 && tests[i].match.optionalQuantifier !== !0 && (null === tests[i].match.fn || void 0 === prevTest || tests[i].match.fn.test(prevTest.match.def, getMaskSet(), pos, !0, opts) !== !1) && (staticAlternations++,
|
|
|
|
|
+ null === tests[i].match.fn && (prevTest = tests[i]), staticAlternations > 1)) return opts.placeholder.charAt(pos % opts.placeholder.length);
|
|
|
}
|
|
}
|
|
|
return test.def;
|
|
return test.def;
|
|
|
}
|
|
}
|
|
@@ -1069,7 +1064,7 @@
|
|
|
var selectedCaret = caret(input);
|
|
var selectedCaret = caret(input);
|
|
|
if (selectedCaret.begin === selectedCaret.end) if (doRadixFocus(selectedCaret.begin)) caret(input, $.inArray(opts.radixPoint, getBuffer())); else {
|
|
if (selectedCaret.begin === selectedCaret.end) if (doRadixFocus(selectedCaret.begin)) caret(input, $.inArray(opts.radixPoint, getBuffer())); else {
|
|
|
var clickPosition = selectedCaret.begin, lvclickPosition = getLastValidPosition(clickPosition), lastPosition = seekNext(lvclickPosition);
|
|
var clickPosition = selectedCaret.begin, lvclickPosition = getLastValidPosition(clickPosition), lastPosition = seekNext(lvclickPosition);
|
|
|
- lastPosition > clickPosition ? caret(input, isMask(clickPosition) || isMask(clickPosition - 1) ? clickPosition : seekNext(clickPosition)) : (getBuffer()[lastPosition] !== getPlaceholder(lastPosition) && (lastPosition = seekNext(lastPosition)),
|
|
|
|
|
|
|
+ lastPosition > clickPosition ? caret(input, isMask(clickPosition) || isMask(clickPosition - 1) ? clickPosition : seekNext(clickPosition)) : ((getBuffer()[lastPosition] !== getPlaceholder(lastPosition) || !isMask(lastPosition, !0) && getTest(lastPosition).def === getPlaceholder(lastPosition)) && (lastPosition = seekNext(lastPosition)),
|
|
|
caret(input, opts.numericInput ? 0 : lastPosition));
|
|
caret(input, opts.numericInput ? 0 : lastPosition));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1965,58 +1960,7 @@
|
|
|
}
|
|
}
|
|
|
}), Inputmask.extendAliases({
|
|
}), Inputmask.extendAliases({
|
|
|
url: {
|
|
url: {
|
|
|
- mask: "ir",
|
|
|
|
|
- placeholder: "",
|
|
|
|
|
- separator: "",
|
|
|
|
|
- defaultPrefix: "http://",
|
|
|
|
|
- regex: {
|
|
|
|
|
- urlpre1: new RegExp("[fh]"),
|
|
|
|
|
- urlpre2: new RegExp("(ft|ht)"),
|
|
|
|
|
- urlpre3: new RegExp("(ftp|htt)"),
|
|
|
|
|
- urlpre4: new RegExp("(ftp:|http|ftps)"),
|
|
|
|
|
- urlpre5: new RegExp("(ftp:/|ftps:|http:|https)"),
|
|
|
|
|
- urlpre6: new RegExp("(ftp://|ftps:/|http:/|https:)"),
|
|
|
|
|
- urlpre7: new RegExp("(ftp://|ftps://|http://|https:/)"),
|
|
|
|
|
- urlpre8: new RegExp("(ftp://|ftps://|http://|https://)")
|
|
|
|
|
- },
|
|
|
|
|
- definitions: {
|
|
|
|
|
- i: {
|
|
|
|
|
- validator: function(chrs, maskset, pos, strict, opts) {
|
|
|
|
|
- return !0;
|
|
|
|
|
- },
|
|
|
|
|
- cardinality: 8,
|
|
|
|
|
- prevalidator: function() {
|
|
|
|
|
- for (var result = [], prefixLimit = 8, i = 0; prefixLimit > i; i++) result[i] = function() {
|
|
|
|
|
- var j = i;
|
|
|
|
|
- return {
|
|
|
|
|
- validator: function(chrs, maskset, pos, strict, opts) {
|
|
|
|
|
- if (opts.regex["urlpre" + (j + 1)]) {
|
|
|
|
|
- var k, tmp = chrs;
|
|
|
|
|
- j + 1 - chrs.length > 0 && (tmp = maskset.buffer.join("").substring(0, j + 1 - chrs.length) + "" + tmp);
|
|
|
|
|
- var isValid = opts.regex["urlpre" + (j + 1)].test(tmp);
|
|
|
|
|
- if (!strict && !isValid) {
|
|
|
|
|
- for (pos -= j, k = 0; k < opts.defaultPrefix.length; k++) maskset.buffer[pos] = opts.defaultPrefix[k],
|
|
|
|
|
- pos++;
|
|
|
|
|
- for (k = 0; k < tmp.length - 1; k++) maskset.buffer[pos] = tmp[k], pos++;
|
|
|
|
|
- return {
|
|
|
|
|
- pos: pos
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- return isValid;
|
|
|
|
|
- }
|
|
|
|
|
- return !1;
|
|
|
|
|
- },
|
|
|
|
|
- cardinality: j
|
|
|
|
|
- };
|
|
|
|
|
- }();
|
|
|
|
|
- return result;
|
|
|
|
|
- }()
|
|
|
|
|
- },
|
|
|
|
|
- r: {
|
|
|
|
|
- validator: ".",
|
|
|
|
|
- cardinality: 50
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ mask: "(\\http://)|(\\http\\s://)|(ftp://)|(ftp\\s://)*{+}",
|
|
|
insertMode: !1,
|
|
insertMode: !1,
|
|
|
autoUnmask: !1
|
|
autoUnmask: !1
|
|
|
},
|
|
},
|