Robin Herbots 12 年之前
父节点
当前提交
46d6ca75f3

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
     "name": "jquery.inputmask",
-    "version": "2.5.3",
+    "version": "2.5.4",
     "main": "./dist/jquery.inputmask.bundle.js",
 	"keywords" : ["jQuery", "plugins", "input", "form", "inputmask", "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 = 2
 build.minor = 5
-build.revision = 3
+build.revision = 4
 
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js

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


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

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 2.5.3
+* Version: 2.5.4
 */
 
 (function ($) {
@@ -1699,7 +1699,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.5.3
+Version: 2.5.4
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1821,7 +1821,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.5.3
+Version: 2.5.4
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2309,7 +2309,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.5.3
+Version: 2.5.4
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2462,7 +2462,7 @@ Optional extensions on the jquery.inputmask base
                         }
 
                         if (isValid != false && !strict && chrs != opts.radixPoint) {
-                            var newPos = opts.postFormat(buffer, pos, false, opts);
+                            var newPos = opts.postFormat(buffer, pos, (chrs == "-" || chrs == "+") ? true : false, opts);
                             return { "pos": newPos };
                         }
 
@@ -2492,7 +2492,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.5.3
+Version: 2.5.4
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
@@ -2676,7 +2676,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.5.3
+Version: 2.5.4
 
 Phone extension.
 When using this extension make sure you specify the correct url to get the masks

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


文件差异内容过多而无法显示
+ 1 - 1
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",
 		"mask"
     ],
-    "version": "2.5.3",
+    "version": "2.5.4",
     "author": {
         "name": "Robin Herbots",
         "url": "http://github.com/RobinHerbots/jquery.inputmask"

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

@@ -156,7 +156,7 @@ Optional extensions on the jquery.inputmask base
                         }
 
                         if (isValid != false && !strict && chrs != opts.radixPoint) {
-                            var newPos = opts.postFormat(buffer, pos, false, opts);
+                            var newPos = opts.postFormat(buffer, pos, (chrs == "-" || chrs == "+") ? true : false, opts);
                             return { "pos": newPos };
                         }
 

+ 40 - 0
qunit/tests.js

@@ -1284,6 +1284,46 @@ test("decimal alias with groupseparator backspace - YoussefTaghlabi", function (
     $("#testmask").remove();
 });
 
+test("decimal alias with plus or minus & autogroup - YoussefTaghlabi", function () {
+    $('body').append('<input type="text" id="testmask" />');
+    $("#testmask").inputmask("decimal", { 
+                radixPoint: ".", 
+                groupSeparator: ",",
+                groupSize: 3,
+                digits: 2,
+                autoGroup: true,
+                allowPlus: true,
+                allowMinus: true
+            });
+
+    $("#testmask")[0].focus();
+    $("#testmask").Type("-123456");
+    
+    equal($("#testmask").val(), "-123,456", "Result " + $("#testmask").val());
+    $("#testmask").remove();
+});
+
+test("decimal alias with plus or minus & autogroup - YoussefTaghlabi", function () {
+    $('body').append('<input type="text" id="testmask" />');
+    $("#testmask").inputmask("decimal", { 
+                radixPoint: ".", 
+                groupSeparator: ",",
+                groupSize: 3,
+                digits: 2,
+                autoGroup: true,
+                allowPlus: true,
+                allowMinus: true
+            });
+
+    $("#testmask")[0].focus();
+    $("#testmask").Type("123456");
+	caret($("#testmask"), 0);
+	$("#testmask").SendKey("-");
+    
+    equal($("#testmask").val(), "-123,456", "Result " + $("#testmask").val());
+    $("#testmask").remove();
+});
+
 module("Direction RTL");
 test("inputmask(\"999.999.999\") - delete 2nd with backspace, continue the mask", function () {
     $('body').append('<input type="text" id="testmask" dir="rtl" />');