ソースを参照

fix regression in currency alias

Robin Herbots 10 年 前
コミット
5401818bf8

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.1.64-155",
+  "version": "3.1.64-156",
   "main": [
     "./dist/inputmask/jquery.inputmask.js",
     "./dist/inputmask/inputmask.js",

+ 1 - 1
component.json

@@ -2,7 +2,7 @@
     "name": "jquery_inputmask",
     "repository": "robinherbots/jquery.inputmask",
     "description": "jquery.inputmask is a jquery plugin which create an input mask.",
-    "version": "3.1.64-155",
+    "version": "3.1.64-156",
     "keywords": [ "jquery", "plugins", "input", "form", "inputmask", "mask" ],
     "main": "./dist/jquery.inputmask.bundle.js",
     "scripts": [

+ 1 - 1
composer.json

@@ -1,7 +1,7 @@
 {
     "name": "robinherbots/jquery.inputmask",
     "description": "jquery.inputmask is a jquery plugin which create an input mask.",
-	"version": "3.1.64-155",
+	"version": "3.1.64-156",
     "type": "library",
     "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
     "homepage": "http://robinherbots.github.io/jquery.inputmask",

+ 1 - 1
dist/inputmask/inputmask.date.extensions.js

@@ -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.64-155
+* Version: 3.1.64-156
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/inputmask/inputmask.date.extensions.min.js


+ 1 - 1
dist/inputmask/inputmask.extensions.js

@@ -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.64-155
+* Version: 3.1.64-156
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/inputmask/inputmask.extensions.min.js


+ 23 - 29
dist/inputmask/inputmask.js

@@ -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.64-155
+* Version: 3.1.64-156
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery")) : factory(jQuery);
@@ -294,8 +294,7 @@
         }
         function stripValidPositions(start, end, nocheck, strict) {
             var i, startPos = start;
-            getMaskSet().p = start;
-            for (i = startPos; end > i; i++) void 0 !== getMaskSet().validPositions[i] && (nocheck === !0 || opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts) !== !1) && delete getMaskSet().validPositions[i];
+            for (getMaskSet().p = start, i = startPos; end > i; i++) void 0 !== getMaskSet().validPositions[i] && (nocheck === !0 || opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts) !== !1) && delete getMaskSet().validPositions[i];
             for (resetMaskSet(!0), i = startPos + 1; i <= getLastValidPosition(); ) {
                 for (;void 0 !== getMaskSet().validPositions[startPos]; ) startPos++;
                 var s = getMaskSet().validPositions[startPos];
@@ -467,7 +466,7 @@
             function _isValid(position, c, strict, fromSetValid) {
                 var rslt = !1;
                 return $.each(getTests(position), function(ndx, tst) {
-                    for (var test = tst.match, loopend = c ? 1 : 0, chrs = "", i = (getBuffer(), test.cardinality); i > loopend; i--) chrs += getBufferElement(position - (i - 1));
+                    for (var test = tst.match, loopend = c ? 1 : 0, chrs = "", i = test.cardinality; i > loopend; i--) chrs += getBufferElement(position - (i - 1));
                     if (c && (chrs += c), rslt = null != test.fn ? test.fn.test(chrs, getMaskSet(), position, strict, opts) : c !== test.def && c !== opts.skipOptionalPartCharacter || "" === test.def ? !1 : {
                         c: test.def,
                         pos: position
@@ -558,7 +557,7 @@
             for (var buffer = getBuffer(), pndx = pos - 1; pndx > -1 && !getMaskSet().validPositions[pndx]; pndx--) ;
             for (pndx++; pos > pndx; pndx++) void 0 === getMaskSet().validPositions[pndx] && ((!isMask(pndx) || buffer[pndx] !== getPlaceholder(pndx)) && getTests(pndx).length > 1 || buffer[pndx] === opts.radixPoint || "0" === buffer[pndx] && $.inArray(opts.radixPoint, buffer) < pndx) && _isValid(pndx, buffer[pndx], !0);
             var maskPos = pos, result = !1, positionsClone = $.extend(!0, {}, getMaskSet().validPositions);
-            if (maskPos < getMaskLength() && (result = _isValid(maskPos, c, strict, fromSetValid), 
+            if (maskPos < getMaskLength() && (getBuffer(), result = _isValid(maskPos, c, strict, fromSetValid), 
             (!strict || fromSetValid) && result === !1)) {
                 var currentPosValid = getMaskSet().validPositions[maskPos];
                 if (!currentPosValid || null !== currentPosValid.match.fn || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) {
@@ -825,7 +824,6 @@
                     };
                     $.valHooks[type] = {
                         get: function(elem) {
-                            $(elem);
                             if (elem.inputmask) {
                                 if (elem.inputmask.opts.autoUnmask) return elem.inputmask.unmaskedvalue();
                                 var result = valhookGet(elem), maskset = elem.inputmask.maskset, bufferTemplate = maskset._buffer;
@@ -861,29 +859,25 @@
                 }
             }
             var valueGet, valueSet;
-            if (!npt.inputmask.__valueGet) {
-                var valueProperty;
-                Object.getOwnPropertyDescriptor && void 0 === npt.value ? (valueGet = function() {
-                    return this.textContent;
-                }, valueSet = function(value) {
-                    this.textContent = value;
-                }, Object.defineProperty(npt, "value", {
-                    get: getter,
-                    set: setter
-                })) : ((valueProperty = Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(npt, "value")) && valueProperty.configurable, 
-                document.__lookupGetter__ && npt.__lookupGetter__("value") ? (valueGet = npt.__lookupGetter__("value"), 
-                valueSet = npt.__lookupSetter__("value"), npt.__defineGetter__("value", getter), 
-                npt.__defineSetter__("value", setter)) : (valueGet = function() {
-                    return npt.value;
-                }, valueSet = function(value) {
-                    npt.value = value;
-                }, patchValhook(npt.type), installNativeValueSetFallback(npt))), npt.inputmask.__valueGet = valueGet, 
-                npt.inputmask._valueGet = function(overruleRTL) {
-                    return isRTL && overruleRTL !== !0 ? valueGet.call(this.el).split("").reverse().join("") : valueGet.call(this.el);
-                }, npt.inputmask.__valueSet = valueSet, npt.inputmask._valueSet = function(value) {
-                    valueSet.call(this.el, isRTL ? value.split("").reverse().join("") : value);
-                };
-            }
+            npt.inputmask.__valueGet || (Object.getOwnPropertyDescriptor && void 0 === npt.value ? (valueGet = function() {
+                return this.textContent;
+            }, valueSet = function(value) {
+                this.textContent = value;
+            }, Object.defineProperty(npt, "value", {
+                get: getter,
+                set: setter
+            })) : document.__lookupGetter__ && npt.__lookupGetter__("value") ? (valueGet = npt.__lookupGetter__("value"), 
+            valueSet = npt.__lookupSetter__("value"), npt.__defineGetter__("value", getter), 
+            npt.__defineSetter__("value", setter)) : (valueGet = function() {
+                return npt.value;
+            }, valueSet = function(value) {
+                npt.value = value;
+            }, patchValhook(npt.type), installNativeValueSetFallback(npt)), npt.inputmask.__valueGet = valueGet, 
+            npt.inputmask._valueGet = function(overruleRTL) {
+                return isRTL && overruleRTL !== !0 ? valueGet.call(this.el).split("").reverse().join("") : valueGet.call(this.el);
+            }, npt.inputmask.__valueSet = valueSet, npt.inputmask._valueSet = function(value) {
+                valueSet.call(this.el, isRTL ? value.split("").reverse().join("") : value);
+            });
         }
         function handleRemove(input, k, pos, strict) {
             function generalize() {

ファイルの差分が大きいため隠しています
+ 3 - 3
dist/inputmask/inputmask.min.js


+ 29 - 26
dist/inputmask/inputmask.numeric.extensions.js

@@ -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.64-155
+* Version: 3.1.64-156
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);
@@ -61,7 +61,7 @@
             unmaskAsNumber: !1,
             postFormat: function(buffer, pos, reformatOnly, opts) {
                 opts.numericInput === !0 && (buffer = buffer.reverse(), isFinite(pos) && (pos = buffer.join("").length - pos - 1));
-                var suffixStripped = !1;
+                var i, suffixStripped = !1;
                 buffer.length >= opts.suffix.length && buffer.join("").indexOf(opts.suffix) === buffer.length - opts.suffix.length && (buffer.length = buffer.length - opts.suffix.length, 
                 suffixStripped = !0), pos = pos >= buffer.length ? buffer.length - 1 : pos < opts.prefix.length ? opts.prefix.length : pos;
                 var needsRefresh = !1, charAtPos = buffer[pos];
@@ -83,11 +83,12 @@
                     bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator);
                     "" !== opts.radixPoint && radixSplit.length > 1 && (bufVal += opts.radixPoint + radixSplit[1]);
                 }
-                needsRefresh = bufValOrigin !== bufVal, buffer.length = bufVal.length;
-                for (var i = 0, l = bufVal.length; l > i; i++) buffer[i] = bufVal.charAt(i);
+                for (needsRefresh = bufValOrigin !== bufVal, buffer.length = bufVal.length, i = 0, 
+                l = bufVal.length; l > i; i++) buffer[i] = bufVal.charAt(i);
                 var newPos = $.inArray("?", buffer);
                 if (-1 === newPos && charAtPos === opts.radixPoint && (newPos = $.inArray(opts.radixPoint, buffer)), 
-                reformatOnly ? buffer[newPos] = charAtPos : buffer.splice(newPos, 1), !needsRefresh && suffixStripped) for (var i = 0, l = opts.suffix.length; l > i; i++) buffer.push(opts.suffix.charAt(i));
+                reformatOnly ? buffer[newPos] = charAtPos : buffer.splice(newPos, 1), !needsRefresh && suffixStripped) for (i = 0, 
+                l = opts.suffix.length; l > i; i++) buffer.push(opts.suffix.charAt(i));
                 return {
                     pos: opts.numericInput && isFinite(pos) ? buffer.join("").length - newPos - 1 : newPos,
                     refreshFromBuffer: needsRefresh,
@@ -95,7 +96,7 @@
                 };
             },
             onBeforeWrite: function(e, buffer, caretPos, opts) {
-                if (e && "blur" == e.type) {
+                if (e && "blur" === e.type) {
                     var maskedValue = buffer.join(""), processValue = maskedValue.replace(opts.prefix, "");
                     if (processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""), 
                     "," === opts.radixPoint && (processValue = processValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".")), 
@@ -104,18 +105,18 @@
                         buffer: (opts.prefix + opts.min).split("")
                     }, opts.postFormat((opts.prefix + opts.min).split(""), 0, !0, opts));
                     if (opts.numericInput !== !0) {
-                        var tmpBufSplit = "" != opts.radixPoint ? buffer.join("").split(opts.radixPoint) : [ buffer.join("") ], matchRslt = tmpBufSplit[0].match(opts.regex.integerPart(opts)), matchRsltDigits = 2 == tmpBufSplit.length ? tmpBufSplit[1].match(opts.regex.integerNPart(opts)) : void 0;
-                        !matchRslt || matchRslt[0] != opts.negationSymbol.front + "0" && matchRslt[0] != opts.negationSymbol.front && "+" != matchRslt[0] || void 0 != matchRsltDigits && !matchRsltDigits[0].match(/^0+$/) || buffer.splice(matchRslt.index, 1);
+                        var tmpBufSplit = "" !== opts.radixPoint ? buffer.join("").split(opts.radixPoint) : [ buffer.join("") ], matchRslt = tmpBufSplit[0].match(opts.regex.integerPart(opts)), matchRsltDigits = 2 === tmpBufSplit.length ? tmpBufSplit[1].match(opts.regex.integerNPart(opts)) : void 0;
+                        !matchRslt || matchRslt[0] !== opts.negationSymbol.front + "0" && matchRslt[0] !== opts.negationSymbol.front && "+" !== matchRslt[0] || void 0 !== matchRsltDigits && !matchRsltDigits[0].match(/^0+$/) || buffer.splice(matchRslt.index, 1);
                         var radixPosition = $.inArray(opts.radixPoint, buffer);
-                        if (-1 != radixPosition) {
+                        if (-1 !== radixPosition) {
                             if (isFinite(opts.digits) && !opts.digitsOptional) {
-                                for (var i = 1; i <= opts.digits; i++) (void 0 == buffer[radixPosition + i] || buffer[radixPosition + i] == opts.placeholder.charAt(0)) && (buffer[radixPosition + i] = "0");
+                                for (var i = 1; i <= opts.digits; i++) (void 0 === buffer[radixPosition + i] || buffer[radixPosition + i] === opts.placeholder.charAt(0)) && (buffer[radixPosition + i] = "0");
                                 return {
                                     refreshFromBuffer: !0,
                                     buffer: buffer
                                 };
                             }
-                            if (radixPosition == buffer.length - opts.suffix.length - 1) return buffer.splice(radixPosition, 1), 
+                            if (radixPosition === buffer.length - opts.suffix.length - 1) return buffer.splice(radixPosition, 1), 
                             {
                                 refreshFromBuffer: !0,
                                 buffer: buffer
@@ -139,7 +140,7 @@
             signHandler: function(chrs, maskset, pos, strict, opts) {
                 if (!strict && opts.allowMinus && "-" === chrs || opts.allowPlus && "+" === chrs) {
                     var matchRslt = maskset.buffer.join("").match(opts.regex.integerPart(opts));
-                    if (matchRslt && matchRslt[0].length > 0) return maskset.buffer[matchRslt.index] == ("-" === chrs ? "+" : opts.negationSymbol.front) ? "-" == chrs ? "" != opts.negationSymbol.back ? {
+                    if (matchRslt && matchRslt[0].length > 0) return maskset.buffer[matchRslt.index] === ("-" === chrs ? "+" : opts.negationSymbol.front) ? "-" === chrs ? "" !== opts.negationSymbol.back ? {
                         pos: matchRslt.index,
                         c: opts.negationSymbol.front,
                         remove: matchRslt.index,
@@ -153,7 +154,7 @@
                         c: opts.negationSymbol.front,
                         remove: matchRslt.index,
                         caret: pos
-                    } : "" != opts.negationSymbol.back ? {
+                    } : "" !== opts.negationSymbol.back ? {
                         pos: matchRslt.index,
                         c: "+",
                         remove: [ matchRslt.index, maskset.buffer.length - opts.suffix.length - 1 ],
@@ -163,13 +164,13 @@
                         c: "+",
                         remove: matchRslt.index,
                         caret: pos
-                    } : maskset.buffer[matchRslt.index] == ("-" === chrs ? opts.negationSymbol.front : "+") ? "-" == chrs && "" != opts.negationSymbol.back ? {
+                    } : maskset.buffer[matchRslt.index] === ("-" === chrs ? opts.negationSymbol.front : "+") ? "-" === chrs && "" !== opts.negationSymbol.back ? {
                         remove: [ matchRslt.index, maskset.buffer.length - opts.suffix.length - 1 ],
                         caret: pos - 1
                     } : {
                         remove: matchRslt.index,
                         caret: pos - 1
-                    } : "-" == chrs ? "" != opts.negationSymbol.back ? {
+                    } : "-" === chrs ? "" !== opts.negationSymbol.back ? {
                         pos: matchRslt.index,
                         c: opts.negationSymbol.front,
                         caret: pos + 1,
@@ -354,23 +355,25 @@
                 return initialValue.toString();
             },
             canClearPosition: function(maskset, position, lvp, strict, opts) {
-                var positionInput = maskset.validPositions[position].input, canClear = positionInput != opts.radixPoint || null != maskset.validPositions[position].match.fn && 0 == opts.decimalProtect || isFinite(positionInput) || position === lvp || positionInput === opts.groupSeparator || positionInput === opts.negationSymbol.front || positionInput === opts.negationSymbol.back;
+                var positionInput = maskset.validPositions[position].input, canClear = positionInput !== opts.radixPoint || null !== maskset.validPositions[position].match.fn && opts.decimalProtect === !1 || isFinite(positionInput) || position === lvp || positionInput === opts.groupSeparator || positionInput === opts.negationSymbol.front || positionInput === opts.negationSymbol.back;
                 if (canClear && isFinite(positionInput)) {
-                    var matchRslt;
-                    if (!strict && maskset.buffer) {
+                    var matchRslt, radixPos = $.inArray(opts.radixPoint, maskset.buffer), radixInjection = !1;
+                    if (void 0 === maskset.validPositions[radixPos] && (maskset.validPositions[radixPos] = {
+                        input: opts.radixPoint
+                    }, radixInjection = !0), !strict && maskset.buffer) {
                         matchRslt = maskset.buffer.join("").substr(0, position).match(opts.regex.integerNPart(opts));
-                        var pos = position + 1, isNull = null == matchRslt || 0 == parseInt(matchRslt[0].replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""));
-                        if (isNull) for (;maskset.validPositions[pos] && (maskset.validPositions[pos].input == opts.groupSeparator || "0" == maskset.validPositions[pos].input); ) delete maskset.validPositions[pos], 
+                        var pos = position + 1, isNull = null == matchRslt || 0 === parseInt(matchRslt[0].replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""));
+                        if (isNull) for (;maskset.validPositions[pos] && (maskset.validPositions[pos].input === opts.groupSeparator || "0" === maskset.validPositions[pos].input); ) delete maskset.validPositions[pos], 
                         pos++;
                     }
                     var buffer = [];
                     for (var vp in maskset.validPositions) buffer.push(maskset.validPositions[vp].input);
-                    1 == opts.numericInput && (position = buffer.join("").length - position, buffer.reverse()), 
-                    matchRslt = buffer.join("").match(opts.regex.integerNPart(opts));
+                    radixInjection && delete maskset.validPositions[radixPos], opts.numericInput === !0 && (position = buffer.join("").length - position, 
+                    buffer.reverse()), matchRslt = buffer.join("").match(opts.regex.integerNPart(opts));
                     var radixPosition = $.inArray(opts.radixPoint, maskset.buffer);
-                    if (matchRslt && (-1 == radixPosition || radixPosition >= position)) if (0 == matchRslt[0].indexOf("0")) canClear = matchRslt.index != position || -1 == radixPosition; else {
+                    if (matchRslt && (-1 === radixPosition || radixPosition >= position || opts.numericInput)) if (0 === matchRslt[0].indexOf("0")) canClear = matchRslt.index !== position || -1 === radixPosition; else {
                         var intPart = parseInt(matchRslt[0].replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""));
-                        -1 != radixPosition && 10 > intPart && maskset.validPositions[position] && (maskset.validPositions[position].input = "0", 
+                        -1 !== radixPosition && 10 > intPart && maskset.validPositions[position] && (maskset.validPositions[position].input = "0", 
                         maskset.p = opts.prefix.length + 1, canClear = !1);
                     }
                 }
@@ -379,11 +382,11 @@
             onKeyDown: function(e, buffer, caretPos, opts) {
                 var $input = $(this);
                 if (e.ctrlKey) switch (e.keyCode) {
-                  case inputmask.keyCode.UP:
+                  case Inputmask.keyCode.UP:
                     $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step)), $input.triggerHandler("setvalue.inputmask");
                     break;
 
-                  case inputmask.keyCode.DOWN:
+                  case Inputmask.keyCode.DOWN:
                     $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step)), $input.triggerHandler("setvalue.inputmask");
                 }
             }

ファイルの差分が大きいため隠しています
+ 2 - 2
dist/inputmask/inputmask.numeric.extensions.min.js


+ 1 - 1
dist/inputmask/inputmask.phone.extensions.js

@@ -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.64-155
+* Version: 3.1.64-156
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/inputmask/inputmask.phone.extensions.min.js


+ 1 - 1
dist/inputmask/inputmask.regex.extensions.js

@@ -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.64-155
+* Version: 3.1.64-156
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/inputmask/inputmask.regex.extensions.min.js


+ 1 - 1
dist/inputmask/jquery.inputmask.js

@@ -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.64-155
+* Version: 3.1.64-156
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/inputmask/jquery.inputmask.min.js


+ 51 - 54
dist/jquery.inputmask.bundle.js

@@ -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.64-155
+* Version: 3.1.64-156
 */
 !function($) {
     function Inputmask(options) {
@@ -292,8 +292,7 @@
         }
         function stripValidPositions(start, end, nocheck, strict) {
             var i, startPos = start;
-            getMaskSet().p = start;
-            for (i = startPos; end > i; i++) void 0 !== getMaskSet().validPositions[i] && (nocheck === !0 || opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts) !== !1) && delete getMaskSet().validPositions[i];
+            for (getMaskSet().p = start, i = startPos; end > i; i++) void 0 !== getMaskSet().validPositions[i] && (nocheck === !0 || opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts) !== !1) && delete getMaskSet().validPositions[i];
             for (resetMaskSet(!0), i = startPos + 1; i <= getLastValidPosition(); ) {
                 for (;void 0 !== getMaskSet().validPositions[startPos]; ) startPos++;
                 var s = getMaskSet().validPositions[startPos];
@@ -465,7 +464,7 @@
             function _isValid(position, c, strict, fromSetValid) {
                 var rslt = !1;
                 return $.each(getTests(position), function(ndx, tst) {
-                    for (var test = tst.match, loopend = c ? 1 : 0, chrs = "", i = (getBuffer(), test.cardinality); i > loopend; i--) chrs += getBufferElement(position - (i - 1));
+                    for (var test = tst.match, loopend = c ? 1 : 0, chrs = "", i = test.cardinality; i > loopend; i--) chrs += getBufferElement(position - (i - 1));
                     if (c && (chrs += c), rslt = null != test.fn ? test.fn.test(chrs, getMaskSet(), position, strict, opts) : c !== test.def && c !== opts.skipOptionalPartCharacter || "" === test.def ? !1 : {
                         c: test.def,
                         pos: position
@@ -556,7 +555,7 @@
             for (var buffer = getBuffer(), pndx = pos - 1; pndx > -1 && !getMaskSet().validPositions[pndx]; pndx--) ;
             for (pndx++; pos > pndx; pndx++) void 0 === getMaskSet().validPositions[pndx] && ((!isMask(pndx) || buffer[pndx] !== getPlaceholder(pndx)) && getTests(pndx).length > 1 || buffer[pndx] === opts.radixPoint || "0" === buffer[pndx] && $.inArray(opts.radixPoint, buffer) < pndx) && _isValid(pndx, buffer[pndx], !0);
             var maskPos = pos, result = !1, positionsClone = $.extend(!0, {}, getMaskSet().validPositions);
-            if (maskPos < getMaskLength() && (result = _isValid(maskPos, c, strict, fromSetValid), 
+            if (maskPos < getMaskLength() && (getBuffer(), result = _isValid(maskPos, c, strict, fromSetValid), 
             (!strict || fromSetValid) && result === !1)) {
                 var currentPosValid = getMaskSet().validPositions[maskPos];
                 if (!currentPosValid || null !== currentPosValid.match.fn || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) {
@@ -823,7 +822,6 @@
                     };
                     $.valHooks[type] = {
                         get: function(elem) {
-                            $(elem);
                             if (elem.inputmask) {
                                 if (elem.inputmask.opts.autoUnmask) return elem.inputmask.unmaskedvalue();
                                 var result = valhookGet(elem), maskset = elem.inputmask.maskset, bufferTemplate = maskset._buffer;
@@ -859,29 +857,25 @@
                 }
             }
             var valueGet, valueSet;
-            if (!npt.inputmask.__valueGet) {
-                var valueProperty;
-                Object.getOwnPropertyDescriptor && void 0 === npt.value ? (valueGet = function() {
-                    return this.textContent;
-                }, valueSet = function(value) {
-                    this.textContent = value;
-                }, Object.defineProperty(npt, "value", {
-                    get: getter,
-                    set: setter
-                })) : ((valueProperty = Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(npt, "value")) && valueProperty.configurable, 
-                document.__lookupGetter__ && npt.__lookupGetter__("value") ? (valueGet = npt.__lookupGetter__("value"), 
-                valueSet = npt.__lookupSetter__("value"), npt.__defineGetter__("value", getter), 
-                npt.__defineSetter__("value", setter)) : (valueGet = function() {
-                    return npt.value;
-                }, valueSet = function(value) {
-                    npt.value = value;
-                }, patchValhook(npt.type), installNativeValueSetFallback(npt))), npt.inputmask.__valueGet = valueGet, 
-                npt.inputmask._valueGet = function(overruleRTL) {
-                    return isRTL && overruleRTL !== !0 ? valueGet.call(this.el).split("").reverse().join("") : valueGet.call(this.el);
-                }, npt.inputmask.__valueSet = valueSet, npt.inputmask._valueSet = function(value) {
-                    valueSet.call(this.el, isRTL ? value.split("").reverse().join("") : value);
-                };
-            }
+            npt.inputmask.__valueGet || (Object.getOwnPropertyDescriptor && void 0 === npt.value ? (valueGet = function() {
+                return this.textContent;
+            }, valueSet = function(value) {
+                this.textContent = value;
+            }, Object.defineProperty(npt, "value", {
+                get: getter,
+                set: setter
+            })) : document.__lookupGetter__ && npt.__lookupGetter__("value") ? (valueGet = npt.__lookupGetter__("value"), 
+            valueSet = npt.__lookupSetter__("value"), npt.__defineGetter__("value", getter), 
+            npt.__defineSetter__("value", setter)) : (valueGet = function() {
+                return npt.value;
+            }, valueSet = function(value) {
+                npt.value = value;
+            }, patchValhook(npt.type), installNativeValueSetFallback(npt)), npt.inputmask.__valueGet = valueGet, 
+            npt.inputmask._valueGet = function(overruleRTL) {
+                return isRTL && overruleRTL !== !0 ? valueGet.call(this.el).split("").reverse().join("") : valueGet.call(this.el);
+            }, npt.inputmask.__valueSet = valueSet, npt.inputmask._valueSet = function(value) {
+                valueSet.call(this.el, isRTL ? value.split("").reverse().join("") : value);
+            });
         }
         function handleRemove(input, k, pos, strict) {
             function generalize() {
@@ -2047,7 +2041,7 @@
             unmaskAsNumber: !1,
             postFormat: function(buffer, pos, reformatOnly, opts) {
                 opts.numericInput === !0 && (buffer = buffer.reverse(), isFinite(pos) && (pos = buffer.join("").length - pos - 1));
-                var suffixStripped = !1;
+                var i, suffixStripped = !1;
                 buffer.length >= opts.suffix.length && buffer.join("").indexOf(opts.suffix) === buffer.length - opts.suffix.length && (buffer.length = buffer.length - opts.suffix.length, 
                 suffixStripped = !0), pos = pos >= buffer.length ? buffer.length - 1 : pos < opts.prefix.length ? opts.prefix.length : pos;
                 var needsRefresh = !1, charAtPos = buffer[pos];
@@ -2069,11 +2063,12 @@
                     bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator);
                     "" !== opts.radixPoint && radixSplit.length > 1 && (bufVal += opts.radixPoint + radixSplit[1]);
                 }
-                needsRefresh = bufValOrigin !== bufVal, buffer.length = bufVal.length;
-                for (var i = 0, l = bufVal.length; l > i; i++) buffer[i] = bufVal.charAt(i);
+                for (needsRefresh = bufValOrigin !== bufVal, buffer.length = bufVal.length, i = 0, 
+                l = bufVal.length; l > i; i++) buffer[i] = bufVal.charAt(i);
                 var newPos = $.inArray("?", buffer);
                 if (-1 === newPos && charAtPos === opts.radixPoint && (newPos = $.inArray(opts.radixPoint, buffer)), 
-                reformatOnly ? buffer[newPos] = charAtPos : buffer.splice(newPos, 1), !needsRefresh && suffixStripped) for (var i = 0, l = opts.suffix.length; l > i; i++) buffer.push(opts.suffix.charAt(i));
+                reformatOnly ? buffer[newPos] = charAtPos : buffer.splice(newPos, 1), !needsRefresh && suffixStripped) for (i = 0, 
+                l = opts.suffix.length; l > i; i++) buffer.push(opts.suffix.charAt(i));
                 return {
                     pos: opts.numericInput && isFinite(pos) ? buffer.join("").length - newPos - 1 : newPos,
                     refreshFromBuffer: needsRefresh,
@@ -2081,7 +2076,7 @@
                 };
             },
             onBeforeWrite: function(e, buffer, caretPos, opts) {
-                if (e && "blur" == e.type) {
+                if (e && "blur" === e.type) {
                     var maskedValue = buffer.join(""), processValue = maskedValue.replace(opts.prefix, "");
                     if (processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""), 
                     "," === opts.radixPoint && (processValue = processValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".")), 
@@ -2090,18 +2085,18 @@
                         buffer: (opts.prefix + opts.min).split("")
                     }, opts.postFormat((opts.prefix + opts.min).split(""), 0, !0, opts));
                     if (opts.numericInput !== !0) {
-                        var tmpBufSplit = "" != opts.radixPoint ? buffer.join("").split(opts.radixPoint) : [ buffer.join("") ], matchRslt = tmpBufSplit[0].match(opts.regex.integerPart(opts)), matchRsltDigits = 2 == tmpBufSplit.length ? tmpBufSplit[1].match(opts.regex.integerNPart(opts)) : void 0;
-                        !matchRslt || matchRslt[0] != opts.negationSymbol.front + "0" && matchRslt[0] != opts.negationSymbol.front && "+" != matchRslt[0] || void 0 != matchRsltDigits && !matchRsltDigits[0].match(/^0+$/) || buffer.splice(matchRslt.index, 1);
+                        var tmpBufSplit = "" !== opts.radixPoint ? buffer.join("").split(opts.radixPoint) : [ buffer.join("") ], matchRslt = tmpBufSplit[0].match(opts.regex.integerPart(opts)), matchRsltDigits = 2 === tmpBufSplit.length ? tmpBufSplit[1].match(opts.regex.integerNPart(opts)) : void 0;
+                        !matchRslt || matchRslt[0] !== opts.negationSymbol.front + "0" && matchRslt[0] !== opts.negationSymbol.front && "+" !== matchRslt[0] || void 0 !== matchRsltDigits && !matchRsltDigits[0].match(/^0+$/) || buffer.splice(matchRslt.index, 1);
                         var radixPosition = $.inArray(opts.radixPoint, buffer);
-                        if (-1 != radixPosition) {
+                        if (-1 !== radixPosition) {
                             if (isFinite(opts.digits) && !opts.digitsOptional) {
-                                for (var i = 1; i <= opts.digits; i++) (void 0 == buffer[radixPosition + i] || buffer[radixPosition + i] == opts.placeholder.charAt(0)) && (buffer[radixPosition + i] = "0");
+                                for (var i = 1; i <= opts.digits; i++) (void 0 === buffer[radixPosition + i] || buffer[radixPosition + i] === opts.placeholder.charAt(0)) && (buffer[radixPosition + i] = "0");
                                 return {
                                     refreshFromBuffer: !0,
                                     buffer: buffer
                                 };
                             }
-                            if (radixPosition == buffer.length - opts.suffix.length - 1) return buffer.splice(radixPosition, 1), 
+                            if (radixPosition === buffer.length - opts.suffix.length - 1) return buffer.splice(radixPosition, 1), 
                             {
                                 refreshFromBuffer: !0,
                                 buffer: buffer
@@ -2125,7 +2120,7 @@
             signHandler: function(chrs, maskset, pos, strict, opts) {
                 if (!strict && opts.allowMinus && "-" === chrs || opts.allowPlus && "+" === chrs) {
                     var matchRslt = maskset.buffer.join("").match(opts.regex.integerPart(opts));
-                    if (matchRslt && matchRslt[0].length > 0) return maskset.buffer[matchRslt.index] == ("-" === chrs ? "+" : opts.negationSymbol.front) ? "-" == chrs ? "" != opts.negationSymbol.back ? {
+                    if (matchRslt && matchRslt[0].length > 0) return maskset.buffer[matchRslt.index] === ("-" === chrs ? "+" : opts.negationSymbol.front) ? "-" === chrs ? "" !== opts.negationSymbol.back ? {
                         pos: matchRslt.index,
                         c: opts.negationSymbol.front,
                         remove: matchRslt.index,
@@ -2139,7 +2134,7 @@
                         c: opts.negationSymbol.front,
                         remove: matchRslt.index,
                         caret: pos
-                    } : "" != opts.negationSymbol.back ? {
+                    } : "" !== opts.negationSymbol.back ? {
                         pos: matchRslt.index,
                         c: "+",
                         remove: [ matchRslt.index, maskset.buffer.length - opts.suffix.length - 1 ],
@@ -2149,13 +2144,13 @@
                         c: "+",
                         remove: matchRslt.index,
                         caret: pos
-                    } : maskset.buffer[matchRslt.index] == ("-" === chrs ? opts.negationSymbol.front : "+") ? "-" == chrs && "" != opts.negationSymbol.back ? {
+                    } : maskset.buffer[matchRslt.index] === ("-" === chrs ? opts.negationSymbol.front : "+") ? "-" === chrs && "" !== opts.negationSymbol.back ? {
                         remove: [ matchRslt.index, maskset.buffer.length - opts.suffix.length - 1 ],
                         caret: pos - 1
                     } : {
                         remove: matchRslt.index,
                         caret: pos - 1
-                    } : "-" == chrs ? "" != opts.negationSymbol.back ? {
+                    } : "-" === chrs ? "" !== opts.negationSymbol.back ? {
                         pos: matchRslt.index,
                         c: opts.negationSymbol.front,
                         caret: pos + 1,
@@ -2340,23 +2335,25 @@
                 return initialValue.toString();
             },
             canClearPosition: function(maskset, position, lvp, strict, opts) {
-                var positionInput = maskset.validPositions[position].input, canClear = positionInput != opts.radixPoint || null != maskset.validPositions[position].match.fn && 0 == opts.decimalProtect || isFinite(positionInput) || position === lvp || positionInput === opts.groupSeparator || positionInput === opts.negationSymbol.front || positionInput === opts.negationSymbol.back;
+                var positionInput = maskset.validPositions[position].input, canClear = positionInput !== opts.radixPoint || null !== maskset.validPositions[position].match.fn && opts.decimalProtect === !1 || isFinite(positionInput) || position === lvp || positionInput === opts.groupSeparator || positionInput === opts.negationSymbol.front || positionInput === opts.negationSymbol.back;
                 if (canClear && isFinite(positionInput)) {
-                    var matchRslt;
-                    if (!strict && maskset.buffer) {
+                    var matchRslt, radixPos = $.inArray(opts.radixPoint, maskset.buffer), radixInjection = !1;
+                    if (void 0 === maskset.validPositions[radixPos] && (maskset.validPositions[radixPos] = {
+                        input: opts.radixPoint
+                    }, radixInjection = !0), !strict && maskset.buffer) {
                         matchRslt = maskset.buffer.join("").substr(0, position).match(opts.regex.integerNPart(opts));
-                        var pos = position + 1, isNull = null == matchRslt || 0 == parseInt(matchRslt[0].replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""));
-                        if (isNull) for (;maskset.validPositions[pos] && (maskset.validPositions[pos].input == opts.groupSeparator || "0" == maskset.validPositions[pos].input); ) delete maskset.validPositions[pos], 
+                        var pos = position + 1, isNull = null == matchRslt || 0 === parseInt(matchRslt[0].replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""));
+                        if (isNull) for (;maskset.validPositions[pos] && (maskset.validPositions[pos].input === opts.groupSeparator || "0" === maskset.validPositions[pos].input); ) delete maskset.validPositions[pos], 
                         pos++;
                     }
                     var buffer = [];
                     for (var vp in maskset.validPositions) buffer.push(maskset.validPositions[vp].input);
-                    1 == opts.numericInput && (position = buffer.join("").length - position, buffer.reverse()), 
-                    matchRslt = buffer.join("").match(opts.regex.integerNPart(opts));
+                    radixInjection && delete maskset.validPositions[radixPos], opts.numericInput === !0 && (position = buffer.join("").length - position, 
+                    buffer.reverse()), matchRslt = buffer.join("").match(opts.regex.integerNPart(opts));
                     var radixPosition = $.inArray(opts.radixPoint, maskset.buffer);
-                    if (matchRslt && (-1 == radixPosition || radixPosition >= position)) if (0 == matchRslt[0].indexOf("0")) canClear = matchRslt.index != position || -1 == radixPosition; else {
+                    if (matchRslt && (-1 === radixPosition || radixPosition >= position || opts.numericInput)) if (0 === matchRslt[0].indexOf("0")) canClear = matchRslt.index !== position || -1 === radixPosition; else {
                         var intPart = parseInt(matchRslt[0].replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""));
-                        -1 != radixPosition && 10 > intPart && maskset.validPositions[position] && (maskset.validPositions[position].input = "0", 
+                        -1 !== radixPosition && 10 > intPart && maskset.validPositions[position] && (maskset.validPositions[position].input = "0", 
                         maskset.p = opts.prefix.length + 1, canClear = !1);
                     }
                 }
@@ -2365,11 +2362,11 @@
             onKeyDown: function(e, buffer, caretPos, opts) {
                 var $input = $(this);
                 if (e.ctrlKey) switch (e.keyCode) {
-                  case inputmask.keyCode.UP:
+                  case Inputmask.keyCode.UP:
                     $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step)), $input.triggerHandler("setvalue.inputmask");
                     break;
 
-                  case inputmask.keyCode.DOWN:
+                  case Inputmask.keyCode.DOWN:
                     $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step)), $input.triggerHandler("setvalue.inputmask");
                 }
             }

ファイルの差分が大きいため隠しています
+ 4 - 5
dist/jquery.inputmask.bundle.min.js


+ 64 - 72
js/inputmask.js

@@ -586,9 +586,9 @@
 		}
 
 		function generateMask(mask, metadata) {
-			if (mask === undefined || mask === "")
+			if (mask === undefined || mask === "") {
 				return undefined;
-			else {
+			} else {
 				if (mask.length === 1 && opts.greedy === false && opts.repeat !== 0) {
 					opts.placeholder = "";
 				} //hide placeholder with single non-greedy mask
@@ -609,8 +609,9 @@
 						"tests": {},
 						"metadata": metadata
 					};
-					if (nocache !== true)
+					if (nocache !== true) {
 						Inputmask.prototype.masksCache[opts.numericInput ? mask.split("").reverse().join("") : mask] = masksetDefinition;
+					}
 				} else masksetDefinition = $.extend(true, {}, Inputmask.prototype.masksCache[mask]);
 
 				return masksetDefinition;
@@ -634,8 +635,9 @@
 				opts.keepStatic = opts.keepStatic === undefined ? true : opts.keepStatic; //enable by default when passing multiple masks when the option is not explicitly specified
 				var altMask = "(";
 				$.each(opts.numericInput ? opts.mask.reverse() : opts.mask, function(ndx, msk) {
-					if (altMask.length > 1)
+					if (altMask.length > 1) {
 						altMask += ")|(";
+					}
 					if (msk.mask !== undefined && !$.isFunction(msk.mask)) {
 						altMask += preProcessMask(msk.mask);
 					} else {
@@ -677,7 +679,7 @@
 	function maskScope(actionObj, maskset, opts) {
 		var isRTL = false,
 			undoValue,
-			compositionValidPos,
+			// compositionValidPos,
 			compositionCaretPos,
 			compositionData,
 			el, $el,
@@ -764,10 +766,9 @@
 							prevPosMatch = -1;
 						while (posMatch < getMaskLength() && ((t.match.fn == null && vps[i] && (vps[i].match.optionalQuantifier === true || vps[i].match.optionality === true)) || t.match.fn != null)) {
 							//determine next position
-							if (t.match.fn === null || (!opts.keepStatic && vps[i] && (vps[i + 1] !== undefined && getTests(i + 1, vps[i].locator.slice(), i).length > 1 || vps[i].alternation !== undefined)))
+							if (t.match.fn === null || (!opts.keepStatic && vps[i] && (vps[i + 1] !== undefined && getTests(i + 1, vps[i].locator.slice(), i).length > 1 || vps[i].alternation !== undefined))) {
 								posMatch++;
-							else
-								posMatch = seekNext(j);
+							} else posMatch = seekNext(j);
 
 							//does it match
 							if (positionCanMatchDefinition(posMatch, t.match.def)) {
@@ -788,8 +789,7 @@
 					getMaskSet().validPositions = $.extend(true, {}, positionsClone);
 					return false;
 				}
-			} else
-				getMaskSet().validPositions[pos] = validTest;
+			} else getMaskSet().validPositions[pos] = validTest;
 
 			return true;
 		}
@@ -798,11 +798,11 @@
 			var i, startPos = start;
 			getMaskSet().p = start; //needed for alternated position after overtype selection
 
-			var endPos = end;
 			for (i = startPos; i < end; i++) { //clear selection
 				if (getMaskSet().validPositions[i] !== undefined) {
-					if (nocheck === true || opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts) !== false)
+					if (nocheck === true || opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts) !== false) {
 						delete getMaskSet().validPositions[i];
+					}
 				}
 			}
 
@@ -824,12 +824,14 @@
 			//remove radixpoint if needed
 			var lvp = getLastValidPosition(),
 				ml = getMaskLength();
-			if (strict !== true && nocheck !== true && getMaskSet().validPositions[lvp] !== undefined && getMaskSet().validPositions[lvp].input === opts.radixPoint)
+			if (strict !== true && nocheck !== true && getMaskSet().validPositions[lvp] !== undefined && getMaskSet().validPositions[lvp].input === opts.radixPoint) {
 				delete getMaskSet().validPositions[lvp];
+			}
 
 			for (i = lvp + 1; i <= ml; i++) {
-				if (getMaskSet().validPositions[i])
+				if (getMaskSet().validPositions[i]) {
 					delete getMaskSet().validPositions[i];
+				}
 			}
 
 			resetMaskSet(true);
@@ -978,8 +980,7 @@
 													if (lmnt.locator[alternation] !== undefined) {
 														lmnt.locator[alternation] += ",";
 														lmnt.locator[alternation] += altLocArr[alndx];
-													} else
-														lmnt.locator[alternation] = parseInt(altLocArr[alndx]);
+													} else lmnt.locator[alternation] = parseInt(altLocArr[alndx]);
 
 													lmnt.alternation = alternation;
 												}
@@ -1023,8 +1024,7 @@
 							}
 						} else {
 							match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);
-							if (match)
-								return true;
+							if (match) return true;
 						}
 					} else testPos++;
 				}
@@ -1048,8 +1048,9 @@
 				var previousPos = pos - 1,
 					test;
 				while ((test = getMaskSet().validPositions[previousPos]) === undefined && previousPos > -1) {
-					if (getMaskSet().tests[previousPos] && (test = getMaskSet().tests[previousPos][0]) !== undefined)
+					if (getMaskSet().tests[previousPos] && (test = getMaskSet().tests[previousPos][0]) !== undefined) {
 						break;
+					}
 					previousPos--;
 
 				}
@@ -1064,7 +1065,7 @@
 					break;
 				}
 			}
-			if (matches.length === 0 || insertStop)
+			if (matches.length === 0 || insertStop) {
 				matches.push({
 					"match": {
 						fn: null,
@@ -1075,7 +1076,7 @@
 					},
 					"locator": []
 				});
-
+			}
 			getMaskSet().tests[pos] = $.extend(true, [], matches); //set a clone to prevent overwriting some props
 
 			// console.log(pos + " - " + JSON.stringify(matches));
@@ -1152,8 +1153,7 @@
 				$.each(getTests(position), function(ndx, tst) {
 					var test = tst.match;
 					var loopend = c ? 1 : 0,
-						chrs = '',
-						buffer = getBuffer();
+						chrs = "";
 					for (var i = test.cardinality; i > loopend; i--) {
 						chrs += getBufferElement(position - (i - 1));
 					}
@@ -1226,8 +1226,9 @@
 
 						if (!setValidPosition(validatedPos, $.extend({}, tst, {
 								"input": casing(elem, test)
-							}), fromSetValid))
+							}), fromSetValid)) {
 							rslt = false;
+						}
 						return false; //break from $.each
 					}
 				});
@@ -1310,8 +1311,9 @@
 											var staticInputsBeforePosAlternate = 0;
 											for (i = decisionPos + 1; i < getLastValidPosition() + 1; i++) {
 												validPos = getMaskSet().validPositions[i];
-												if (validPos && validPos.match.fn == null && i < pos)
+												if (validPos && validPos.match.fn == null && i < pos) {
 													staticInputsBeforePosAlternate++;
+												}
 											}
 											pos = pos + (staticInputsBeforePosAlternate - staticInputsBeforePos);
 											isValidRslt = isValid(pos > targetLvp ? targetLvp : pos, c, strict, fromSetValid);
@@ -1320,8 +1322,7 @@
 										if (!isValidRslt) {
 											resetMaskSet();
 											getMaskSet().validPositions = $.extend(true, {}, validPsClone);
-										} else
-											return isValidRslt;
+										} else return isValidRslt;
 									}
 								}
 							}
@@ -1345,7 +1346,7 @@
 							equality = -1;
 						$.each(tests, function(ndx, tst) {
 							for (var i = 0; i < tll; i++) {
-								if (tst.locator[i] && checkAlternationMatch(tst.locator[i].toString().split(','), targetLocator[i].toString().split(',')) && equality < i) {
+								if (tst.locator[i] && checkAlternationMatch(tst.locator[i].toString().split(","), targetLocator[i].toString().split(",")) && equality < i) {
 									equality = i;
 									bestMatch = tst;
 								}
@@ -1361,8 +1362,9 @@
 			var buffer = getBuffer();
 			//find previous valid
 			for (var pndx = pos - 1; pndx > -1; pndx--) {
-				if (getMaskSet().validPositions[pndx])
+				if (getMaskSet().validPositions[pndx]) {
 					break;
+				}
 			}
 			////fill missing nonmask and valid placeholders
 			pndx++;
@@ -1383,6 +1385,7 @@
 			//		resetMaskSet(true); //masklenght can be altered on the process => reset to get the actual length
 			//}
 			if (maskPos < getMaskLength()) {
+				getBuffer(); //make sure the buffer
 				result = _isValid(maskPos, c, strict, fromSetValid);
 				if ((!strict || fromSetValid) && result === false) {
 					var currentPosValid = getMaskSet().validPositions[maskPos];
@@ -1405,10 +1408,11 @@
 			if (result === false && opts.keepStatic && isComplete(buffer)) { //try fuzzy alternator logic
 				result = alternate(pos, c, strict, fromSetValid);
 			}
-			if (result === true) result = {
-				"pos": maskPos
-			};
-
+			if (result === true) {
+				result = {
+					"pos": maskPos
+				};
+			}
 			if ($.isFunction(opts.postValidation) && result !== false && !strict) {
 				resetMaskSet(true);
 				var postValidResult = opts.postValidation(getBuffer(), opts);
@@ -1429,9 +1433,9 @@
 
 		function isMask(pos) {
 			var test = getTest(pos);
-			if (test.fn != null)
+			if (test.fn != null) {
 				return test.fn;
-			else if (!opts.keepStatic && getMaskSet().validPositions[pos] === undefined) {
+			} else if (!opts.keepStatic && getMaskSet().validPositions[pos] === undefined) {
 				var tests = getTests(pos),
 					staticAlternations = true;
 				for (var i = 0; i < tests.length; i++) {
@@ -1509,9 +1513,9 @@
 
 		function getPlaceholder(pos, test) {
 			test = test || getTest(pos);
-			if (test.placeholder !== undefined)
+			if (test.placeholder !== undefined) {
 				return test.placeholder;
-			else if (test.fn === null) {
+			} else if (test.fn === null) {
 				if (!opts.keepStatic && getMaskSet().validPositions[pos] === undefined) {
 					var tests = getTests(pos),
 						hasAlternations = false,
@@ -1522,12 +1526,14 @@
 							break;
 						}
 
-						if (tests[i].match.optionality !== true && tests[i].match.optionalQuantifier !== true)
+						if (tests[i].match.optionality !== true && tests[i].match.optionalQuantifier !== true) {
 							prevTest = tests[i];
+						}
 					}
 
-					if (hasAlternations)
+					if (hasAlternations) {
 						return opts.placeholder.charAt(pos % opts.placeholder.length);
+					}
 				}
 				return test.def;
 			} else {
@@ -1536,7 +1542,7 @@
 		}
 
 		function checkVal(input, writeOut, strict, nptvl) {
-			var inputValue = nptvl !== undefined ? nptvl.slice() : input.inputmask._valueGet().split(''),
+			var inputValue = nptvl !== undefined ? nptvl.slice() : input.inputmask._valueGet().split(""),
 				charCodes = "",
 				initialNdx = 0;
 
@@ -1657,8 +1663,8 @@
 				} else if (npt.createTextRange) {
 					range = npt.createTextRange();
 					range.collapse(true);
-					range.moveEnd('character', end);
-					range.moveStart('character', begin);
+					range.moveEnd("character", end);
+					range.moveStart("character", begin);
 					range.select();
 
 				}
@@ -1820,11 +1826,10 @@
 
 					$.valHooks[type] = {
 						get: function(elem) {
-							var $elem = $(elem);
 							if (elem.inputmask) {
-								if (elem.inputmask.opts.autoUnmask)
+								if (elem.inputmask.opts.autoUnmask) {
 									return elem.inputmask.unmaskedvalue();
-								else {
+								} else {
 									var result = valhookGet(elem),
 										maskset = elem.inputmask.maskset,
 										bufferTemplate = maskset._buffer;
@@ -1837,8 +1842,9 @@
 							var $elem = $(elem),
 								result;
 							result = valhookSet(elem, value);
-							if (elem.inputmask)
+							if (elem.inputmask) {
 								$elem.triggerHandler("setvalue.inputmask");
+							}
 							return result;
 						},
 						inputmaskpatch: true
@@ -1847,15 +1853,16 @@
 			}
 
 			function getter() {
-				if (this.inputmask)
+				if (this.inputmask) {
 					return this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : (valueGet.call(this) !== getBufferTemplate().join("") ? valueGet.call(this) : "");
-				else return valueGet.call(this);
+				} else return valueGet.call(this);
 			}
 
 			function setter(value) {
 				valueSet.call(this, value);
-				if (this.inputmask)
+				if (this.inputmask) {
 					$(this).triggerHandler("setvalue.inputmask");
+				}
 			}
 
 			function installNativeValueSetFallback(npt) {
@@ -1863,8 +1870,9 @@
 					var $input = $(this),
 						input = this,
 						value = input.inputmask._valueGet();
-					if (value !== "" && value !== getBuffer().join(""))
+					if (value !== "" && value !== getBuffer().join("")) {
 						$input.triggerHandler("setvalue.inputmask");
+					}
 				});
 				//!! the bound handlers are executed in the order they where bound
 				//reorder the events - the mouseenter event is internally mapped to the mouseover event
@@ -1880,7 +1888,6 @@
 			}
 
 			if (!npt.inputmask.__valueGet) {
-				var valueProperty;
 				if (Object.getOwnPropertyDescriptor && npt.value === undefined) { // && npt.isContentEditable) {
 					valueGet = function() {
 						return this.textContent;
@@ -1893,22 +1900,6 @@
 						get: getter,
 						set: setter
 					});
-				} else if ((valueProperty = (Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(npt, "value"))) && valueProperty.configurable && false) { //experimental for chrome
-					npt._value = valueProperty.value;
-					valueGet = function() {
-						return this._value || "";
-					};
-					valueSet = function(value) {
-						this._value = value;
-						this.select();
-						this.setRangeText(value);
-						this.selectionStart = this.selectionEnd;
-					};
-
-					Object.defineProperty(npt, "value", {
-						get: getter,
-						set: setter
-					});
 				} else if (document.__lookupGetter__ && npt.__lookupGetter__("value")) {
 					valueGet = npt.__lookupGetter__("value");
 					valueSet = npt.__lookupSetter__("value");
@@ -2011,13 +2002,14 @@
 			//backspace, delete, and escape get special treatment
 			if (k === Inputmask.keyCode.BACKSPACE || k === Inputmask.keyCode.DELETE || (iphone && k === 127) || (e.ctrlKey && k === 88 && !isInputEventSupported("cut"))) { //backspace/delete
 				e.preventDefault(); //stop default action but allow propagation
-				if (k === 88) undoValue = getBuffer().join('');
+				if (k === 88) undoValue = getBuffer().join("");
 				handleRemove(input, k, pos);
-				writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join(''));
-				if (input.inputmask._valueGet() === getBufferTemplate().join(''))
-					$input.trigger('cleared');
-				else if (isComplete(getBuffer()) === true)
+				writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join(""));
+				if (input.inputmask._valueGet() === getBufferTemplate().join("")) {
+					$input.trigger("cleared");
+				} else if (isComplete(getBuffer()) === true) {
 					$input.trigger("complete");
+				}
 				if (opts.showTooltip) { //update tooltip
 					$input.prop("title", getMaskSet().mask);
 				}

+ 97 - 75
js/inputmask.numeric.extensions.js

@@ -109,11 +109,12 @@ Optional extensions on the jquery.inputmask base
 				// console.log(buffer);
 				if (opts.numericInput === true) {
 					buffer = buffer.reverse();
-					if (isFinite(pos))
-						pos = buffer.join('').length - pos - 1;
+					if (isFinite(pos)) {
+						pos = buffer.join("").length - pos - 1;
+					}
 				}
-				var negationStrip = false;
-				var suffixStripped = false;
+				var suffixStripped = false,
+					i;
 				if (buffer.length >= opts.suffix.length && buffer.join("").indexOf(opts.suffix) === (buffer.length - opts.suffix.length)) {
 					buffer.length = buffer.length - opts.suffix.length; //strip suffix
 					suffixStripped = true;
@@ -161,12 +162,13 @@ Optional extensions on the jquery.inputmask base
 							bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator);
 						}
 					}
-					if (opts.radixPoint !== "" && radixSplit.length > 1)
+					if (opts.radixPoint !== "" && radixSplit.length > 1) {
 						bufVal += opts.radixPoint + radixSplit[1];
+					}
 				}
 				needsRefresh = bufValOrigin !== bufVal;
 				buffer.length = bufVal.length; //align the length
-				for (var i = 0, l = bufVal.length; i < l; i++) {
+				for (i = 0, l = bufVal.length; i < l; i++) {
 					buffer[i] = bufVal.charAt(i);
 				}
 				var newPos = $.inArray("?", buffer);
@@ -175,19 +177,19 @@ Optional extensions on the jquery.inputmask base
 				else buffer.splice(newPos, 1);
 
 				if (!needsRefresh && suffixStripped) {
-					for (var i = 0, l = opts.suffix.length; i < l; i++) {
+					for (i = 0, l = opts.suffix.length; i < l; i++) {
 						buffer.push(opts.suffix.charAt(i));
 					}
 				}
 				// console.log("formatted " + buffer + " refresh " + needsRefresh);
 				return {
-					pos: (opts.numericInput && isFinite(pos)) ? buffer.join('').length - newPos - 1 : newPos,
+					pos: (opts.numericInput && isFinite(pos)) ? buffer.join("").length - newPos - 1 : newPos,
 					"refreshFromBuffer": needsRefresh,
 					"buffer": opts.numericInput === true ? buffer.reverse() : buffer
 				};
 			},
 			onBeforeWrite: function(e, buffer, caretPos, opts) {
-				if (e && e.type == "blur") {
+				if (e && e.type === "blur") {
 					//handle minvalue
 					var maskedValue = buffer.join(''),
 						processValue = maskedValue.replace(opts.prefix, "");
@@ -204,23 +206,23 @@ Optional extensions on the jquery.inputmask base
 						}
 					}
 					if (opts.numericInput !== true) {
-						var tmpBufSplit = opts.radixPoint != "" ? buffer.join('').split(opts.radixPoint) : [buffer.join('')],
+						var tmpBufSplit = opts.radixPoint !== "" ? buffer.join("").split(opts.radixPoint) : [buffer.join("")],
 							matchRslt = tmpBufSplit[0].match(opts.regex.integerPart(opts)),
-							matchRsltDigits = tmpBufSplit.length == 2 ? tmpBufSplit[1].match(opts.regex.integerNPart(opts)) : undefined;
-						if (matchRslt && (matchRslt[0] == opts.negationSymbol.front + "0" || matchRslt[0] == opts.negationSymbol.front || matchRslt[0] == "+") && (matchRsltDigits == undefined || matchRsltDigits[0].match(/^0+$/))) {
+							matchRsltDigits = tmpBufSplit.length === 2 ? tmpBufSplit[1].match(opts.regex.integerNPart(opts)) : undefined;
+						if (matchRslt && (matchRslt[0] === opts.negationSymbol.front + "0" || matchRslt[0] === opts.negationSymbol.front || matchRslt[0] === "+") && (matchRsltDigits === undefined || matchRsltDigits[0].match(/^0+$/))) {
 							buffer.splice(matchRslt.index, 1);
 						}
 						var radixPosition = $.inArray(opts.radixPoint, buffer);
-						if (radixPosition != -1) {
+						if (radixPosition !== -1) {
 							if (isFinite(opts.digits) && !opts.digitsOptional) {
 								for (var i = 1; i <= opts.digits; i++) {
-									if (buffer[radixPosition + i] == undefined || buffer[radixPosition + i] == opts.placeholder.charAt(0)) buffer[radixPosition + i] = "0";
+									if (buffer[radixPosition + i] === undefined || buffer[radixPosition + i] === opts.placeholder.charAt(0)) buffer[radixPosition + i] = "0";
 								}
 								return {
 									"refreshFromBuffer": true,
 									"buffer": buffer
 								};
-							} else if (radixPosition == buffer.length - opts.suffix.length - 1) {
+							} else if (radixPosition === buffer.length - opts.suffix.length - 1) {
 								buffer.splice(radixPosition, 1);
 								return {
 									"refreshFromBuffer": true,
@@ -239,55 +241,59 @@ Optional extensions on the jquery.inputmask base
 			},
 			regex: {
 				integerPart: function(opts) {
-					return new RegExp('[' + Inputmask.escapeRegex(opts.negationSymbol.front) + '\+]?\\d+');
+					return new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "\+]?\\d+");
 				},
 				integerNPart: function(opts) {
-					return new RegExp('[\\d' + Inputmask.escapeRegex(opts.groupSeparator) + ']+');
+					return new RegExp("[\\d" + Inputmask.escapeRegex(opts.groupSeparator) + "]+");
 				}
 			},
 			signHandler: function(chrs, maskset, pos, strict, opts) {
 				if (!strict && (opts.allowMinus && chrs === "-") || (opts.allowPlus && chrs === "+")) {
-					var matchRslt = maskset.buffer.join('').match(opts.regex.integerPart(opts));
+					var matchRslt = maskset.buffer.join("").match(opts.regex.integerPart(opts));
 
 					if (matchRslt && matchRslt[0].length > 0) {
-						if (maskset.buffer[matchRslt.index] == (chrs === "-" ? "+" : opts.negationSymbol.front)) {
-							if (chrs == "-") {
-								if (opts.negationSymbol.back != "")
+						if (maskset.buffer[matchRslt.index] === (chrs === "-" ? "+" : opts.negationSymbol.front)) {
+							if (chrs === "-") {
+								if (opts.negationSymbol.back !== "") {
 									return {
 										"pos": matchRslt.index,
 										"c": opts.negationSymbol.front,
 										"remove": matchRslt.index,
 										"caret": pos,
 										"insert": {
-											"pos": maskset["buffer"].length - opts.suffix.length - 1,
+											"pos": maskset.buffer.length - opts.suffix.length - 1,
 											"c": opts.negationSymbol.back
 										}
 									};
-								else return {
-									"pos": matchRslt.index,
-									"c": opts.negationSymbol.front,
-									"remove": matchRslt.index,
-									"caret": pos
-								};
+								} else {
+									return {
+										"pos": matchRslt.index,
+										"c": opts.negationSymbol.front,
+										"remove": matchRslt.index,
+										"caret": pos
+									};
+								}
 							} else {
-								if (opts.negationSymbol.back != "")
+								if (opts.negationSymbol.back !== "") {
 									return {
 										"pos": matchRslt.index,
 										"c": "+",
-										"remove": [matchRslt.index, maskset["buffer"].length - opts.suffix.length - 1],
+										"remove": [matchRslt.index, maskset.buffer.length - opts.suffix.length - 1],
 										"caret": pos
 									};
-								else return {
-									"pos": matchRslt.index,
-									"c": "+",
-									"remove": matchRslt.index,
-									"caret": pos
-								};
+								} else {
+									return {
+										"pos": matchRslt.index,
+										"c": "+",
+										"remove": matchRslt.index,
+										"caret": pos
+									};
+								}
 							}
-						} else if (maskset.buffer[matchRslt.index] == (chrs === "-" ? opts.negationSymbol.front : "+")) {
-							if (chrs == "-" && opts.negationSymbol.back != "") {
+						} else if (maskset.buffer[matchRslt.index] === (chrs === "-" ? opts.negationSymbol.front : "+")) {
+							if (chrs === "-" && opts.negationSymbol.back !== "") {
 								return {
-									"remove": [matchRslt.index, maskset["buffer"].length - opts.suffix.length - 1],
+									"remove": [matchRslt.index, maskset.buffer.length - opts.suffix.length - 1],
 									"caret": pos - 1
 								};
 							} else {
@@ -297,22 +303,24 @@ Optional extensions on the jquery.inputmask base
 								};
 							}
 						} else {
-							if (chrs == "-") {
-								if (opts.negationSymbol.back != "")
+							if (chrs === "-") {
+								if (opts.negationSymbol.back !== "") {
 									return {
 										"pos": matchRslt.index,
 										"c": opts.negationSymbol.front,
 										"caret": pos + 1,
 										"insert": {
-											"pos": maskset["buffer"].length - opts.suffix.length,
+											"pos": maskset.buffer.length - opts.suffix.length,
 											"c": opts.negationSymbol.back
 										}
 									};
-								else return {
-									"pos": matchRslt.index,
-									"c": opts.negationSymbol.front,
-									"caret": pos + 1
-								};
+								} else {
+									return {
+										"pos": matchRslt.index,
+										"c": opts.negationSymbol.front,
+										"caret": pos + 1
+									};
+								}
 							} else {
 								return {
 									"pos": matchRslt.index,
@@ -485,7 +493,7 @@ Optional extensions on the jquery.inputmask base
 					prevalidator: null,
 					placeholder: ''
 				},
-				'-': {
+				"-": {
 					validator: function(chrs, maskset, pos, strict, opts) {
 						var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
 						if (!isValid && strict && opts.allowMinus && chrs === opts.negationSymbol.back) {
@@ -497,7 +505,7 @@ Optional extensions on the jquery.inputmask base
 					prevalidator: null,
 					placeholder: ''
 				},
-				':': {
+				":": {
 					validator: function(chrs, maskset, pos, strict, opts) {
 						var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
 						if (!isValid) {
@@ -587,22 +595,32 @@ Optional extensions on the jquery.inputmask base
 			},
 			canClearPosition: function(maskset, position, lvp, strict, opts) {
 				var positionInput = maskset.validPositions[position].input,
-					canClear = ((positionInput != opts.radixPoint || (maskset.validPositions[position].match.fn != null && opts.decimalProtect == false)) || isFinite(positionInput)) ||
+					canClear = ((positionInput !== opts.radixPoint || (maskset.validPositions[position].match.fn !== null && opts.decimalProtect === false)) || isFinite(positionInput)) ||
 					position === lvp ||
 					positionInput === opts.groupSeparator ||
 					positionInput === opts.negationSymbol.front ||
-					positionInput === opts.negationSymbol.back,
-					posOffset = 0;
+					positionInput === opts.negationSymbol.back;
 
 				if (canClear && isFinite(positionInput)) {
-					var matchRslt
-					if (!strict && maskset["buffer"]) {
-						matchRslt = maskset["buffer"].join('').substr(0, position).match(opts.regex.integerNPart(opts));
+					var matchRslt,
+						radixPos = $.inArray(opts.radixPoint, maskset.buffer);
+
+					//inject radixpoint
+					var radixInjection = false;
+					if (maskset.validPositions[radixPos] === undefined) {
+						maskset.validPositions[radixPos] = {
+							input: opts.radixPoint
+						};
+						radixInjection = true;
+					}
+
+					if (!strict && maskset.buffer) {
+						matchRslt = maskset.buffer.join("").substr(0, position).match(opts.regex.integerNPart(opts));
 						var pos = position + 1,
-							isNull = matchRslt == null || parseInt(matchRslt["0"].replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "")) == 0;
+							isNull = matchRslt == null || parseInt(matchRslt["0"].replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "")) === 0;
 						if (isNull) {
-							while (maskset["validPositions"][pos] && (maskset["validPositions"][pos].input == opts.groupSeparator || maskset["validPositions"][pos].input == "0")) {
-								delete maskset["validPositions"][pos];
+							while (maskset.validPositions[pos] && (maskset.validPositions[pos].input === opts.groupSeparator || maskset.validPositions[pos].input === "0")) {
+								delete maskset.validPositions[pos];
 								pos++;
 							}
 						}
@@ -613,20 +631,24 @@ Optional extensions on the jquery.inputmask base
 					for (var vp in maskset.validPositions) {
 						buffer.push(maskset.validPositions[vp].input);
 					}
-					if (opts.numericInput == true) {
-						position = buffer.join('').length - position;
+					//remove radix Injection
+					if (radixInjection) {
+						delete maskset.validPositions[radixPos];
+					}
+					if (opts.numericInput === true) {
+						position = buffer.join("").length - position;
 						buffer.reverse();
 					}
-					matchRslt = buffer.join('').match(opts.regex.integerNPart(opts));
+					matchRslt = buffer.join("").match(opts.regex.integerNPart(opts));
 					var radixPosition = $.inArray(opts.radixPoint, maskset.buffer);
-					if (matchRslt && (radixPosition == -1 || position <= radixPosition)) {
-						if (matchRslt["0"].indexOf("0") == 0) {
-							canClear = matchRslt.index != position || radixPosition == -1;
+					if (matchRslt && (radixPosition === -1 || position <= radixPosition || opts.numericInput)) {
+						if (matchRslt["0"].indexOf("0") === 0) {
+							canClear = matchRslt.index !== position || radixPosition === -1;
 						} else {
 							var intPart = parseInt(matchRslt["0"].replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""));
-							if (radixPosition != -1 && intPart < 10 && maskset["validPositions"][position]) {
-								maskset["validPositions"][position].input = "0";
-								maskset["p"] = opts.prefix.length + 1;
+							if (radixPosition !== -1 && intPart < 10 && maskset.validPositions[position]) {
+								maskset.validPositions[position].input = "0";
+								maskset.p = opts.prefix.length + 1;
 								canClear = false;
 							}
 						}
@@ -639,19 +661,19 @@ Optional extensions on the jquery.inputmask base
 				var $input = $(this);
 				if (e.ctrlKey) {
 					switch (e.keyCode) {
-						case inputmask.keyCode.UP:
+						case Inputmask.keyCode.UP:
 							$input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step));
-							$input.triggerHandler('setvalue.inputmask');
+							$input.triggerHandler("setvalue.inputmask");
 							break;
-						case inputmask.keyCode.DOWN:
+						case Inputmask.keyCode.DOWN:
 							$input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step));
-							$input.triggerHandler('setvalue.inputmask');
+							$input.triggerHandler("setvalue.inputmask");
 							break;
 					}
 				}
 			},
 		},
-		'currency': {
+		"currency": {
 			prefix: "$ ",
 			groupSeparator: ",",
 			alias: "numeric",
@@ -661,15 +683,15 @@ Optional extensions on the jquery.inputmask base
 			digitsOptional: false,
 			clearMaskOnLostFocus: false
 		},
-		'decimal': {
+		"decimal": {
 			alias: "numeric"
 		},
-		'integer': {
+		"integer": {
 			alias: "numeric",
 			digits: 0,
 			radixPoint: ""
 		},
-		'percentage': {
+		"percentage": {
 			alias: "numeric",
 			digits: 2,
 			radixPoint: ".",

+ 2 - 2
package.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.1.64-155",
+  "version": "3.1.64-156",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
   "main": "./dist/inputmask/jquery.inputmask.js",
   "files": [
@@ -46,7 +46,7 @@
     "grunt-bump": "^0.3.0",
     "grunt-contrib-clean": "^0.6.0",
     "grunt-contrib-uglify": "^0.9.1",
-    "grunt-eslint": "^16.0.0",
+    "grunt-eslint": "^17.0.0",
     "grunt-karma": "^0.12.0",
     "grunt-nuget": "^0.1.4",
     "grunt-release": "^0.13.0",