Robin Herbots 12 年 前
コミット
7f77ea63a4

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 
 build.major = 2
 build.major = 2
 build.minor = 3
 build.minor = 3
-build.revision = 53
+build.revision = 54
 
 
 target = jquery.inputmask.bundle.js
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.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
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2013 Robin Herbots
 * Copyright (c) 2010 - 2013 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: 2.3.53
+* Version: 2.3.54
 */
 */
 
 
 (function ($) {
 (function ($) {
@@ -1454,6 +1454,7 @@
                             caret(input, 0, e.shiftKey ? pos.begin : 0);
                             caret(input, 0, e.shiftKey ? pos.begin : 0);
                         } else if (k == opts.keyCode.ESCAPE) { //escape
                         } else if (k == opts.keyCode.ESCAPE) { //escape
                             checkVal(input, true, true, valueOnFocus);
                             checkVal(input, true, true, valueOnFocus);
+                            $input.click();
                         } else if (k == opts.keyCode.INSERT && !(e.shiftKey || e.ctrlKey)) { //insert
                         } else if (k == opts.keyCode.INSERT && !(e.shiftKey || e.ctrlKey)) { //insert
                             opts.insertMode = !opts.insertMode;
                             opts.insertMode = !opts.insertMode;
                             caret(input, !opts.insertMode && pos.begin == getMaskLength() ? pos.begin - 1 : pos.begin);
                             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
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 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: 2.3.53
+Version: 2.3.54
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -1782,7 +1783,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2012 Robin Herbots
 Copyright (c) 2010 - 2012 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: 2.3.53
+Version: 2.3.54
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2266,7 +2267,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 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: 2.3.53
+Version: 2.3.54
 
 
 Optional extensions on the jquery.inputmask base
 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 masksets = $input.data('_inputmask')['masksets'];
                         var activeMasksetIndex = $input.data('_inputmask')['activeMasksetIndex'];
                         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++) {
                         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(''));
                         input._valueSet(buffer.join(''));
                     }
                     }
@@ -2377,7 +2378,7 @@ Optional extensions on the jquery.inputmask base
                         //strip groupseparator
                         //strip groupseparator
                         var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
                         var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
                         bufferStr = bufferStr.replace(new RegExp(escapedGroupSeparator, "g"), '');
                         bufferStr = bufferStr.replace(new RegExp(escapedGroupSeparator, "g"), '');
-                        
+
                         var isValid = opts.regex.number(opts).test(bufferStr);
                         var isValid = opts.regex.number(opts).test(bufferStr);
                         if (!isValid) {
                         if (!isValid) {
                             //let's help the regex a bit
                             //let's help the regex a bit
@@ -2435,7 +2436,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 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: 2.3.53
+Version: 2.3.54
 
 
 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
@@ -2605,9 +2606,9 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 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: 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
 When using this extension make sure you specify the correct url to get the masks
 
 
  $(selector).inputmask("phone", {
  $(selector).inputmask("phone", {

ファイルの差分が大きいため隠しています
+ 64 - 64
dist/jquery.inputmask.bundle.min.js


ファイルの差分が大きいため隠しています
+ 4 - 4
dist/min/jquery.inputmask.js


ファイルの差分が大きいため隠しています
+ 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);
                             caret(input, 0, e.shiftKey ? pos.begin : 0);
                         } else if (k == opts.keyCode.ESCAPE) { //escape
                         } else if (k == opts.keyCode.ESCAPE) { //escape
                             checkVal(input, true, true, valueOnFocus);
                             checkVal(input, true, true, valueOnFocus);
+                            $input.click();
                         } else if (k == opts.keyCode.INSERT && !(e.shiftKey || e.ctrlKey)) { //insert
                         } else if (k == opts.keyCode.INSERT && !(e.shiftKey || e.ctrlKey)) { //insert
                             opts.insertMode = !opts.insertMode;
                             opts.insertMode = !opts.insertMode;
                             caret(input, !opts.insertMode && pos.begin == getMaskLength() ? pos.begin - 1 : pos.begin);
                             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 masksets = $input.data('_inputmask')['masksets'];
                         var activeMasksetIndex = $input.data('_inputmask')['activeMasksetIndex'];
                         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++) {
                         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(''));
                         input._valueSet(buffer.join(''));
                     }
                     }
@@ -114,7 +114,7 @@ Optional extensions on the jquery.inputmask base
                         //strip groupseparator
                         //strip groupseparator
                         var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
                         var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
                         bufferStr = bufferStr.replace(new RegExp(escapedGroupSeparator, "g"), '');
                         bufferStr = bufferStr.replace(new RegExp(escapedGroupSeparator, "g"), '');
-                        
+
                         var isValid = opts.regex.number(opts).test(bufferStr);
                         var isValid = opts.regex.number(opts).test(bufferStr);
                         if (!isValid) {
                         if (!isValid) {
                             //let's help the regex a bit
                             //let's help the regex a bit

+ 14 - 2
qunit/tests.js

@@ -1053,6 +1053,18 @@ test("inputmask(\"decimal\") - value=\"1234567890\"", function () {
     $("#testmask").remove();
     $("#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");
 module("Direction RTL");
 test("inputmask(\"999.999.999\") - delete 2nd with backspace, continue the mask", function () {
 test("inputmask(\"999.999.999\") - delete 2nd with backspace, continue the mask", function () {
     $('body').append('<input type="text" id="testmask" dir="rtl" />');
     $('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();
     $("#testmask").click();
     setTimeout(function () {
     setTimeout(function () {
         $("#testmask").Type("123");
         $("#testmask").Type("123");
-        
+
         equal($("#testmask").val(), "€ ___.___.123,__", "Result " + $("#testmask").val());
         equal($("#testmask").val(), "€ ___.___.123,__", "Result " + $("#testmask").val());
         start();
         start();
         $("#testmask").remove();
         $("#testmask").remove();
@@ -1239,7 +1251,7 @@ asyncTest("inputmask({ mask: \"€ 999.999.999,99\", { numericInput: true, radix
     $("#testmask").click();
     $("#testmask").click();
     setTimeout(function () {
     setTimeout(function () {
         $("#testmask").Type("123,45");
         $("#testmask").Type("123,45");
-        
+
         equal($("#testmask").val(), "€ ___.___.123,45", "Result " + $("#testmask").val());
         equal($("#testmask").val(), "€ ___.___.123,45", "Result " + $("#testmask").val());
         start();
         start();
         $("#testmask").remove();
         $("#testmask").remove();