Robin Herbots 12 years ago
parent
commit
7f77ea63a4

+ 1 - 1
build.properties

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

BIN
dist/jQuery.InputMask.2.3.53.nupkg


BIN
dist/jQuery.InputMask.2.3.54.nupkg


+ 10 - 9
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.53
+* Version: 2.3.54
 */
 
 (function ($) {
@@ -1454,6 +1454,7 @@
                             caret(input, 0, e.shiftKey ? pos.begin : 0);
                         } else if (k == opts.keyCode.ESCAPE) { //escape
                             checkVal(input, true, true, valueOnFocus);
+                            $input.click();
                         } else if (k == opts.keyCode.INSERT && !(e.shiftKey || e.ctrlKey)) { //insert
                             opts.insertMode = !opts.insertMode;
                             caret(input, !opts.insertMode && pos.begin == getMaskLength() ? pos.begin - 1 : pos.begin);
@@ -1680,7 +1681,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.53
+Version: 2.3.54
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1782,7 +1783,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.53
+Version: 2.3.54
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2266,7 +2267,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.53
+Version: 2.3.54
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2351,7 +2352,7 @@ Optional extensions on the jquery.inputmask base
                         var masksets = $input.data('_inputmask')['masksets'];
                         var activeMasksetIndex = $input.data('_inputmask')['activeMasksetIndex'];
                         for (var i = 1; i <= opts.digits && i < opts.getMaskLength(masksets[activeMasksetIndex]["_buffer"], masksets[activeMasksetIndex]["greedy"], masksets[activeMasksetIndex]["repeat"], buffer, opts) ; i++) {
-                            if (buffer[radixPosition + i] == undefined) buffer[radixPosition + i] = "0";
+                            if (buffer[radixPosition + i] == undefined || buffer[radixPosition + i] == "") buffer[radixPosition + i] = "0";
                         }
                         input._valueSet(buffer.join(''));
                     }
@@ -2377,7 +2378,7 @@ Optional extensions on the jquery.inputmask base
                         //strip groupseparator
                         var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
                         bufferStr = bufferStr.replace(new RegExp(escapedGroupSeparator, "g"), '');
-                        
+
                         var isValid = opts.regex.number(opts).test(bufferStr);
                         if (!isValid) {
                             //let's help the regex a bit
@@ -2435,7 +2436,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.53
+Version: 2.3.54
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
@@ -2605,9 +2606,9 @@ 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.53
+Version: 2.3.54
 
-Phone extension based on https://github.com/andr-04/inputmask-multi
+Phone extension.
 When using this extension make sure you specify the correct url to get the masks
 
  $(selector).inputmask("phone", {

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


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


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


+ 1 - 0
js/jquery.inputmask.js

@@ -1454,6 +1454,7 @@
                             caret(input, 0, e.shiftKey ? pos.begin : 0);
                         } else if (k == opts.keyCode.ESCAPE) { //escape
                             checkVal(input, true, true, valueOnFocus);
+                            $input.click();
                         } else if (k == opts.keyCode.INSERT && !(e.shiftKey || e.ctrlKey)) { //insert
                             opts.insertMode = !opts.insertMode;
                             caret(input, !opts.insertMode && pos.begin == getMaskLength() ? pos.begin - 1 : pos.begin);

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

@@ -88,7 +88,7 @@ Optional extensions on the jquery.inputmask base
                         var masksets = $input.data('_inputmask')['masksets'];
                         var activeMasksetIndex = $input.data('_inputmask')['activeMasksetIndex'];
                         for (var i = 1; i <= opts.digits && i < opts.getMaskLength(masksets[activeMasksetIndex]["_buffer"], masksets[activeMasksetIndex]["greedy"], masksets[activeMasksetIndex]["repeat"], buffer, opts) ; i++) {
-                            if (buffer[radixPosition + i] == undefined) buffer[radixPosition + i] = "0";
+                            if (buffer[radixPosition + i] == undefined || buffer[radixPosition + i] == "") buffer[radixPosition + i] = "0";
                         }
                         input._valueSet(buffer.join(''));
                     }
@@ -114,7 +114,7 @@ Optional extensions on the jquery.inputmask base
                         //strip groupseparator
                         var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
                         bufferStr = bufferStr.replace(new RegExp(escapedGroupSeparator, "g"), '');
-                        
+
                         var isValid = opts.regex.number(opts).test(bufferStr);
                         if (!isValid) {
                             //let's help the regex a bit

+ 14 - 2
qunit/tests.js

@@ -1053,6 +1053,18 @@ test("inputmask(\"decimal\") - value=\"1234567890\"", function () {
     $("#testmask").remove();
 });
 
+test("inputmask(\"decimal\") - value=\"123.1\" tab out", function () {
+    $('body').append('<input type="text" id="testmask" />');
+    $("#testmask").inputmask("decimal", { digits: 3 });
+
+    $("#testmask")[0].focus();
+    $("#testmask").Type("123.1");
+    $("#testmask").SendKey(keyCodes.TAB);
+
+    equal($("#testmask").val(), "123.100", "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" />');
@@ -1225,7 +1237,7 @@ asyncTest("inputmask({ mask: \"€ 999.999.999,99\", { numericInput: true, radix
     $("#testmask").click();
     setTimeout(function () {
         $("#testmask").Type("123");
-        
+
         equal($("#testmask").val(), "€ ___.___.123,__", "Result " + $("#testmask").val());
         start();
         $("#testmask").remove();
@@ -1239,7 +1251,7 @@ asyncTest("inputmask({ mask: \"€ 999.999.999,99\", { numericInput: true, radix
     $("#testmask").click();
     setTimeout(function () {
         $("#testmask").Type("123,45");
-        
+
         equal($("#testmask").val(), "€ ___.___.123,45", "Result " + $("#testmask").val());
         start();
         $("#testmask").remove();