Browse Source

scoping issue #402

Robin Herbots 12 years ago
parent
commit
9a7d5577a7

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 
 build.major = 2
 build.major = 2
 build.minor = 4
 build.minor = 4
-build.revision = 13
+build.revision = 14
 
 
 target = jquery.inputmask.bundle.js
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js
 target.min = jquery.inputmask.bundle.min.js

+ 1 - 1
component.json

@@ -1,6 +1,6 @@
 {
 {
     "name": "jquery.inputmask",
     "name": "jquery.inputmask",
-    "version": "2.4.13",
+    "version": "2.4.14",
     "main": "./dist/jquery.inputmask.bundle.js",
     "main": "./dist/jquery.inputmask.bundle.js",
     "dependencies": {
     "dependencies": {
         "jquery": ">=1.7"
         "jquery": ">=1.7"

BIN
dist/jQuery.InputMask.2.4.13.nupkg


BIN
dist/jQuery.InputMask.2.4.14.nupkg


+ 34 - 33
dist/jquery.inputmask.bundle.js

@@ -3,13 +3,11 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2013 Robin Herbots
 * Copyright (c) 2010 - 2013 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 2.4.13
+* Version: 2.4.14
 */
 */
 
 
 (function ($) {
 (function ($) {
     if ($.fn.inputmask === undefined) {
     if ($.fn.inputmask === undefined) {
-        var opts = {};
-
         //helper functions    
         //helper functions    
         function isInputEventSupported(eventName) {
         function isInputEventSupported(eventName) {
             var el = document.createElement('input'),
             var el = document.createElement('input'),
@@ -22,17 +20,23 @@
             el = null;
             el = null;
             return isSupported;
             return isSupported;
         }
         }
-        function resolveAlias(aliasStr, options) {
+         
+        function resolveAlias(aliasStr, options, opts) {
             var aliasDefinition = opts.aliases[aliasStr];
             var aliasDefinition = opts.aliases[aliasStr];
             if (aliasDefinition) {
             if (aliasDefinition) {
-                if (aliasDefinition.alias) resolveAlias(aliasDefinition.alias); //alias is another alias
+                if (aliasDefinition.alias) resolveAlias(aliasDefinition.alias, undefined, opts); //alias is another alias
                 $.extend(true, opts, aliasDefinition);  //merge alias definition in the options
                 $.extend(true, opts, aliasDefinition);  //merge alias definition in the options
                 $.extend(true, opts, options);  //reapply extra given options
                 $.extend(true, opts, options);  //reapply extra given options
                 return true;
                 return true;
             }
             }
             return false;
             return false;
         }
         }
-        function getMaskTemplate(mask) {
+       
+      
+        function generateMaskSets(opts) {
+            var ms = [];
+            var genmasks = []; //used to keep track of the masks that where processed, to avoid duplicates
+ function getMaskTemplate(mask) {
             if (opts.numericInput) {
             if (opts.numericInput) {
                 mask = mask.split('').reverse().join('');
                 mask = mask.split('').reverse().join('');
             }
             }
@@ -49,7 +53,7 @@
                     var maskdef = opts.definitions[element];
                     var maskdef = opts.definitions[element];
                     if (maskdef && !escaped) {
                     if (maskdef && !escaped) {
                         for (var i = 0; i < maskdef.cardinality; i++) {
                         for (var i = 0; i < maskdef.cardinality; i++) {
-                            outElem.push(getPlaceHolder(outCount + i));
+                            outElem.push(opts.placeholder.charAt((outCount + i) % opts.placeholder.length));
                         }
                         }
                     } else {
                     } else {
                         outElem.push(element);
                         outElem.push(element);
@@ -68,7 +72,7 @@
 
 
             return { "mask": repeatedMask, "repeat": repeat, "greedy": greedy };
             return { "mask": repeatedMask, "repeat": repeat, "greedy": greedy };
         }
         }
-        //test definition => {fn: RegExp/function, cardinality: int, optionality: bool, newBlockMarker: bool, offset: int, casing: null/upper/lower, def: definitionSymbol}
+			  //test definition => {fn: RegExp/function, cardinality: int, optionality: bool, newBlockMarker: bool, offset: int, casing: null/upper/lower, def: definitionSymbol}
         function getTestingChain(mask) {
         function getTestingChain(mask) {
             if (opts.numericInput) {
             if (opts.numericInput) {
                 mask = mask.split('').reverse().join('');
                 mask = mask.split('').reverse().join('');
@@ -110,10 +114,6 @@
                 }
                 }
             });
             });
         }
         }
-        function generateMaskSets() {
-            var ms = [];
-            var genmasks = []; //used to keep track of the masks that where processed, to avoid duplicates
-
             function markOptional(maskPart) { //needed for the clearOptionalTail functionality
             function markOptional(maskPart) { //needed for the clearOptionalTail functionality
                 return opts.optionalmarker.start + maskPart + opts.optionalmarker.end;
                 return opts.optionalmarker.start + maskPart + opts.optionalmarker.end;
             }
             }
@@ -226,17 +226,15 @@
 
 
             return opts.greedy ? ms : ms.sort(function (a, b) { return a["mask"].length - b["mask"].length; });
             return opts.greedy ? ms : ms.sort(function (a, b) { return a["mask"].length - b["mask"].length; });
         }
         }
-        function getPlaceHolder(pos) {
-            return opts.placeholder.charAt(pos % opts.placeholder.length);
-        }
-
-
+       
+         
         var msie10 = navigator.userAgent.match(new RegExp("msie 10", "i")) !== null,
         var msie10 = navigator.userAgent.match(new RegExp("msie 10", "i")) !== null,
             iphone = navigator.userAgent.match(new RegExp("iphone", "i")) !== null,
             iphone = navigator.userAgent.match(new RegExp("iphone", "i")) !== null,
             android = navigator.userAgent.match(new RegExp("android.*safari.*", "i")) !== null,
             android = navigator.userAgent.match(new RegExp("android.*safari.*", "i")) !== null,
             androidchrome = navigator.userAgent.match(new RegExp("android.*chrome.*", "i")) !== null,
             androidchrome = navigator.userAgent.match(new RegExp("android.*chrome.*", "i")) !== null,
-            pasteEvent = isInputEventSupported('paste') && !msie10 ? 'paste' : isInputEventSupported('input') ? 'input' : "propertychange";
-
+            pasteEvent = isInputEventSupported('paste') && !msie10 ? 'paste' : isInputEventSupported('input') ? 'input' : "propertychange";   
+    
+    
         //masking scope
         //masking scope
         function maskScope(masksets, activeMasksetIndex, opts) {
         function maskScope(masksets, activeMasksetIndex, opts) {
             var isRTL = false,
             var isRTL = false,
@@ -534,6 +532,9 @@
                 var testPos = determineTestPosition(pos);
                 var testPos = determineTestPosition(pos);
                 setBufferElement(buffer, pos, getBufferElement(getActiveBufferTemplate(), testPos));
                 setBufferElement(buffer, pos, getBufferElement(getActiveBufferTemplate(), testPos));
             }
             }
+            function getPlaceHolder(pos) {
+               return opts.placeholder.charAt(pos % opts.placeholder.length);
+            }  
 
 
             function checkVal(input, writeOut, strict, nptvl, intelliCheck) {
             function checkVal(input, writeOut, strict, nptvl, intelliCheck) {
                 var inputValue = nptvl != undefined ? nptvl.slice() : truncateInput(input._valueGet()).split('');
                 var inputValue = nptvl != undefined ? nptvl.slice() : truncateInput(input._valueGet()).split('');
@@ -1472,16 +1473,16 @@
         };
         };
 
 
         $.fn.inputmask = function (fn, options) {
         $.fn.inputmask = function (fn, options) {
-            opts = $.extend(true, {}, $.inputmask.defaults, options);
-            var masksets,
+            var opts = $.extend(true, {}, $.inputmask.defaults, options), 
+            	masksets,
                 activeMasksetIndex = 0;
                 activeMasksetIndex = 0;
 
 
             if (typeof fn === "string") {
             if (typeof fn === "string") {
                 switch (fn) {
                 switch (fn) {
                     case "mask":
                     case "mask":
                         //resolve possible aliases given by options
                         //resolve possible aliases given by options
-                        resolveAlias(opts.alias, options);
-                        masksets = generateMaskSets();
+                        resolveAlias(opts.alias, options, opts);
+                        masksets = generateMaskSets(opts);
                         if (masksets.length == 0) { return this; }
                         if (masksets.length == 0) { return this; }
 
 
                         return this.each(function () {
                         return this.each(function () {
@@ -1560,12 +1561,12 @@
                         else return undefined;
                         else return undefined;
                     default:
                     default:
                         //check if the fn is an alias
                         //check if the fn is an alias
-                        if (!resolveAlias(fn, options)) {
+                        if (!resolveAlias(fn, options, opts)) {
                             //maybe fn is a mask so we try
                             //maybe fn is a mask so we try
                             //set mask
                             //set mask
                             opts.mask = fn;
                             opts.mask = fn;
                         }
                         }
-                        masksets = generateMaskSets();
+                        masksets = generateMaskSets(opts);
                         if (masksets.length == 0) { return this; }
                         if (masksets.length == 0) { return this; }
                         return this.each(function () {
                         return this.each(function () {
                             maskScope($.extend(true, {}, masksets), activeMasksetIndex, opts).mask(this);
                             maskScope($.extend(true, {}, masksets), activeMasksetIndex, opts).mask(this);
@@ -1576,8 +1577,8 @@
             } else if (typeof fn == "object") {
             } else if (typeof fn == "object") {
                 opts = $.extend(true, {}, $.inputmask.defaults, fn);
                 opts = $.extend(true, {}, $.inputmask.defaults, fn);
 
 
-                resolveAlias(opts.alias, fn); //resolve aliases
-                masksets = generateMaskSets();
+                resolveAlias(opts.alias, fn, opts); //resolve aliases
+                masksets = generateMaskSets(opts);
                 if (masksets.length == 0) { return this; }
                 if (masksets.length == 0) { return this; }
                 return this.each(function () {
                 return this.each(function () {
                     maskScope($.extend(true, {}, masksets), activeMasksetIndex, opts).mask(this);
                     maskScope($.extend(true, {}, masksets), activeMasksetIndex, opts).mask(this);
@@ -1592,7 +1593,7 @@
                             var dataoptions = $.parseJSON("{" + attrOptions + "}");
                             var dataoptions = $.parseJSON("{" + attrOptions + "}");
                             $.extend(true, dataoptions, options);
                             $.extend(true, dataoptions, options);
                             opts = $.extend(true, {}, $.inputmask.defaults, dataoptions);
                             opts = $.extend(true, {}, $.inputmask.defaults, dataoptions);
-                            resolveAlias(opts.alias, dataoptions);
+                            resolveAlias(opts.alias, dataoptions, opts);
                             opts.alias = undefined;
                             opts.alias = undefined;
                             $(this).inputmask(opts);
                             $(this).inputmask(opts);
                         } catch (ex) { } //need a more relax parseJSON
                         } catch (ex) { } //need a more relax parseJSON
@@ -1607,7 +1608,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.4.13
+Version: 2.4.14
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -1729,7 +1730,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2012 Robin Herbots
 Copyright (c) 2010 - 2012 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.4.13
+Version: 2.4.14
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2217,7 +2218,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.4.13
+Version: 2.4.14
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2394,7 +2395,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.4.13
+Version: 2.4.14
 
 
 Regex extensions on the jquery.inputmask base
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
 Allows for using regular expressions as a mask
@@ -2564,7 +2565,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.4.13
+Version: 2.4.14
 
 
 Phone extension.
 Phone extension.
 When using this extension make sure you specify the correct url to get the masks
 When using this extension make sure you specify the correct url to get the masks

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


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


+ 1 - 1
jquery.inputmask.jquery.json

@@ -8,7 +8,7 @@
 		"inputmask",
 		"inputmask",
 		"mask"
 		"mask"
     ],
     ],
-    "version": "2.4.13",
+    "version": "2.4.14",
     "author": {
     "author": {
         "name": "Robin Herbots",
         "name": "Robin Herbots",
         "url": "http://github.com/RobinHerbots/jquery.inputmask"
         "url": "http://github.com/RobinHerbots/jquery.inputmask"

+ 28 - 27
js/jquery.inputmask.js

@@ -8,8 +8,6 @@
 
 
 (function ($) {
 (function ($) {
     if ($.fn.inputmask === undefined) {
     if ($.fn.inputmask === undefined) {
-        var opts = {};
-
         //helper functions    
         //helper functions    
         function isInputEventSupported(eventName) {
         function isInputEventSupported(eventName) {
             var el = document.createElement('input'),
             var el = document.createElement('input'),
@@ -22,17 +20,23 @@
             el = null;
             el = null;
             return isSupported;
             return isSupported;
         }
         }
-        function resolveAlias(aliasStr, options) {
+         
+        function resolveAlias(aliasStr, options, opts) {
             var aliasDefinition = opts.aliases[aliasStr];
             var aliasDefinition = opts.aliases[aliasStr];
             if (aliasDefinition) {
             if (aliasDefinition) {
-                if (aliasDefinition.alias) resolveAlias(aliasDefinition.alias); //alias is another alias
+                if (aliasDefinition.alias) resolveAlias(aliasDefinition.alias, undefined, opts); //alias is another alias
                 $.extend(true, opts, aliasDefinition);  //merge alias definition in the options
                 $.extend(true, opts, aliasDefinition);  //merge alias definition in the options
                 $.extend(true, opts, options);  //reapply extra given options
                 $.extend(true, opts, options);  //reapply extra given options
                 return true;
                 return true;
             }
             }
             return false;
             return false;
         }
         }
-        function getMaskTemplate(mask) {
+       
+      
+        function generateMaskSets(opts) {
+            var ms = [];
+            var genmasks = []; //used to keep track of the masks that where processed, to avoid duplicates
+ function getMaskTemplate(mask) {
             if (opts.numericInput) {
             if (opts.numericInput) {
                 mask = mask.split('').reverse().join('');
                 mask = mask.split('').reverse().join('');
             }
             }
@@ -49,7 +53,7 @@
                     var maskdef = opts.definitions[element];
                     var maskdef = opts.definitions[element];
                     if (maskdef && !escaped) {
                     if (maskdef && !escaped) {
                         for (var i = 0; i < maskdef.cardinality; i++) {
                         for (var i = 0; i < maskdef.cardinality; i++) {
-                            outElem.push(getPlaceHolder(outCount + i));
+                            outElem.push(opts.placeholder.charAt((outCount + i) % opts.placeholder.length));
                         }
                         }
                     } else {
                     } else {
                         outElem.push(element);
                         outElem.push(element);
@@ -68,7 +72,7 @@
 
 
             return { "mask": repeatedMask, "repeat": repeat, "greedy": greedy };
             return { "mask": repeatedMask, "repeat": repeat, "greedy": greedy };
         }
         }
-        //test definition => {fn: RegExp/function, cardinality: int, optionality: bool, newBlockMarker: bool, offset: int, casing: null/upper/lower, def: definitionSymbol}
+			  //test definition => {fn: RegExp/function, cardinality: int, optionality: bool, newBlockMarker: bool, offset: int, casing: null/upper/lower, def: definitionSymbol}
         function getTestingChain(mask) {
         function getTestingChain(mask) {
             if (opts.numericInput) {
             if (opts.numericInput) {
                 mask = mask.split('').reverse().join('');
                 mask = mask.split('').reverse().join('');
@@ -110,10 +114,6 @@
                 }
                 }
             });
             });
         }
         }
-        function generateMaskSets() {
-            var ms = [];
-            var genmasks = []; //used to keep track of the masks that where processed, to avoid duplicates
-
             function markOptional(maskPart) { //needed for the clearOptionalTail functionality
             function markOptional(maskPart) { //needed for the clearOptionalTail functionality
                 return opts.optionalmarker.start + maskPart + opts.optionalmarker.end;
                 return opts.optionalmarker.start + maskPart + opts.optionalmarker.end;
             }
             }
@@ -226,17 +226,15 @@
 
 
             return opts.greedy ? ms : ms.sort(function (a, b) { return a["mask"].length - b["mask"].length; });
             return opts.greedy ? ms : ms.sort(function (a, b) { return a["mask"].length - b["mask"].length; });
         }
         }
-        function getPlaceHolder(pos) {
-            return opts.placeholder.charAt(pos % opts.placeholder.length);
-        }
-
-
+       
+         
         var msie10 = navigator.userAgent.match(new RegExp("msie 10", "i")) !== null,
         var msie10 = navigator.userAgent.match(new RegExp("msie 10", "i")) !== null,
             iphone = navigator.userAgent.match(new RegExp("iphone", "i")) !== null,
             iphone = navigator.userAgent.match(new RegExp("iphone", "i")) !== null,
             android = navigator.userAgent.match(new RegExp("android.*safari.*", "i")) !== null,
             android = navigator.userAgent.match(new RegExp("android.*safari.*", "i")) !== null,
             androidchrome = navigator.userAgent.match(new RegExp("android.*chrome.*", "i")) !== null,
             androidchrome = navigator.userAgent.match(new RegExp("android.*chrome.*", "i")) !== null,
-            pasteEvent = isInputEventSupported('paste') && !msie10 ? 'paste' : isInputEventSupported('input') ? 'input' : "propertychange";
-
+            pasteEvent = isInputEventSupported('paste') && !msie10 ? 'paste' : isInputEventSupported('input') ? 'input' : "propertychange";   
+    
+    
         //masking scope
         //masking scope
         function maskScope(masksets, activeMasksetIndex, opts) {
         function maskScope(masksets, activeMasksetIndex, opts) {
             var isRTL = false,
             var isRTL = false,
@@ -534,6 +532,9 @@
                 var testPos = determineTestPosition(pos);
                 var testPos = determineTestPosition(pos);
                 setBufferElement(buffer, pos, getBufferElement(getActiveBufferTemplate(), testPos));
                 setBufferElement(buffer, pos, getBufferElement(getActiveBufferTemplate(), testPos));
             }
             }
+            function getPlaceHolder(pos) {
+               return opts.placeholder.charAt(pos % opts.placeholder.length);
+            }  
 
 
             function checkVal(input, writeOut, strict, nptvl, intelliCheck) {
             function checkVal(input, writeOut, strict, nptvl, intelliCheck) {
                 var inputValue = nptvl != undefined ? nptvl.slice() : truncateInput(input._valueGet()).split('');
                 var inputValue = nptvl != undefined ? nptvl.slice() : truncateInput(input._valueGet()).split('');
@@ -1472,16 +1473,16 @@
         };
         };
 
 
         $.fn.inputmask = function (fn, options) {
         $.fn.inputmask = function (fn, options) {
-            opts = $.extend(true, {}, $.inputmask.defaults, options);
-            var masksets,
+            var opts = $.extend(true, {}, $.inputmask.defaults, options), 
+            	masksets,
                 activeMasksetIndex = 0;
                 activeMasksetIndex = 0;
 
 
             if (typeof fn === "string") {
             if (typeof fn === "string") {
                 switch (fn) {
                 switch (fn) {
                     case "mask":
                     case "mask":
                         //resolve possible aliases given by options
                         //resolve possible aliases given by options
-                        resolveAlias(opts.alias, options);
-                        masksets = generateMaskSets();
+                        resolveAlias(opts.alias, options, opts);
+                        masksets = generateMaskSets(opts);
                         if (masksets.length == 0) { return this; }
                         if (masksets.length == 0) { return this; }
 
 
                         return this.each(function () {
                         return this.each(function () {
@@ -1560,12 +1561,12 @@
                         else return undefined;
                         else return undefined;
                     default:
                     default:
                         //check if the fn is an alias
                         //check if the fn is an alias
-                        if (!resolveAlias(fn, options)) {
+                        if (!resolveAlias(fn, options, opts)) {
                             //maybe fn is a mask so we try
                             //maybe fn is a mask so we try
                             //set mask
                             //set mask
                             opts.mask = fn;
                             opts.mask = fn;
                         }
                         }
-                        masksets = generateMaskSets();
+                        masksets = generateMaskSets(opts);
                         if (masksets.length == 0) { return this; }
                         if (masksets.length == 0) { return this; }
                         return this.each(function () {
                         return this.each(function () {
                             maskScope($.extend(true, {}, masksets), activeMasksetIndex, opts).mask(this);
                             maskScope($.extend(true, {}, masksets), activeMasksetIndex, opts).mask(this);
@@ -1576,8 +1577,8 @@
             } else if (typeof fn == "object") {
             } else if (typeof fn == "object") {
                 opts = $.extend(true, {}, $.inputmask.defaults, fn);
                 opts = $.extend(true, {}, $.inputmask.defaults, fn);
 
 
-                resolveAlias(opts.alias, fn); //resolve aliases
-                masksets = generateMaskSets();
+                resolveAlias(opts.alias, fn, opts); //resolve aliases
+                masksets = generateMaskSets(opts);
                 if (masksets.length == 0) { return this; }
                 if (masksets.length == 0) { return this; }
                 return this.each(function () {
                 return this.each(function () {
                     maskScope($.extend(true, {}, masksets), activeMasksetIndex, opts).mask(this);
                     maskScope($.extend(true, {}, masksets), activeMasksetIndex, opts).mask(this);
@@ -1592,7 +1593,7 @@
                             var dataoptions = $.parseJSON("{" + attrOptions + "}");
                             var dataoptions = $.parseJSON("{" + attrOptions + "}");
                             $.extend(true, dataoptions, options);
                             $.extend(true, dataoptions, options);
                             opts = $.extend(true, {}, $.inputmask.defaults, dataoptions);
                             opts = $.extend(true, {}, $.inputmask.defaults, dataoptions);
-                            resolveAlias(opts.alias, dataoptions);
+                            resolveAlias(opts.alias, dataoptions, opts);
                             opts.alias = undefined;
                             opts.alias = undefined;
                             $(this).inputmask(opts);
                             $(this).inputmask(opts);
                         } catch (ex) { } //need a more relax parseJSON
                         } catch (ex) { } //need a more relax parseJSON

+ 19 - 0
qunit/tests.js

@@ -1215,6 +1215,25 @@ test("inputmask(\"decimal\") - value=\"123.45\" Replace last integer", function
     $("#testmask").remove();
     $("#testmask").remove();
 });
 });
 
 
+test("inputmask - Multiple inputs masked, Integer mask doesn't allow typing - #402 - albatrocity", function () {
+    $('body').append('<input type="text" id="testmask" />');
+    $('body').append('<input type="text" id="testmask2" />');
+    $("#testmask").inputmask("integer", {
+        autoGroup: true,
+        groupSeparator: ",",
+        groupSize: 3
+    });
+    $("#testmask2").inputmask("(999)-999-9999");
+
+
+    $("#testmask")[0].focus();
+    $("#testmask").Type("12345");
+	
+    equal($("#testmask").val(), "12,345", "Result " + $("#testmask").val());
+    $("#testmask").remove();
+    $("#testmask2").remove();
+});
+
 module("Direction RTL");
 module("Direction RTL");
 test("inputmask(\"999.999.999\") - delete 2nd with backspace, continue the mask", function () {
 test("inputmask(\"999.999.999\") - delete 2nd with backspace, continue the mask", function () {
     $('body').append('<input type="text" id="testmask" dir="rtl" />');
     $('body').append('<input type="text" id="testmask" dir="rtl" />');

File diff suppressed because it is too large
+ 1791 - 0
qunit/tests.js~