Robin Herbots 12 年之前
父节点
当前提交
4bc2eb7a56

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 build.major = 2
 build.minor = 3
-build.revision = 19
+build.revision = 20
 
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js

+ 1 - 1
component.json

@@ -1,6 +1,6 @@
 {
     "name": "jquery.inputmask",
-    "version": "2.3.19",
+    "version": "2.3.20",
     "main": "./dist/jquery.inputmask.bundle.js",
     "dependencies": {
         "jquery": ">=1.5"

二进制
dist/jQuery.InputMask.2.3.19.nupkg


二进制
dist/jQuery.InputMask.2.3.20.nupkg


+ 6 - 6
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2013 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 2.3.19
+* Version: 2.3.20
 */
 
 (function ($) {
@@ -541,7 +541,7 @@
                             activeMasksetIndex = index;
 
                             var maskPos = pos;
-                            if (currentActiveMasksetIndex != activeMasksetIndex && !isMask(pos)) {
+                            if (currentActiveMasksetIndex != activeMasksetIndex && !isMask(maskPos) && getActiveMaskSet()["lastValidPosition"] == seekPrevious(maskPos)) {
                                 if (c == getActiveBufferTemplate()[maskPos] || c == opts.skipOptionalPartCharacter) { //match non-mask item
                                     results.push({ "activeMasksetIndex": index, "result": { "refresh": true, c: getActiveBufferTemplate()[maskPos] } }); //new command hack only rewrite buffer
                                     getActiveMaskSet()['lastValidPosition'] = maskPos;
@@ -1560,7 +1560,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.19
+Version: 2.3.20
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1662,7 +1662,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2012 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.19
+Version: 2.3.20
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2139,7 +2139,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.19
+Version: 2.3.20
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2308,7 +2308,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.19
+Version: 2.3.20
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask

文件差异内容过多而无法显示
+ 29 - 29
dist/jquery.inputmask.bundle.min.js


文件差异内容过多而无法显示
+ 43 - 43
dist/min/jquery.inputmask.js


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 1 - 1
js/jquery.inputmask.js

@@ -541,7 +541,7 @@
                             activeMasksetIndex = index;
 
                             var maskPos = pos;
-                            if (currentActiveMasksetIndex != activeMasksetIndex && !isMask(pos)) {
+                            if (currentActiveMasksetIndex != activeMasksetIndex && !isMask(maskPos) && getActiveMaskSet()["lastValidPosition"] == seekPrevious(maskPos)) {
                                 if (c == getActiveBufferTemplate()[maskPos] || c == opts.skipOptionalPartCharacter) { //match non-mask item
                                     results.push({ "activeMasksetIndex": index, "result": { "refresh": true, c: getActiveBufferTemplate()[maskPos] } }); //new command hack only rewrite buffer
                                     getActiveMaskSet()['lastValidPosition'] = maskPos;

+ 13 - 0
qunit/tests.js

@@ -567,6 +567,19 @@ test("inputmask({ mask: [\"99999\", \"99999-9999\", \"999999-9999\"]]}) - input
     $("#testmask").remove();
 });
 
+test("inputmask(\"9[9][9] 999[9] 9999\") - input 123123 space 1234 - vipink70", function () {
+    $('body').append('<input type="text" id="testmask" />');
+    $("#testmask").inputmask("9[9][9] 999[9] 9999");
+
+    $("#testmask")[0].focus();
+    $("#testmask").Type("123123");
+    $("#testmask").SendKey(keyCodes.SPACE);
+    $("#testmask").Type("1234");
+    equal($("#testmask").val(), "123 123 1234", "Result " + $("#testmask").val());
+
+    $("#testmask").remove();
+});
+
 module("Date.Extensions");
 test("inputmask(\"dd/mm/yyyy\") - input 2331973", function () {
     $('body').append('<input type="text" id="testmask" />');