浏览代码

optimize negation in numeric alias

Robin Herbots 11 年之前
父节点
当前提交
51ce9ad9c8

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
 {
     "name": "jquery.inputmask",
     "name": "jquery.inputmask",
-    "version": "3.0.8",
+    "version": "3.0.10",
     "main": "./dist/jquery.inputmask.bundle.js",
     "main": "./dist/jquery.inputmask.bundle.js",
 	"keywords" : ["jQuery", "plugins", "input", "form", "inputmask", "mask"],
 	"keywords" : ["jQuery", "plugins", "input", "form", "inputmask", "mask"],
 	"description": "jquery.inputmask is a jquery plugin which create an input mask.",
 	"description": "jquery.inputmask is a jquery plugin which create an input mask.",

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 
 build.major = 3
 build.major = 3
 build.minor = 0
 build.minor = 0
-build.revision = 8
+build.revision = 10
 
 
 target = jquery.inputmask.bundle.js
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js
 target.min = jquery.inputmask.bundle.min.js

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


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


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


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

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Copyright (c) 2010 - 2014 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: 3.0.8
+* Version: 3.0.10
 */
 */
 
 
 (function ($) {
 (function ($) {
@@ -1032,7 +1032,7 @@
                                 c = valResult.c != undefined ? valResult.c : c; //set new char from isValid
                                 c = valResult.c != undefined ? valResult.c : c; //set new char from isValid
                             }
                             }
                             resetMaskSet(true);
                             resetMaskSet(true);
-                            forwardPosition = seekNext(p);
+                            forwardPosition = valResult.caret != undefined ? valResult.caret : seekNext(p);
                             getMaskSet()["p"] = forwardPosition; //needed for checkval
                             getMaskSet()["p"] = forwardPosition; //needed for checkval
                         }
                         }
 
 
@@ -1837,7 +1837,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 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: 3.0.8
+Version: 3.0.10
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -1947,7 +1947,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 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: 3.0.8
+Version: 3.0.10
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2410,7 +2410,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 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: 3.0.8
+Version: 3.0.10
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2482,12 +2482,12 @@ Optional extensions on the jquery.inputmask base
                             if (matchRslt.length > 0) {
                             if (matchRslt.length > 0) {
                                 if (buffer[matchRslt.index] == "+") {
                                 if (buffer[matchRslt.index] == "+") {
                                     buffer.splice(matchRslt.index, 1);
                                     buffer.splice(matchRslt.index, 1);
-                                    return { "pos": matchRslt.index, "c": "-", "refreshFromBuffer": true };
+                                    return { "pos": matchRslt.index, "c": "-", "refreshFromBuffer": true, "caret": pos };
                                 } else if (buffer[matchRslt.index] == "-") {
                                 } else if (buffer[matchRslt.index] == "-") {
                                     buffer.splice(matchRslt.index, 1);
                                     buffer.splice(matchRslt.index, 1);
-                                    return { "refreshFromBuffer": true };
+                                    return { "refreshFromBuffer": true, "caret": pos - 1 };
                                 } else {
                                 } else {
-                                    return { "pos": matchRslt.index, "c": "-" };
+                                    return { "pos": matchRslt.index, "c": "-", "caret": pos + 1 };
                                 }
                                 }
                             }
                             }
                         }
                         }
@@ -2673,7 +2673,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 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: 3.0.8
+Version: 3.0.10
 
 
 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
@@ -2860,7 +2860,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 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: 3.0.8
+Version: 3.0.10
 
 
 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

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


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


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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 1 - 1
js/jquery.inputmask.js

@@ -1032,7 +1032,7 @@
                                 c = valResult.c != undefined ? valResult.c : c; //set new char from isValid
                                 c = valResult.c != undefined ? valResult.c : c; //set new char from isValid
                             }
                             }
                             resetMaskSet(true);
                             resetMaskSet(true);
-                            forwardPosition = seekNext(p);
+                            forwardPosition = valResult.caret != undefined ? valResult.caret : seekNext(p);
                             getMaskSet()["p"] = forwardPosition; //needed for checkval
                             getMaskSet()["p"] = forwardPosition; //needed for checkval
                         }
                         }
 
 

+ 3 - 3
js/jquery.inputmask.numeric.extensions.js

@@ -75,12 +75,12 @@ Optional extensions on the jquery.inputmask base
                             if (matchRslt.length > 0) {
                             if (matchRslt.length > 0) {
                                 if (buffer[matchRslt.index] == "+") {
                                 if (buffer[matchRslt.index] == "+") {
                                     buffer.splice(matchRslt.index, 1);
                                     buffer.splice(matchRslt.index, 1);
-                                    return { "pos": matchRslt.index, "c": "-", "refreshFromBuffer": true };
+                                    return { "pos": matchRslt.index, "c": "-", "refreshFromBuffer": true, "caret": pos };
                                 } else if (buffer[matchRslt.index] == "-") {
                                 } else if (buffer[matchRslt.index] == "-") {
                                     buffer.splice(matchRslt.index, 1);
                                     buffer.splice(matchRslt.index, 1);
-                                    return { "refreshFromBuffer": true };
+                                    return { "refreshFromBuffer": true, "caret": pos - 1 };
                                 } else {
                                 } else {
-                                    return { "pos": matchRslt.index, "c": "-" };
+                                    return { "pos": matchRslt.index, "c": "-", "caret": pos + 1 };
                                 }
                                 }
                             }
                             }
                         }
                         }