ソースを参照

merge intellicheck with normal flow

Robin Herbots 11 年 前
コミット
e51f9e5044

+ 9 - 14
dist/inputmask/jquery.inputmask.js

@@ -524,14 +524,12 @@
             var placeholder = $.isFunction(test.placeholder) ? test.placeholder.call(this, opts) : test.placeholder;
             var placeholder = $.isFunction(test.placeholder) ? test.placeholder.call(this, opts) : test.placeholder;
             return void 0 != placeholder ? placeholder : null == test.fn ? test.def : opts.placeholder.charAt(pos % opts.placeholder.length);
             return void 0 != placeholder ? placeholder : null == test.fn ? test.def : opts.placeholder.charAt(pos % opts.placeholder.length);
         }
         }
-        function checkVal(input, writeOut, strict, nptvl, intelliCheck) {
-            var inputValue = void 0 != nptvl ? nptvl.slice() : truncateInput(input._valueGet()).split("");
+        function checkVal(input, writeOut, strict, nptvl) {
+            var inputValue = void 0 != nptvl ? nptvl.slice() : input._valueGet().split("");
             if (resetMaskSet(), writeOut && input._valueSet(""), $.each(inputValue, function(ndx, charCode) {
             if (resetMaskSet(), writeOut && input._valueSet(""), $.each(inputValue, function(ndx, charCode) {
-                if (intelliCheck === !0) {
-                    var lvp = getLastValidPosition(), pos = -1 == lvp ? ndx : seekNext(lvp);
-                    -1 == $.inArray(charCode, getBufferTemplate().slice(lvp + 1, pos)) && keypressEvent.call(input, void 0, !0, charCode.charCodeAt(0), !1, strict, strict ? ndx : getMaskSet().p);
-                } else keypressEvent.call(input, void 0, !0, charCode.charCodeAt(0), !1, strict, strict ? ndx : getMaskSet().p), 
-                strict = strict || ndx > 0 && ndx > getMaskSet().p;
+                var lvp = getLastValidPosition(), pos = -1 == lvp ? ndx : seekNext(lvp);
+                (-1 == $.inArray(charCode, getBufferTemplate().slice(lvp + 1, pos)) || strict) && (keypressEvent.call(input, void 0, !0, charCode.charCodeAt(0), !1, strict, strict ? ndx : getMaskSet().p), 
+                strict = strict || ndx > 0 && ndx > getMaskSet().p);
             }), writeOut) {
             }), writeOut) {
                 var keypressResult = opts.onKeyPress.call(this, void 0, getBuffer(), 0, opts);
                 var keypressResult = opts.onKeyPress.call(this, void 0, getBuffer(), 0, opts);
                 handleOnKeyResult(input, keypressResult), writeBuffer(input, getBuffer(), $(input).is(":focus") ? seekNext(getLastValidPosition(0)) : void 0);
                 handleOnKeyResult(input, keypressResult), writeBuffer(input, getBuffer(), $(input).is(":focus") ? seekNext(getLastValidPosition(0)) : void 0);
@@ -540,9 +538,6 @@
         function escapeRegex(str) {
         function escapeRegex(str) {
             return $.inputmask.escapeRegex.call(this, str);
             return $.inputmask.escapeRegex.call(this, str);
         }
         }
-        function truncateInput(inputValue) {
-            return inputValue.replace(new RegExp("(" + escapeRegex(getBufferTemplate().join("")) + ")*$"), "");
-        }
         function unmaskedvalue($input) {
         function unmaskedvalue($input) {
             if ($input.data("_inputmask") && !$input.hasClass("hasDatepicker")) {
             if ($input.data("_inputmask") && !$input.hasClass("hasDatepicker")) {
                 var umValue = [], vps = getMaskSet().validPositions;
                 var umValue = [], vps = getMaskSet().validPositions;
@@ -802,7 +797,7 @@
             if ("propertychange" == e.type && input._valueGet().length <= getMaskLength()) return !0;
             if ("propertychange" == e.type && input._valueGet().length <= getMaskLength()) return !0;
             "paste" == e.type && (window.clipboardData && window.clipboardData.getData ? inputValue = inputValue.substr(0, caretPos.begin) + window.clipboardData.getData("Text") + inputValue.substr(caretPos.end, inputValue.length) : e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData && (inputValue = inputValue.substr(0, caretPos.begin) + e.originalEvent.clipboardData.getData("text/plain") + inputValue.substr(caretPos.end, inputValue.length)));
             "paste" == e.type && (window.clipboardData && window.clipboardData.getData ? inputValue = inputValue.substr(0, caretPos.begin) + window.clipboardData.getData("Text") + inputValue.substr(caretPos.end, inputValue.length) : e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData && (inputValue = inputValue.substr(0, caretPos.begin) + e.originalEvent.clipboardData.getData("text/plain") + inputValue.substr(caretPos.end, inputValue.length)));
             var pasteValue = $.isFunction(opts.onBeforePaste) ? opts.onBeforePaste.call(input, inputValue, opts) || inputValue : inputValue;
             var pasteValue = $.isFunction(opts.onBeforePaste) ? opts.onBeforePaste.call(input, inputValue, opts) || inputValue : inputValue;
-            return checkVal(input, !0, !1, isRTL ? pasteValue.split("").reverse() : pasteValue.split(""), !0), 
+            return checkVal(input, !0, !1, isRTL ? pasteValue.split("").reverse() : pasteValue.split("")), 
             $input.click(), isComplete(getBuffer()) === !0 && $input.trigger("complete"), !1;
             $input.click(), isComplete(getBuffer()) === !0 && $input.trigger("complete"), !1;
         }
         }
         function mobileInputEvent(e) {
         function mobileInputEvent(e) {
@@ -891,7 +886,7 @@
                     }, 0);
                     }, 0);
                 }).bind(PasteEventType + ".inputmask dragdrop.inputmask drop.inputmask", pasteEvent).bind("setvalue.inputmask", function() {
                 }).bind(PasteEventType + ".inputmask dragdrop.inputmask drop.inputmask", pasteEvent).bind("setvalue.inputmask", function() {
                     var input = this;
                     var input = this;
-                    checkVal(input, !0, !1, void 0, !0), valueOnFocus = getBuffer().join(""), (opts.clearMaskOnLostFocus || opts.clearIncomplete) && input._valueGet() == getBufferTemplate().join("") && input._valueSet("");
+                    checkVal(input, !0, !1), valueOnFocus = getBuffer().join(""), (opts.clearMaskOnLostFocus || opts.clearIncomplete) && input._valueGet() == getBufferTemplate().join("") && input._valueSet("");
                 }).bind("cut.inputmask", function(e) {
                 }).bind("cut.inputmask", function(e) {
                     skipInputEvent = !0;
                     skipInputEvent = !0;
                     var input = this, $input = $(input), pos = caret(input);
                     var input = this, $input = $(input), pos = caret(input);
@@ -908,7 +903,7 @@
                 msie1x && $el.bind("input.inputmask", pasteEvent), (android || androidfirefox || androidchrome || kindle) && ("input" == PasteEventType && $el.unbind(PasteEventType + ".inputmask"), 
                 msie1x && $el.bind("input.inputmask", pasteEvent), (android || androidfirefox || androidchrome || kindle) && ("input" == PasteEventType && $el.unbind(PasteEventType + ".inputmask"), 
                 $el.bind("input.inputmask", mobileInputEvent)), patchValueProperty(el);
                 $el.bind("input.inputmask", mobileInputEvent)), patchValueProperty(el);
                 var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(el, el._valueGet(), opts) || el._valueGet() : el._valueGet();
                 var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(el, el._valueGet(), opts) || el._valueGet() : el._valueGet();
-                checkVal(el, !0, !1, initialValue.split(""), !0), valueOnFocus = getBuffer().join("");
+                checkVal(el, !0, !1, initialValue.split("")), valueOnFocus = getBuffer().join("");
                 var activeElement;
                 var activeElement;
                 try {
                 try {
                     activeElement = document.activeElement;
                     activeElement = document.activeElement;
@@ -939,7 +934,7 @@
                 isRTL: opts.numericInput
                 isRTL: opts.numericInput
             }), opts.numericInput && (isRTL = !0);
             }), opts.numericInput && (isRTL = !0);
             var valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call($el, actionObj.value, opts) || actionObj.value : actionObj.value).split("");
             var valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call($el, actionObj.value, opts) || actionObj.value : actionObj.value).split("");
-            return checkVal($el, !1, !1, isRTL ? valueBuffer.reverse() : valueBuffer, !0), opts.onKeyPress.call(this, void 0, getBuffer(), 0, opts), 
+            return checkVal($el, !1, !1, isRTL ? valueBuffer.reverse() : valueBuffer), opts.onKeyPress.call(this, void 0, getBuffer(), 0, opts), 
             actionObj.metadata ? {
             actionObj.metadata ? {
                 value: isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""),
                 value: isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""),
                 metadata: $el.inputmask("getmetadata")
                 metadata: $el.inputmask("getmetadata")

+ 9 - 14
dist/jquery.inputmask.bundle.js

@@ -522,14 +522,12 @@
             var placeholder = $.isFunction(test.placeholder) ? test.placeholder.call(this, opts) : test.placeholder;
             var placeholder = $.isFunction(test.placeholder) ? test.placeholder.call(this, opts) : test.placeholder;
             return void 0 != placeholder ? placeholder : null == test.fn ? test.def : opts.placeholder.charAt(pos % opts.placeholder.length);
             return void 0 != placeholder ? placeholder : null == test.fn ? test.def : opts.placeholder.charAt(pos % opts.placeholder.length);
         }
         }
-        function checkVal(input, writeOut, strict, nptvl, intelliCheck) {
-            var inputValue = void 0 != nptvl ? nptvl.slice() : truncateInput(input._valueGet()).split("");
+        function checkVal(input, writeOut, strict, nptvl) {
+            var inputValue = void 0 != nptvl ? nptvl.slice() : input._valueGet().split("");
             if (resetMaskSet(), writeOut && input._valueSet(""), $.each(inputValue, function(ndx, charCode) {
             if (resetMaskSet(), writeOut && input._valueSet(""), $.each(inputValue, function(ndx, charCode) {
-                if (intelliCheck === !0) {
-                    var lvp = getLastValidPosition(), pos = -1 == lvp ? ndx : seekNext(lvp);
-                    -1 == $.inArray(charCode, getBufferTemplate().slice(lvp + 1, pos)) && keypressEvent.call(input, void 0, !0, charCode.charCodeAt(0), !1, strict, strict ? ndx : getMaskSet().p);
-                } else keypressEvent.call(input, void 0, !0, charCode.charCodeAt(0), !1, strict, strict ? ndx : getMaskSet().p), 
-                strict = strict || ndx > 0 && ndx > getMaskSet().p;
+                var lvp = getLastValidPosition(), pos = -1 == lvp ? ndx : seekNext(lvp);
+                (-1 == $.inArray(charCode, getBufferTemplate().slice(lvp + 1, pos)) || strict) && (keypressEvent.call(input, void 0, !0, charCode.charCodeAt(0), !1, strict, strict ? ndx : getMaskSet().p), 
+                strict = strict || ndx > 0 && ndx > getMaskSet().p);
             }), writeOut) {
             }), writeOut) {
                 var keypressResult = opts.onKeyPress.call(this, void 0, getBuffer(), 0, opts);
                 var keypressResult = opts.onKeyPress.call(this, void 0, getBuffer(), 0, opts);
                 handleOnKeyResult(input, keypressResult), writeBuffer(input, getBuffer(), $(input).is(":focus") ? seekNext(getLastValidPosition(0)) : void 0);
                 handleOnKeyResult(input, keypressResult), writeBuffer(input, getBuffer(), $(input).is(":focus") ? seekNext(getLastValidPosition(0)) : void 0);
@@ -538,9 +536,6 @@
         function escapeRegex(str) {
         function escapeRegex(str) {
             return $.inputmask.escapeRegex.call(this, str);
             return $.inputmask.escapeRegex.call(this, str);
         }
         }
-        function truncateInput(inputValue) {
-            return inputValue.replace(new RegExp("(" + escapeRegex(getBufferTemplate().join("")) + ")*$"), "");
-        }
         function unmaskedvalue($input) {
         function unmaskedvalue($input) {
             if ($input.data("_inputmask") && !$input.hasClass("hasDatepicker")) {
             if ($input.data("_inputmask") && !$input.hasClass("hasDatepicker")) {
                 var umValue = [], vps = getMaskSet().validPositions;
                 var umValue = [], vps = getMaskSet().validPositions;
@@ -800,7 +795,7 @@
             if ("propertychange" == e.type && input._valueGet().length <= getMaskLength()) return !0;
             if ("propertychange" == e.type && input._valueGet().length <= getMaskLength()) return !0;
             "paste" == e.type && (window.clipboardData && window.clipboardData.getData ? inputValue = inputValue.substr(0, caretPos.begin) + window.clipboardData.getData("Text") + inputValue.substr(caretPos.end, inputValue.length) : e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData && (inputValue = inputValue.substr(0, caretPos.begin) + e.originalEvent.clipboardData.getData("text/plain") + inputValue.substr(caretPos.end, inputValue.length)));
             "paste" == e.type && (window.clipboardData && window.clipboardData.getData ? inputValue = inputValue.substr(0, caretPos.begin) + window.clipboardData.getData("Text") + inputValue.substr(caretPos.end, inputValue.length) : e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData && (inputValue = inputValue.substr(0, caretPos.begin) + e.originalEvent.clipboardData.getData("text/plain") + inputValue.substr(caretPos.end, inputValue.length)));
             var pasteValue = $.isFunction(opts.onBeforePaste) ? opts.onBeforePaste.call(input, inputValue, opts) || inputValue : inputValue;
             var pasteValue = $.isFunction(opts.onBeforePaste) ? opts.onBeforePaste.call(input, inputValue, opts) || inputValue : inputValue;
-            return checkVal(input, !0, !1, isRTL ? pasteValue.split("").reverse() : pasteValue.split(""), !0), 
+            return checkVal(input, !0, !1, isRTL ? pasteValue.split("").reverse() : pasteValue.split("")), 
             $input.click(), isComplete(getBuffer()) === !0 && $input.trigger("complete"), !1;
             $input.click(), isComplete(getBuffer()) === !0 && $input.trigger("complete"), !1;
         }
         }
         function mobileInputEvent(e) {
         function mobileInputEvent(e) {
@@ -889,7 +884,7 @@
                     }, 0);
                     }, 0);
                 }).bind(PasteEventType + ".inputmask dragdrop.inputmask drop.inputmask", pasteEvent).bind("setvalue.inputmask", function() {
                 }).bind(PasteEventType + ".inputmask dragdrop.inputmask drop.inputmask", pasteEvent).bind("setvalue.inputmask", function() {
                     var input = this;
                     var input = this;
-                    checkVal(input, !0, !1, void 0, !0), valueOnFocus = getBuffer().join(""), (opts.clearMaskOnLostFocus || opts.clearIncomplete) && input._valueGet() == getBufferTemplate().join("") && input._valueSet("");
+                    checkVal(input, !0, !1), valueOnFocus = getBuffer().join(""), (opts.clearMaskOnLostFocus || opts.clearIncomplete) && input._valueGet() == getBufferTemplate().join("") && input._valueSet("");
                 }).bind("cut.inputmask", function(e) {
                 }).bind("cut.inputmask", function(e) {
                     skipInputEvent = !0;
                     skipInputEvent = !0;
                     var input = this, $input = $(input), pos = caret(input);
                     var input = this, $input = $(input), pos = caret(input);
@@ -906,7 +901,7 @@
                 msie1x && $el.bind("input.inputmask", pasteEvent), (android || androidfirefox || androidchrome || kindle) && ("input" == PasteEventType && $el.unbind(PasteEventType + ".inputmask"), 
                 msie1x && $el.bind("input.inputmask", pasteEvent), (android || androidfirefox || androidchrome || kindle) && ("input" == PasteEventType && $el.unbind(PasteEventType + ".inputmask"), 
                 $el.bind("input.inputmask", mobileInputEvent)), patchValueProperty(el);
                 $el.bind("input.inputmask", mobileInputEvent)), patchValueProperty(el);
                 var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(el, el._valueGet(), opts) || el._valueGet() : el._valueGet();
                 var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(el, el._valueGet(), opts) || el._valueGet() : el._valueGet();
-                checkVal(el, !0, !1, initialValue.split(""), !0), valueOnFocus = getBuffer().join("");
+                checkVal(el, !0, !1, initialValue.split("")), valueOnFocus = getBuffer().join("");
                 var activeElement;
                 var activeElement;
                 try {
                 try {
                     activeElement = document.activeElement;
                     activeElement = document.activeElement;
@@ -937,7 +932,7 @@
                 isRTL: opts.numericInput
                 isRTL: opts.numericInput
             }), opts.numericInput && (isRTL = !0);
             }), opts.numericInput && (isRTL = !0);
             var valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call($el, actionObj.value, opts) || actionObj.value : actionObj.value).split("");
             var valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call($el, actionObj.value, opts) || actionObj.value : actionObj.value).split("");
-            return checkVal($el, !1, !1, isRTL ? valueBuffer.reverse() : valueBuffer, !0), opts.onKeyPress.call(this, void 0, getBuffer(), 0, opts), 
+            return checkVal($el, !1, !1, isRTL ? valueBuffer.reverse() : valueBuffer), opts.onKeyPress.call(this, void 0, getBuffer(), 0, opts), 
             actionObj.metadata ? {
             actionObj.metadata ? {
                 value: isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""),
                 value: isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""),
                 metadata: $el.inputmask("getmetadata")
                 metadata: $el.inputmask("getmetadata")

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


+ 20 - 26
js/jquery.inputmask.js

@@ -455,16 +455,16 @@
                 resetMaskSet(true);
                 resetMaskSet(true);
             }
             }
             function getTestTemplate(pos, ndxIntlzr, tstPs) {
             function getTestTemplate(pos, ndxIntlzr, tstPs) {
-            	function checkAlternationMatch(test, altNdx, altArr){
-            	       var isMatch=false, altLocArr = test.locator[altNdx].toString().split(",");
-                       for (var alndx = 0; alndx < altLocArr.length; alndx++) {
-                          if($.inArray(altLocArr[alndx], altArr) != -1){
-                          	isMatch = true;
-                          	break;
-                          }
-					   }
-					   return isMatch;
-               	}
+                function checkAlternationMatch(test, altNdx, altArr) {
+                    var isMatch = false, altLocArr = test.locator[altNdx].toString().split(",");
+                    for (var alndx = 0; alndx < altLocArr.length; alndx++) {
+                        if ($.inArray(altLocArr[alndx], altArr) != -1) {
+                            isMatch = true;
+                            break;
+                        }
+                    }
+                    return isMatch;
+                }
                 var testPositions = getTests(pos, ndxIntlzr, tstPs),
                 var testPositions = getTests(pos, ndxIntlzr, tstPs),
                     testPos,
                     testPos,
                     lvp = getLastValidPosition(),
                     lvp = getLastValidPosition(),
@@ -931,21 +931,18 @@
                 var placeholder = $.isFunction(test["placeholder"]) ? test["placeholder"].call(this, opts) : test["placeholder"];
                 var placeholder = $.isFunction(test["placeholder"]) ? test["placeholder"].call(this, opts) : test["placeholder"];
                 return placeholder != undefined ? placeholder : (test["fn"] == null ? test["def"] : opts.placeholder.charAt(pos % opts.placeholder.length));
                 return placeholder != undefined ? placeholder : (test["fn"] == null ? test["def"] : opts.placeholder.charAt(pos % opts.placeholder.length));
             }
             }
-            function checkVal(input, writeOut, strict, nptvl, intelliCheck) {
-                var inputValue = nptvl != undefined ? nptvl.slice() : truncateInput(input._valueGet()).split('');
+            function checkVal(input, writeOut, strict, nptvl) {
+                var inputValue = nptvl != undefined ? nptvl.slice() : input._valueGet().split('');
                 resetMaskSet();
                 resetMaskSet();
                 if (writeOut) input._valueSet(""); //initial clear
                 if (writeOut) input._valueSet(""); //initial clear
                 $.each(inputValue, function (ndx, charCode) {
                 $.each(inputValue, function (ndx, charCode) {
-                    if (intelliCheck === true) {
-                        var lvp = getLastValidPosition(),
-                            pos = lvp == -1 ? ndx : seekNext(lvp);
-                        if ($.inArray(charCode, getBufferTemplate().slice(lvp + 1, pos)) == -1) {
-                            keypressEvent.call(input, undefined, true, charCode.charCodeAt(0), false, strict, strict ? ndx : getMaskSet()["p"]);
-                        }
-                    } else {
+                    var lvp = getLastValidPosition(),
+                        pos = lvp == -1 ? ndx : seekNext(lvp);
+                    if ($.inArray(charCode, getBufferTemplate().slice(lvp + 1, pos)) == -1 || strict) {
                         keypressEvent.call(input, undefined, true, charCode.charCodeAt(0), false, strict, strict ? ndx : getMaskSet()["p"]);
                         keypressEvent.call(input, undefined, true, charCode.charCodeAt(0), false, strict, strict ? ndx : getMaskSet()["p"]);
                         strict = strict || (ndx > 0 && ndx > getMaskSet()["p"]);
                         strict = strict || (ndx > 0 && ndx > getMaskSet()["p"]);
                     }
                     }
+
                 });
                 });
                 if (writeOut) {
                 if (writeOut) {
                     var keypressResult = opts.onKeyPress.call(this, undefined, getBuffer(), 0, opts);
                     var keypressResult = opts.onKeyPress.call(this, undefined, getBuffer(), 0, opts);
@@ -956,9 +953,6 @@
             function escapeRegex(str) {
             function escapeRegex(str) {
                 return $.inputmask.escapeRegex.call(this, str);
                 return $.inputmask.escapeRegex.call(this, str);
             }
             }
-            function truncateInput(inputValue) {
-                return inputValue.replace(new RegExp("(" + escapeRegex(getBufferTemplate().join('')) + ")*$"), "");
-            }
             function unmaskedvalue($input) {
             function unmaskedvalue($input) {
                 if ($input.data('_inputmask') && !$input.hasClass('hasDatepicker')) {
                 if ($input.data('_inputmask') && !$input.hasClass('hasDatepicker')) {
                     var umValue = [], vps = getMaskSet()["validPositions"];
                     var umValue = [], vps = getMaskSet()["validPositions"];
@@ -1463,7 +1457,7 @@
                 }
                 }
 
 
                 var pasteValue = $.isFunction(opts.onBeforePaste) ? (opts.onBeforePaste.call(input, inputValue, opts) || inputValue) : inputValue;
                 var pasteValue = $.isFunction(opts.onBeforePaste) ? (opts.onBeforePaste.call(input, inputValue, opts) || inputValue) : inputValue;
-                checkVal(input, true, false, isRTL ? pasteValue.split('').reverse() : pasteValue.split(''), true);
+                checkVal(input, true, false, isRTL ? pasteValue.split('').reverse() : pasteValue.split(''));
                 $input.click();
                 $input.click();
                 if (isComplete(getBuffer()) === true)
                 if (isComplete(getBuffer()) === true)
                     $input.trigger("complete");
                     $input.trigger("complete");
@@ -1659,7 +1653,7 @@
                     }).bind(PasteEventType + ".inputmask dragdrop.inputmask drop.inputmask", pasteEvent
                     }).bind(PasteEventType + ".inputmask dragdrop.inputmask drop.inputmask", pasteEvent
                     ).bind('setvalue.inputmask', function () {
                     ).bind('setvalue.inputmask', function () {
                         var input = this;
                         var input = this;
-                        checkVal(input, true, false, undefined, true);
+                        checkVal(input, true, false);
                         valueOnFocus = getBuffer().join('');
                         valueOnFocus = getBuffer().join('');
                         if ((opts.clearMaskOnLostFocus || opts.clearIncomplete) && input._valueGet() == getBufferTemplate().join(''))
                         if ((opts.clearMaskOnLostFocus || opts.clearIncomplete) && input._valueGet() == getBufferTemplate().join(''))
                             input._valueSet('');
                             input._valueSet('');
@@ -1702,7 +1696,7 @@
 
 
                     //apply mask
                     //apply mask
                     var initialValue = $.isFunction(opts.onBeforeMask) ? (opts.onBeforeMask.call(el, el._valueGet(), opts) || el._valueGet()) : el._valueGet();
                     var initialValue = $.isFunction(opts.onBeforeMask) ? (opts.onBeforeMask.call(el, el._valueGet(), opts) || el._valueGet()) : el._valueGet();
-                    checkVal(el, true, false, initialValue.split(''), true);
+                    checkVal(el, true, false, initialValue.split(''));
                     valueOnFocus = getBuffer().join('');
                     valueOnFocus = getBuffer().join('');
                     // Wrap document.activeElement in a try/catch block since IE9 throw "Unspecified error" if document.activeElement is undefined when we are in an IFrame.
                     // Wrap document.activeElement in a try/catch block since IE9 throw "Unspecified error" if document.activeElement is undefined when we are in an IFrame.
                     var activeElement;
                     var activeElement;
@@ -1761,7 +1755,7 @@
                             isRTL = true;
                             isRTL = true;
                         }
                         }
                         var valueBuffer = ($.isFunction(opts.onBeforeMask) ? (opts.onBeforeMask.call($el, actionObj["value"], opts) || actionObj["value"]) : actionObj["value"]).split('');
                         var valueBuffer = ($.isFunction(opts.onBeforeMask) ? (opts.onBeforeMask.call($el, actionObj["value"], opts) || actionObj["value"]) : actionObj["value"]).split('');
-                        checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer, true);
+                        checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer);
                         opts.onKeyPress.call(this, undefined, getBuffer(), 0, opts);
                         opts.onKeyPress.call(this, undefined, getBuffer(), 0, opts);
 
 
                         if (actionObj["metadata"]) {
                         if (actionObj["metadata"]) {