Browse Source

fix errors in IE8

Robin Herbots 10 years ago
parent
commit
25cc129597

+ 1 - 0
CHANGELOG.md

@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
 - improve extendAliases, extendDefinitions, extendDefaults
 
 ### Fixed
+- IE8 Null values after submit #1076
 - Each character repeats on Mobile #912
 - extra tooltip property #1071
 - Numeric aliases insert '0' in input after clearing if there was fraction part #1067

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.2.3-9",
+  "version": "3.2.3-13",
   "main": [
     "./dist/inputmask/inputmask.dependencyLib.jquery.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.2.3-9",
+  "version": "3.2.3-13",
   "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.2.3-9",
+  "version": "3.2.3-13",
   "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.2.3-9
+* Version: 3.2.3-13
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "inputmask.dependencyLib", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib.jquery"), require("./inputmask")) : factory(jQuery, window.Inputmask);

+ 1 - 1
dist/inputmask/inputmask.dependencyLib.jquery.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.2.3-9
+* Version: 3.2.3-13
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery")) : factory(jQuery);

+ 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.2.3-9
+* Version: 3.2.3-13
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "inputmask.dependencyLib", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib.jquery"), require("./inputmask")) : factory(jQuery, window.Inputmask);

+ 16 - 15
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.2.3-9
+* Version: 3.2.3-13
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "inputmask.dependencyLib" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib.jquery")) : factory(window.dependencyLib || jQuery);
@@ -716,7 +716,7 @@
                 end: translatePosition(end)
             };
             begin = translatePosition(begin), end = translatePosition(end), end = "number" == typeof end ? end : begin;
-            var scrollCalc = (input.ownerDocument.defaultView || window).getComputedStyle(input, null).fontSize.replace("px", "") * end;
+            var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end;
             if (input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0, androidchrome || opts.insertMode !== !1 || begin !== end || end++, 
             input.setSelectionRange) input.selectionStart = begin, input.selectionEnd = end; else if (window.getSelection) {
                 if (range = document.createRange(), void 0 === input.firstChild) {
@@ -767,6 +767,7 @@
         }
         function wrapEventRuler(eventHandler) {
             return function(e) {
+                console.log("triggered " + e.type);
                 var inComposition = !1, keydownPressed = !1;
                 if (void 0 === this.inputmask) {
                     var imOpts = $.data(this, "_inputmask_opts");
@@ -807,7 +808,7 @@
         }
         function patchValueProperty(npt) {
             function patchValhook(type) {
-                if ($.valHooks && void 0 === $.valHooks[type] || $.valHooks[type].inputmaskpatch !== !0) {
+                if ($.valHooks && (void 0 === $.valHooks[type] || $.valHooks[type].inputmaskpatch !== !0)) {
                     var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) {
                         return elem.value;
                     }, valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) {
@@ -898,7 +899,7 @@
             k === Inputmask.keyCode.BACKSPACE || k === Inputmask.keyCode.DELETE || iphone && 127 === k || e.ctrlKey && 88 === k && !isInputEventSupported("cut") ? (e.preventDefault(), 
             88 === k && (undoValue = getBuffer().join("")), handleRemove(input, k, pos), writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join("")), 
             input.inputmask._valueGet() === getBufferTemplate().join("") ? $input.trigger("cleared") : isComplete(getBuffer()) === !0 && $input.trigger("complete"), 
-            opts.showTooltip && $input.prop("title", opts.tooltip || getMaskSet().mask)) : k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN ? setTimeout(function() {
+            opts.showTooltip && (input.title = opts.tooltip || getMaskSet().mask)) : k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN ? setTimeout(function() {
                 var caretPos = seekNext(getLastValidPosition());
                 opts.insertMode || caretPos !== getMaskLength() || e.shiftKey || caretPos--, caret(input, e.shiftKey ? pos.begin : caretPos, caretPos);
             }, 0) : k === Inputmask.keyCode.HOME && !e.shiftKey || k === Inputmask.keyCode.PAGE_UP ? caret(input, 0, e.shiftKey ? pos.begin : 0) : (opts.undoOnEscape && k === Inputmask.keyCode.ESCAPE || 90 === k && e.ctrlKey) && e.altKey !== !0 ? (checkVal(input, !0, !1, undoValue.split("")), 
@@ -950,8 +951,7 @@
                         }, 0);
                     } else isSlctn && (getMaskSet().buffer = void 0, getMaskSet().validPositions = getMaskSet().undoPositions);
                 } else isSlctn && (getMaskSet().buffer = void 0, getMaskSet().validPositions = getMaskSet().undoPositions);
-                if (opts.showTooltip && $input.prop("title", opts.tooltip || getMaskSet().mask), 
-                checkval && $.isFunction(opts.onBeforeWrite)) {
+                if (opts.showTooltip && (input.title = opts.tooltip || getMaskSet().mask), checkval && $.isFunction(opts.onBeforeWrite)) {
                     var result = opts.onBeforeWrite(e, getBuffer(), forwardPosition, opts);
                     if (result && result.refreshFromBuffer) {
                         var refresh = result.refreshFromBuffer;
@@ -963,13 +963,13 @@
             }
         }
         function pasteEvent(e) {
-            var input = this, $input = $(input), inputValue = input.inputmask._valueGet(!0), caretPos = caret(input);
+            var input = this, ev = e.originalEvent || e, $input = $(input), inputValue = input.inputmask._valueGet(!0), caretPos = caret(input);
             if ("propertychange" === e.type && input.inputmask._valueGet().length <= getMaskLength()) return !0;
             if ("paste" === e.type) {
                 var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);
                 valueBeforeCaret === getBufferTemplate().slice(0, caretPos.begin).join("") && (valueBeforeCaret = ""), 
                 valueAfterCaret === getBufferTemplate().slice(caretPos.end).join("") && (valueAfterCaret = ""), 
-                window.clipboardData && window.clipboardData.getData ? inputValue = valueBeforeCaret + window.clipboardData.getData("Text") + valueAfterCaret : e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData && (inputValue = valueBeforeCaret + e.originalEvent.clipboardData.getData("text/plain") + valueAfterCaret);
+                window.clipboardData && window.clipboardData.getData ? inputValue = valueBeforeCaret + window.clipboardData.getData("Text") + valueAfterCaret : ev.clipboardData && ev.clipboardData.getData && (inputValue = valueBeforeCaret + ev.clipboardData.getData("text/plain") + valueAfterCaret);
             }
             var pasteValue = inputValue;
             if ($.isFunction(opts.onBeforePaste)) {
@@ -987,14 +987,15 @@
             e.preventDefault();
         }
         function compositionStartEvent(e) {
-            undoValue = getBuffer().join(""), "" === compositionData || 0 !== e.originalEvent.data.indexOf(compositionData);
+            var ev = e.originalEvent || e;
+            undoValue = getBuffer().join(""), "" === compositionData || 0 !== ev.data.indexOf(compositionData);
         }
         function compositionUpdateEvent(e) {
-            var input = this;
+            var input = this, ev = e.originalEvent || e;
             caret(input);
-            0 === e.originalEvent.data.indexOf(compositionData) && (resetMaskSet(), getMaskSet().p = seekNext(-1), 
+            0 === ev.data.indexOf(compositionData) && (resetMaskSet(), getMaskSet().p = seekNext(-1), 
             skipInputEvent = !0);
-            for (var newData = e.originalEvent.data, i = 0; i < newData.length; i++) {
+            for (var newData = ev.data, i = 0; i < newData.length; i++) {
                 var keypress = $.Event("keypress");
                 keypress.which = newData.charCodeAt(i), skipKeyPressEvent = !1, ignorable = !1, 
                 keypressEvent.call(input, keypress, !0, !1, !1, getMaskSet().p);
@@ -1002,7 +1003,7 @@
             setTimeout(function() {
                 var forwardPosition = getMaskSet().p;
                 writeBuffer(input, getBuffer(), opts.numericInput ? seekPrevious(forwardPosition) : forwardPosition);
-            }, 0), compositionData = e.originalEvent.data;
+            }, 0), compositionData = evt.data;
         }
         function compositionEndEvent(e) {}
         function setValueEvent(e) {
@@ -1057,9 +1058,9 @@
         }
         function cutEvent(e) {
             skipInputEvent = !0;
-            var input = this, $input = $(input), pos = caret(input);
+            var input = this, $input = $(input), pos = caret(input), ev = e.originalEvent || e;
             if (isRTL) {
-                var clipboardData = window.clipboardData || e.originalEvent.clipboardData, clipData = clipboardData.getData("text").split("").reverse().join("");
+                var clipboardData = window.clipboardData || ev.clipboardData, clipData = clipboardData.getData("text").split("").reverse().join("");
                 clipboardData.setData("text", clipData);
             }
             handleRemove(input, Inputmask.keyCode.DELETE, pos), writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join("")), 

+ 1 - 1
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.2.3-9
+* Version: 3.2.3-13
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "inputmask.dependencyLib", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib.jquery"), require("./inputmask")) : factory(jQuery, window.Inputmask);

+ 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.2.3-9
+* Version: 3.2.3-13
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery, window.Inputmask);

+ 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.2.3-9
+* Version: 3.2.3-13
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "inputmask.dependencyLib", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib.jquery"), require("./inputmask")) : factory(jQuery, window.Inputmask);

+ 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.2.3-9
+* Version: 3.2.3-13
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery, window.Inputmask);

+ 16 - 15
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.2.3-9
+* Version: 3.2.3-13
 */
 !function($) {
     function Inputmask(alias, options) {
@@ -714,7 +714,7 @@
                 end: translatePosition(end)
             };
             begin = translatePosition(begin), end = translatePosition(end), end = "number" == typeof end ? end : begin;
-            var scrollCalc = (input.ownerDocument.defaultView || window).getComputedStyle(input, null).fontSize.replace("px", "") * end;
+            var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end;
             if (input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0, androidchrome || opts.insertMode !== !1 || begin !== end || end++, 
             input.setSelectionRange) input.selectionStart = begin, input.selectionEnd = end; else if (window.getSelection) {
                 if (range = document.createRange(), void 0 === input.firstChild) {
@@ -765,6 +765,7 @@
         }
         function wrapEventRuler(eventHandler) {
             return function(e) {
+                console.log("triggered " + e.type);
                 var inComposition = !1, keydownPressed = !1;
                 if (void 0 === this.inputmask) {
                     var imOpts = $.data(this, "_inputmask_opts");
@@ -805,7 +806,7 @@
         }
         function patchValueProperty(npt) {
             function patchValhook(type) {
-                if ($.valHooks && void 0 === $.valHooks[type] || $.valHooks[type].inputmaskpatch !== !0) {
+                if ($.valHooks && (void 0 === $.valHooks[type] || $.valHooks[type].inputmaskpatch !== !0)) {
                     var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) {
                         return elem.value;
                     }, valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) {
@@ -896,7 +897,7 @@
             k === Inputmask.keyCode.BACKSPACE || k === Inputmask.keyCode.DELETE || iphone && 127 === k || e.ctrlKey && 88 === k && !isInputEventSupported("cut") ? (e.preventDefault(), 
             88 === k && (undoValue = getBuffer().join("")), handleRemove(input, k, pos), writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join("")), 
             input.inputmask._valueGet() === getBufferTemplate().join("") ? $input.trigger("cleared") : isComplete(getBuffer()) === !0 && $input.trigger("complete"), 
-            opts.showTooltip && $input.prop("title", opts.tooltip || getMaskSet().mask)) : k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN ? setTimeout(function() {
+            opts.showTooltip && (input.title = opts.tooltip || getMaskSet().mask)) : k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN ? setTimeout(function() {
                 var caretPos = seekNext(getLastValidPosition());
                 opts.insertMode || caretPos !== getMaskLength() || e.shiftKey || caretPos--, caret(input, e.shiftKey ? pos.begin : caretPos, caretPos);
             }, 0) : k === Inputmask.keyCode.HOME && !e.shiftKey || k === Inputmask.keyCode.PAGE_UP ? caret(input, 0, e.shiftKey ? pos.begin : 0) : (opts.undoOnEscape && k === Inputmask.keyCode.ESCAPE || 90 === k && e.ctrlKey) && e.altKey !== !0 ? (checkVal(input, !0, !1, undoValue.split("")), 
@@ -948,8 +949,7 @@
                         }, 0);
                     } else isSlctn && (getMaskSet().buffer = void 0, getMaskSet().validPositions = getMaskSet().undoPositions);
                 } else isSlctn && (getMaskSet().buffer = void 0, getMaskSet().validPositions = getMaskSet().undoPositions);
-                if (opts.showTooltip && $input.prop("title", opts.tooltip || getMaskSet().mask), 
-                checkval && $.isFunction(opts.onBeforeWrite)) {
+                if (opts.showTooltip && (input.title = opts.tooltip || getMaskSet().mask), checkval && $.isFunction(opts.onBeforeWrite)) {
                     var result = opts.onBeforeWrite(e, getBuffer(), forwardPosition, opts);
                     if (result && result.refreshFromBuffer) {
                         var refresh = result.refreshFromBuffer;
@@ -961,13 +961,13 @@
             }
         }
         function pasteEvent(e) {
-            var input = this, $input = $(input), inputValue = input.inputmask._valueGet(!0), caretPos = caret(input);
+            var input = this, ev = e.originalEvent || e, $input = $(input), inputValue = input.inputmask._valueGet(!0), caretPos = caret(input);
             if ("propertychange" === e.type && input.inputmask._valueGet().length <= getMaskLength()) return !0;
             if ("paste" === e.type) {
                 var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);
                 valueBeforeCaret === getBufferTemplate().slice(0, caretPos.begin).join("") && (valueBeforeCaret = ""), 
                 valueAfterCaret === getBufferTemplate().slice(caretPos.end).join("") && (valueAfterCaret = ""), 
-                window.clipboardData && window.clipboardData.getData ? inputValue = valueBeforeCaret + window.clipboardData.getData("Text") + valueAfterCaret : e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData && (inputValue = valueBeforeCaret + e.originalEvent.clipboardData.getData("text/plain") + valueAfterCaret);
+                window.clipboardData && window.clipboardData.getData ? inputValue = valueBeforeCaret + window.clipboardData.getData("Text") + valueAfterCaret : ev.clipboardData && ev.clipboardData.getData && (inputValue = valueBeforeCaret + ev.clipboardData.getData("text/plain") + valueAfterCaret);
             }
             var pasteValue = inputValue;
             if ($.isFunction(opts.onBeforePaste)) {
@@ -985,14 +985,15 @@
             e.preventDefault();
         }
         function compositionStartEvent(e) {
-            undoValue = getBuffer().join(""), "" === compositionData || 0 !== e.originalEvent.data.indexOf(compositionData);
+            var ev = e.originalEvent || e;
+            undoValue = getBuffer().join(""), "" === compositionData || 0 !== ev.data.indexOf(compositionData);
         }
         function compositionUpdateEvent(e) {
-            var input = this;
+            var input = this, ev = e.originalEvent || e;
             caret(input);
-            0 === e.originalEvent.data.indexOf(compositionData) && (resetMaskSet(), getMaskSet().p = seekNext(-1), 
+            0 === ev.data.indexOf(compositionData) && (resetMaskSet(), getMaskSet().p = seekNext(-1), 
             skipInputEvent = !0);
-            for (var newData = e.originalEvent.data, i = 0; i < newData.length; i++) {
+            for (var newData = ev.data, i = 0; i < newData.length; i++) {
                 var keypress = $.Event("keypress");
                 keypress.which = newData.charCodeAt(i), skipKeyPressEvent = !1, ignorable = !1, 
                 keypressEvent.call(input, keypress, !0, !1, !1, getMaskSet().p);
@@ -1000,7 +1001,7 @@
             setTimeout(function() {
                 var forwardPosition = getMaskSet().p;
                 writeBuffer(input, getBuffer(), opts.numericInput ? seekPrevious(forwardPosition) : forwardPosition);
-            }, 0), compositionData = e.originalEvent.data;
+            }, 0), compositionData = evt.data;
         }
         function compositionEndEvent(e) {}
         function setValueEvent(e) {
@@ -1055,9 +1056,9 @@
         }
         function cutEvent(e) {
             skipInputEvent = !0;
-            var input = this, $input = $(input), pos = caret(input);
+            var input = this, $input = $(input), pos = caret(input), ev = e.originalEvent || e;
             if (isRTL) {
-                var clipboardData = window.clipboardData || e.originalEvent.clipboardData, clipData = clipboardData.getData("text").split("").reverse().join("");
+                var clipboardData = window.clipboardData || ev.clipboardData, clipData = clipboardData.getData("text").split("").reverse().join("");
                 clipboardData.setData("text", clipData);
             }
             handleRemove(input, Inputmask.keyCode.DELETE, pos), writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join("")), 

File diff suppressed because it is too large
+ 1 - 1
dist/min/inputmask/inputmask.date.extensions.min.js


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

@@ -3,6 +3,6 @@
 * 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.2.3-9
+* Version: 3.2.3-13
 */
 !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return window.dependencyLib=a,a});

File diff suppressed because it is too large
+ 1 - 1
dist/min/inputmask/inputmask.extensions.min.js


File diff suppressed because it is too large
+ 3 - 3
dist/min/inputmask/inputmask.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/min/inputmask/inputmask.numeric.extensions.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/min/inputmask/inputmask.phone.extensions.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/min/inputmask/inputmask.regex.extensions.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/min/inputmask/jquery.inputmask.min.js


+ 12 - 4
extra/dependencyLibs/inputmask.dependencyLib.js

@@ -212,11 +212,19 @@
 							namespace = nsEvent[1] || "global";
 						if (document !== undefined && namespace === "global") {
 							//trigger domevent
-							var evnt, i; // The custom event that will be created
+							var evnt, i, params = {
+								bubbles: false,
+								cancelable: true,
+								detail: Array.prototype.slice.call(arguments, 1)
+							};
+							// The custom event that will be created
 							if (document.createEvent) {
-								evnt = new CustomEvent(ev, {
-									detail: Array.prototype.slice.call(arguments, 1)
-								});
+								try {
+									evnt = new CustomEvent(ev, params);
+								} catch (e) {
+									evnt = document.createEvent('CustomEvent');
+									evnt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
+								}
 								if (events.type) DependencyLib.extend(evnt, events);
 								elem.dispatchEvent(evnt);
 							} else {

+ 18 - 15
js/inputmask.js

@@ -1680,7 +1680,7 @@
 					// 	return;
 					// }
 
-					var scrollCalc = (input.ownerDocument.defaultView || window).getComputedStyle(input, null).fontSize.replace("px", "") * end;
+					var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end;
 					input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0;
 					if (!androidchrome && opts.insertMode === false && begin === end) end++; //set visualization for insert/overwrite mode
 					if (input.setSelectionRange) {
@@ -1799,7 +1799,7 @@
 
 			function wrapEventRuler(eventHandler) {
 				return function(e) {
-					// console.log("triggered " + e.type);
+					console.log("triggered " + e.type);
 					var inComposition = false,
 						keydownPressed = false;
 					if (this.inputmask === undefined) { //happens when cloning an object with jquery.clone
@@ -1852,7 +1852,7 @@
 				var valueSet;
 
 				function patchValhook(type) {
-					if ($.valHooks && $.valHooks[type] === undefined || $.valHooks[type].inputmaskpatch !== true) {
+					if ($.valHooks && ($.valHooks[type] === undefined || $.valHooks[type].inputmaskpatch !== true)) {
 						var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) {
 							return elem.value;
 						};
@@ -2048,7 +2048,7 @@
 						$input.trigger("complete");
 					}
 					if (opts.showTooltip) { //update tooltip
-						$input.prop("title", opts.tooltip || getMaskSet().mask);
+						input.title = opts.tooltip || getMaskSet().mask;
 					}
 				} else if (k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN) { //when END or PAGE_DOWN pressed set position at lastmatch
 					setTimeout(function() {
@@ -2177,7 +2177,7 @@
 						}
 
 						if (opts.showTooltip) { //update tooltip
-							$input.prop("title", opts.tooltip || getMaskSet().mask);
+							input.title = opts.tooltip || getMaskSet().mask;
 						}
 
 						if (checkval && $.isFunction(opts.onBeforeWrite)) {
@@ -2202,6 +2202,7 @@
 
 			function pasteEvent(e) {
 				var input = this,
+					ev = e.originalEvent || e,
 					$input = $(input),
 					inputValue = input.inputmask._valueGet(true),
 					caretPos = caret(input);
@@ -2217,8 +2218,8 @@
 
 					if (window.clipboardData && window.clipboardData.getData) { // IE
 						inputValue = valueBeforeCaret + window.clipboardData.getData("Text") + valueAfterCaret;
-					} else if (e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData) {
-						inputValue = valueBeforeCaret + e.originalEvent.clipboardData.getData("text/plain") + valueAfterCaret;
+					} else if (ev.clipboardData && ev.clipboardData.getData) {
+						inputValue = valueBeforeCaret + ev.clipboardData.getData("text/plain") + valueAfterCaret;
 					}
 				}
 
@@ -2245,7 +2246,7 @@
 
 			function inputFallBackEvent(e) { //fallback when keypress & compositionevents fail
 				var input = this;
-				checkVal(input, true, false, input.inputmask._valueGet().split(''));
+				checkVal(input, true, false, input.inputmask._valueGet().split(""));
 
 				if (isComplete(getBuffer()) === true) {
 					$(input).trigger("complete");
@@ -2255,23 +2256,24 @@
 			}
 
 			function compositionStartEvent(e) {
-				var input = this;
+				var ev = e.originalEvent || e;
 				undoValue = getBuffer().join("");
-				if (compositionData === "" || e.originalEvent.data.indexOf(compositionData) !== 0) {
+				if (compositionData === "" || ev.data.indexOf(compositionData) !== 0) {
 					// compositionCaretPos = caret(input);
 				}
 			}
 
 			function compositionUpdateEvent(e) {
 				var input = this,
+					ev = e.originalEvent || e,
 					caretPos = caret(input);
-				if (e.originalEvent.data.indexOf(compositionData) === 0) {
+				if (ev.data.indexOf(compositionData) === 0) {
 					resetMaskSet();
 					getMaskSet().p = seekNext(-1); //needs check
 					skipInputEvent = true;
 					// caretPos = compositionCaretPos;
 				}
-				var newData = e.originalEvent.data;
+				var newData = ev.data;
 				// caret(input, caretPos.begin, caretPos.end);
 				for (var i = 0; i < newData.length; i++) {
 					var keypress = $.Event("keypress");
@@ -2284,7 +2286,7 @@
 					var forwardPosition = getMaskSet().p;
 					writeBuffer(input, getBuffer(), opts.numericInput ? seekPrevious(forwardPosition) : forwardPosition);
 				}, 0);
-				compositionData = e.originalEvent.data;
+				compositionData = evt.data;
 			}
 
 			function compositionEndEvent(e) {
@@ -2387,11 +2389,12 @@
 				skipInputEvent = true; //stop inputFallback
 				var input = this,
 					$input = $(input),
-					pos = caret(input);
+					pos = caret(input),
+					ev = e.originalEvent || e;
 
 				//correct clipboardData
 				if (isRTL) {
-					var clipboardData = window.clipboardData || e.originalEvent.clipboardData,
+					var clipboardData = window.clipboardData || ev.clipboardData,
 						clipData = clipboardData.getData("text").split("").reverse().join("");
 					clipboardData.setData("text", clipData);
 				}

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.2.3-9",
+  "version": "3.2.3-13",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
   "main": "./dist/inputmask/jquery.inputmask.js",
   "files": [

+ 2 - 2
qunit/main.js

@@ -10,7 +10,7 @@ define([
 ], function(qunit) {
 	// start QUnit.
 	qunit.load();
-	qunit.start();
+
 
 	require([
 		"tests_base",
@@ -30,5 +30,5 @@ define([
 		"tests_regex", "tests_escape"
 	]);
 
-
+	qunit.start();
 });