浏览代码

$.inputmask.isValid returns undefined for integer and decimal aliases #449

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

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
     "name": "jquery.inputmask",
-    "version": "3.0.47",
+    "version": "3.0.48",
     "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 = 3
 build.minor = 0
-build.revision = 47
+build.revision = 48
 
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js

+ 12 - 8
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: 3.0.47
+* Version: 3.0.48
 */
 
 (function ($) {
@@ -1721,7 +1721,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: 3.0.47
+* Version: 3.0.48
 */
 
 (function ($) {
@@ -2084,7 +2084,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: 3.0.47
+Version: 3.0.48
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2205,7 +2205,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: 3.0.47
+Version: 3.0.48
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2668,7 +2668,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: 3.0.47
+Version: 3.0.48
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2862,7 +2862,11 @@ Optional extensions on the jquery.inputmask base
                 return Number(processValue);
             },
             isComplete: function (buffer, opts) {
-                var maskedValue = buffer.join('');
+                var maskedValue = buffer.join(''), bufClone = buffer.slice();
+                //verify separator positions
+                opts.postFormat(bufClone, 0, true, opts);
+                if (bufClone.join('') != maskedValue) return false;
+
                 var processValue = maskedValue.replace(opts.prefix, "");
                 processValue = processValue.replace(opts.suffix, "");
                 processValue = processValue.replace(new RegExp(opts.groupSeparator, "g"), "");
@@ -2887,7 +2891,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: 3.0.47
+Version: 3.0.48
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
@@ -3074,7 +3078,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: 3.0.47
+Version: 3.0.48
 
 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-multi.js


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


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


+ 1 - 1
jquery.inputmask.jquery.json

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

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

@@ -197,7 +197,11 @@ Optional extensions on the jquery.inputmask base
                 return Number(processValue);
             },
             isComplete: function (buffer, opts) {
-                var maskedValue = buffer.join('');
+                var maskedValue = buffer.join(''), bufClone = buffer.slice();
+                //verify separator positions
+                opts.postFormat(bufClone, 0, true, opts);
+                if (bufClone.join('') != maskedValue) return false;
+
                 var processValue = maskedValue.replace(opts.prefix, "");
                 processValue = processValue.replace(opts.suffix, "");
                 processValue = processValue.replace(new RegExp(opts.groupSeparator, "g"), "");