|
@@ -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.1.64-142
|
|
|
|
|
|
|
+* Version: 3.1.64-143
|
|
|
*/
|
|
*/
|
|
|
!function($) {
|
|
!function($) {
|
|
|
function Inputmask(options) {
|
|
function Inputmask(options) {
|
|
@@ -773,7 +773,7 @@
|
|
|
return complete;
|
|
return complete;
|
|
|
}
|
|
}
|
|
|
function isSelection(begin, end) {
|
|
function isSelection(begin, end) {
|
|
|
- return isRTL ? begin - end > 1 || begin - end == 1 && opts.insertMode : end - begin > 1 || end - begin == 1 && opts.insertMode;
|
|
|
|
|
|
|
+ return isRTL ? begin - end > 1 || begin - end === 1 && opts.insertMode : end - begin > 1 || end - begin === 1 && opts.insertMode;
|
|
|
}
|
|
}
|
|
|
function installEventRuler(npt) {
|
|
function installEventRuler(npt) {
|
|
|
var events = $._data(npt).events, inComposition = !1;
|
|
var events = $._data(npt).events, inComposition = !1;
|
|
@@ -782,7 +782,7 @@
|
|
|
if ("inputmask" === eventHandler.namespace) {
|
|
if ("inputmask" === eventHandler.namespace) {
|
|
|
var handler = eventHandler.handler;
|
|
var handler = eventHandler.handler;
|
|
|
eventHandler.handler = function(e) {
|
|
eventHandler.handler = function(e) {
|
|
|
- if (console.log("triggered " + e.type), void 0 === this.inputmask) {
|
|
|
|
|
|
|
+ if (void 0 === this.inputmask) {
|
|
|
var imOpts = $(this).data("_inputmask_opts");
|
|
var imOpts = $(this).data("_inputmask_opts");
|
|
|
imOpts ? new Inputmask(imOpts).mask(this) : $(this).unbind(".inputmask");
|
|
imOpts ? new Inputmask(imOpts).mask(this) : $(this).unbind(".inputmask");
|
|
|
} else {
|
|
} else {
|
|
@@ -849,8 +849,7 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
function getter() {
|
|
function getter() {
|
|
|
- $(this);
|
|
|
|
|
- return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : valueGet.call(this) != getBufferTemplate().join("") ? valueGet.call(this) : "" : valueGet.call(this);
|
|
|
|
|
|
|
+ return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : valueGet.call(this) !== getBufferTemplate().join("") ? valueGet.call(this) : "" : valueGet.call(this);
|
|
|
}
|
|
}
|
|
|
function setter(value) {
|
|
function setter(value) {
|
|
|
valueSet.call(this, value), this.inputmask && $(this).triggerHandler("setvalue.inputmask");
|
|
valueSet.call(this, value), this.inputmask && $(this).triggerHandler("setvalue.inputmask");
|
|
@@ -858,7 +857,7 @@
|
|
|
function installNativeValueSetFallback(npt) {
|
|
function installNativeValueSetFallback(npt) {
|
|
|
$(npt).bind("mouseenter.inputmask", function(event) {
|
|
$(npt).bind("mouseenter.inputmask", function(event) {
|
|
|
var $input = $(this), input = this, value = input.inputmask._valueGet();
|
|
var $input = $(this), input = this, value = input.inputmask._valueGet();
|
|
|
- "" != value && value != getBuffer().join("") && $input.triggerHandler("setvalue.inputmask");
|
|
|
|
|
|
|
+ "" !== value && value !== getBuffer().join("") && $input.triggerHandler("setvalue.inputmask");
|
|
|
});
|
|
});
|
|
|
//!! the bound handlers are executed in the order they where bound
|
|
//!! the bound handlers are executed in the order they where bound
|
|
|
var events = $._data(npt).events, handlers = events.mouseover;
|
|
var events = $._data(npt).events, handlers = events.mouseover;
|
|
@@ -900,7 +899,7 @@
|
|
|
for (lastAlt = getLastValidPosition(); lastAlt >= 0; lastAlt--) {
|
|
for (lastAlt = getLastValidPosition(); lastAlt >= 0; lastAlt--) {
|
|
|
var validPos = getMaskSet().validPositions[lastAlt];
|
|
var validPos = getMaskSet().validPositions[lastAlt];
|
|
|
if (validPos && (null != validPos.match.fn && validInputs.push(validPos.input),
|
|
if (validPos && (null != validPos.match.fn && validInputs.push(validPos.input),
|
|
|
- delete getMaskSet().validPositions[lastAlt], void 0 !== validPos.alternation && validPos.locator[validPos.alternation] == getTestTemplate(lastAlt).locator[validPos.alternation])) break;
|
|
|
|
|
|
|
+ delete getMaskSet().validPositions[lastAlt], void 0 !== validPos.alternation && validPos.locator[validPos.alternation] === getTestTemplate(lastAlt).locator[validPos.alternation])) break;
|
|
|
}
|
|
}
|
|
|
if (lastAlt > -1) for (;validInputs.length > 0; ) {
|
|
if (lastAlt > -1) for (;validInputs.length > 0; ) {
|
|
|
getMaskSet().p = seekNext(getLastValidPosition());
|
|
getMaskSet().p = seekNext(getLastValidPosition());
|
|
@@ -909,13 +908,13 @@
|
|
|
} else getMaskSet().validPositions = $.extend(!0, {}, positionsClone);
|
|
} else getMaskSet().validPositions = $.extend(!0, {}, positionsClone);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if ((opts.numericInput || isRTL) && (k == Inputmask.keyCode.BACKSPACE ? k = Inputmask.keyCode.DELETE : k == Inputmask.keyCode.DELETE && (k = Inputmask.keyCode.BACKSPACE),
|
|
|
|
|
|
|
+ if ((opts.numericInput || isRTL) && (k === Inputmask.keyCode.BACKSPACE ? k = Inputmask.keyCode.DELETE : k === Inputmask.keyCode.DELETE && (k = Inputmask.keyCode.BACKSPACE),
|
|
|
isRTL)) {
|
|
isRTL)) {
|
|
|
var pend = pos.end;
|
|
var pend = pos.end;
|
|
|
pos.end = pos.begin, pos.begin = pend;
|
|
pos.end = pos.begin, pos.begin = pend;
|
|
|
}
|
|
}
|
|
|
- k == Inputmask.keyCode.BACKSPACE && (pos.end - pos.begin < 1 || 0 == opts.insertMode) ? (pos.begin = seekPrevious(pos.begin),
|
|
|
|
|
- void 0 == getMaskSet().validPositions[pos.begin] || getMaskSet().validPositions[pos.begin].input != opts.groupSeparator && getMaskSet().validPositions[pos.begin].input != opts.radixPoint || pos.begin--) : k == Inputmask.keyCode.DELETE && pos.begin == pos.end && (pos.end = isMask(pos.end) ? pos.end + 1 : seekNext(pos.end) + 1,
|
|
|
|
|
|
|
+ k === Inputmask.keyCode.BACKSPACE && (pos.end - pos.begin < 1 || opts.insertMode === !1) ? (pos.begin = seekPrevious(pos.begin),
|
|
|
|
|
+ void 0 === getMaskSet().validPositions[pos.begin] || getMaskSet().validPositions[pos.begin].input !== opts.groupSeparator && getMaskSet().validPositions[pos.begin].input !== opts.radixPoint || pos.begin--) : k == Inputmask.keyCode.DELETE && pos.begin == pos.end && (pos.end = isMask(pos.end) ? pos.end + 1 : seekNext(pos.end) + 1,
|
|
|
void 0 == getMaskSet().validPositions[pos.begin] || getMaskSet().validPositions[pos.begin].input != opts.groupSeparator && getMaskSet().validPositions[pos.begin].input != opts.radixPoint || pos.end++),
|
|
void 0 == getMaskSet().validPositions[pos.begin] || getMaskSet().validPositions[pos.begin].input != opts.groupSeparator && getMaskSet().validPositions[pos.begin].input != opts.radixPoint || pos.end++),
|
|
|
stripValidPositions(pos.begin, pos.end, !1, strict), strict !== !0 && generalize();
|
|
stripValidPositions(pos.begin, pos.end, !1, strict), strict !== !0 && generalize();
|
|
|
var lvp = getLastValidPosition(pos.begin);
|
|
var lvp = getLastValidPosition(pos.begin);
|
|
@@ -1029,10 +1028,10 @@
|
|
|
}
|
|
}
|
|
|
function compositionEndEvent(e) {}
|
|
function compositionEndEvent(e) {}
|
|
|
function mask(el) {
|
|
function mask(el) {
|
|
|
- $el = $(el), opts.showTooltip && $el.prop("title", getMaskSet().mask), ("rtl" == el.dir || opts.rightAlign) && $el.css("text-align", "right"),
|
|
|
|
|
- ("rtl" == el.dir || opts.numericInput) && (el.dir = "ltr", $el.removeAttr("dir"),
|
|
|
|
|
- el.inputmask.isRTL = !0, isRTL = !0), $el.unbind(".inputmask"), ($el.is(":input") && isInputTypeSupported($el.attr("type")) || el.isContentEditable) && ($el.closest("form").bind("submit", function(e) {
|
|
|
|
|
- undoValue != getBuffer().join("") && $el.change(), opts.clearMaskOnLostFocus && $el[0].inputmask._valueGet && $el[0].inputmask._valueGet() == getBufferTemplate().join("") && $el[0].inputmask._valueSet(""),
|
|
|
|
|
|
|
+ $el = $(el), opts.showTooltip && $el.prop("title", getMaskSet().mask), ("rtl" === el.dir || opts.rightAlign) && $el.css("text-align", "right"),
|
|
|
|
|
+ ("rtl" === el.dir || opts.numericInput) && (el.dir = "ltr", $el.removeAttr("dir"),
|
|
|
|
|
+ el.inputmask.isRTL = !0, isRTL = !0), $el.unbind(".inputmask"), ($el.is(":input") && isInputTypeSupported($el.attr("type")) || el.isContentEditable) && ($el.closest("form").bind("submit", function() {
|
|
|
|
|
+ undoValue !== getBuffer().join("") && $el.change(), opts.clearMaskOnLostFocus && $el[0].inputmask._valueGet && $el[0].inputmask._valueGet() === getBufferTemplate().join("") && $el[0].inputmask._valueSet(""),
|
|
|
opts.removeMaskOnSubmit && $el.inputmask("remove");
|
|
opts.removeMaskOnSubmit && $el.inputmask("remove");
|
|
|
}).bind("reset", function() {
|
|
}).bind("reset", function() {
|
|
|
setTimeout(function() {
|
|
setTimeout(function() {
|
|
@@ -1040,14 +1039,14 @@
|
|
|
}, 0);
|
|
}, 0);
|
|
|
}), $el.bind("mouseenter.inputmask", function() {
|
|
}), $el.bind("mouseenter.inputmask", function() {
|
|
|
var $input = $(this), input = this;
|
|
var $input = $(this), input = this;
|
|
|
- mouseEnter = !0, !$input.is(":focus") && opts.showMaskOnHover && input.inputmask._valueGet() != getBuffer().join("") && writeBuffer(input, getBuffer());
|
|
|
|
|
|
|
+ mouseEnter = !0, !$input.is(":focus") && opts.showMaskOnHover && input.inputmask._valueGet() !== getBuffer().join("") && writeBuffer(input, getBuffer());
|
|
|
}).bind("blur.inputmask", function(e) {
|
|
}).bind("blur.inputmask", function(e) {
|
|
|
var $input = $(this), input = this;
|
|
var $input = $(this), input = this;
|
|
|
if (input.inputmask) {
|
|
if (input.inputmask) {
|
|
|
var nptValue = input.inputmask._valueGet(), buffer = getBuffer().slice();
|
|
var nptValue = input.inputmask._valueGet(), buffer = getBuffer().slice();
|
|
|
- firstClick = !0, undoValue != buffer.join("") && setTimeout(function() {
|
|
|
|
|
|
|
+ firstClick = !0, undoValue !== buffer.join("") && setTimeout(function() {
|
|
|
$input.change(), undoValue = buffer.join("");
|
|
$input.change(), undoValue = buffer.join("");
|
|
|
- }, 0), "" != nptValue && (opts.clearMaskOnLostFocus && (nptValue == getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer)),
|
|
|
|
|
|
|
+ }, 0), "" !== nptValue && (opts.clearMaskOnLostFocus && (nptValue == getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer)),
|
|
|
isComplete(buffer) === !1 && (setTimeout(function() {
|
|
isComplete(buffer) === !1 && (setTimeout(function() {
|
|
|
$input.trigger("incomplete");
|
|
$input.trigger("incomplete");
|
|
|
}, 0), opts.clearIncomplete && (resetMaskSet(), buffer = opts.clearMaskOnLostFocus ? [] : getBufferTemplate().slice())),
|
|
}, 0), opts.clearIncomplete && (resetMaskSet(), buffer = opts.clearMaskOnLostFocus ? [] : getBufferTemplate().slice())),
|
|
@@ -1367,7 +1366,7 @@
|
|
|
return window.Inputmask = Inputmask, Inputmask;
|
|
return window.Inputmask = Inputmask, Inputmask;
|
|
|
}(jQuery), function($) {
|
|
}(jQuery), function($) {
|
|
|
return void 0 === $.fn.inputmask && ($.fn.inputmask = function(fn, options) {
|
|
return void 0 === $.fn.inputmask && ($.fn.inputmask = function(fn, options) {
|
|
|
- var nptmask;
|
|
|
|
|
|
|
+ var nptmask, input;
|
|
|
if (options = options || {}, "string" == typeof fn) switch (fn) {
|
|
if (options = options || {}, "string" == typeof fn) switch (fn) {
|
|
|
case "mask":
|
|
case "mask":
|
|
|
return nptmask = new Inputmask(options), this.each(function() {
|
|
return nptmask = new Inputmask(options), this.each(function() {
|
|
@@ -1375,8 +1374,7 @@
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
case "unmaskedvalue":
|
|
case "unmaskedvalue":
|
|
|
- var input = this.jquery && this.length > 0 ? this[0] : this;
|
|
|
|
|
- return input.inputmask ? input.inputmask.unmaskedvalue() : $(input).val();
|
|
|
|
|
|
|
+ return input = this.jquery && this.length > 0 ? this[0] : this, input.inputmask ? input.inputmask.unmaskedvalue() : $(input).val();
|
|
|
|
|
|
|
|
case "remove":
|
|
case "remove":
|
|
|
return this.each(function() {
|
|
return this.each(function() {
|
|
@@ -1384,20 +1382,21 @@
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
case "getemptymask":
|
|
case "getemptymask":
|
|
|
- var input = this.jquery && this.length > 0 ? this[0] : this;
|
|
|
|
|
- return input.inputmask ? input.inputmask.getemptymask() : "";
|
|
|
|
|
|
|
+ return input = this.jquery && this.length > 0 ? this[0] : this, input.inputmask ? input.inputmask.getemptymask() : "";
|
|
|
|
|
|
|
|
case "hasMaskedValue":
|
|
case "hasMaskedValue":
|
|
|
- var input = this.jquery && this.length > 0 ? this[0] : this;
|
|
|
|
|
- return input.inputmask ? input.inputmask.hasMaskedValue() : !1;
|
|
|
|
|
|
|
+ return input = this.jquery && this.length > 0 ? this[0] : this, input.inputmask ? input.inputmask.hasMaskedValue() : !1;
|
|
|
|
|
|
|
|
case "isComplete":
|
|
case "isComplete":
|
|
|
- var input = this.jquery && this.length > 0 ? this[0] : this;
|
|
|
|
|
- return input.inputmask ? input.inputmask.isComplete() : !0;
|
|
|
|
|
|
|
+ return input = this.jquery && this.length > 0 ? this[0] : this, input.inputmask ? input.inputmask.isComplete() : !0;
|
|
|
|
|
|
|
|
case "getmetadata":
|
|
case "getmetadata":
|
|
|
- var input = this.jquery && this.length > 0 ? this[0] : this;
|
|
|
|
|
- return input.inputmask ? input.inputmask.getmetadata() : void 0;
|
|
|
|
|
|
|
+ return input = this.jquery && this.length > 0 ? this[0] : this, input.inputmask ? input.inputmask.getmetadata() : void 0;
|
|
|
|
|
+
|
|
|
|
|
+ case "setvalue":
|
|
|
|
|
+ input = this.jquery && this.length > 0 ? this[0] : this, $(input).val(options),
|
|
|
|
|
+ void 0 === input.Inputmask && $(input).triggerHandler("setvalue.inputmask");
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
default:
|
|
default:
|
|
|
return options.alias = fn, nptmask = new Inputmask(options), this.each(function() {
|
|
return options.alias = fn, nptmask = new Inputmask(options), this.each(function() {
|
|
@@ -1407,7 +1406,7 @@
|
|
|
if ("object" == typeof fn) return nptmask = new Inputmask(fn), this.each(function() {
|
|
if ("object" == typeof fn) return nptmask = new Inputmask(fn), this.each(function() {
|
|
|
nptmask.mask(this);
|
|
nptmask.mask(this);
|
|
|
});
|
|
});
|
|
|
- if (void 0 == fn) return this.each(function() {
|
|
|
|
|
|
|
+ if (void 0 === fn) return this.each(function() {
|
|
|
nptmask = new Inputmask(options), nptmask.mask(this);
|
|
nptmask = new Inputmask(options), nptmask.mask(this);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|