Skip to content

Commit

Permalink
another fix for wusam
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinHerbots committed Mar 6, 2014
1 parent 3726d96 commit 9c2f45a
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 67 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "jquery.inputmask",
"version": "2.5.1",
"version": "2.5.2",
"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.",
Expand Down
2 changes: 1 addition & 1 deletion build.properties
Expand Up @@ -7,7 +7,7 @@ distdir = dist

build.major = 2
build.minor = 5
build.revision = 1
build.revision = 2

target = jquery.inputmask.bundle.js
target.min = jquery.inputmask.bundle.min.js
Expand Down
Binary file removed dist/jQuery.InputMask.2.5.1.nupkg
Binary file not shown.
Binary file added dist/jQuery.InputMask.2.5.2.nupkg
Binary file not shown.
14 changes: 7 additions & 7 deletions dist/jquery.inputmask.bundle.js
Expand Up @@ -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.1
* Version: 2.5.2
*/

(function ($) {
Expand Down Expand Up @@ -905,7 +905,7 @@
clearBuffer(getActiveBuffer(), pos.begin, pos.end);

var ml = getMaskLength();
if (opts.greedy == false) {
if (opts.greedy == false && (isNaN(opts.repeat) || opts.repeat > 0)) {
shiftL(pos.begin, ml, undefined, !isRTL && (k == opts.keyCode.BACKSPACE && !isSelection));
} else {
var newpos = pos.begin;
Expand Down Expand Up @@ -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.1
Version: 2.5.2
Optional extensions on the jquery.inputmask base
*/
Expand Down Expand Up @@ -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.1
Version: 2.5.2
Optional extensions on the jquery.inputmask base
*/
Expand Down Expand Up @@ -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.1
Version: 2.5.2
Optional extensions on the jquery.inputmask base
*/
Expand Down Expand Up @@ -2487,7 +2487,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.1
Version: 2.5.2
Regex extensions on the jquery.inputmask base
Allows for using regular expressions as a mask
Expand Down Expand Up @@ -2671,7 +2671,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.1
Version: 2.5.2
Phone extension.
When using this extension make sure you specify the correct url to get the masks
Expand Down
56 changes: 28 additions & 28 deletions dist/jquery.inputmask.bundle.min.js

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions dist/min/jquery.inputmask.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jquery.inputmask.jquery.json
Expand Up @@ -8,7 +8,7 @@
"inputmask",
"mask"
],
"version": "2.5.1",
"version": "2.5.2",
"author": {
"name": "Robin Herbots",
"url": "http://github.com/RobinHerbots/jquery.inputmask"
Expand Down
2 changes: 1 addition & 1 deletion js/jquery.inputmask.js
Expand Up @@ -905,7 +905,7 @@
clearBuffer(getActiveBuffer(), pos.begin, pos.end);

var ml = getMaskLength();
if (opts.greedy == false) {
if (opts.greedy == false && (isNaN(opts.repeat) || opts.repeat > 0)) {
shiftL(pos.begin, ml, undefined, !isRTL && (k == opts.keyCode.BACKSPACE && !isSelection));
} else {
var newpos = pos.begin;
Expand Down
31 changes: 31 additions & 0 deletions qunit/tests.js
Expand Up @@ -344,6 +344,37 @@ test("inputmask(\"99 999 999 999 9999 \\D\\E*** 9999\") ~ value=\"01650103002000
$("#testmask").remove();
});

test("inputmask(\"99 999 999 999 9999 \\D\\E*** 9999\") ~ value=\"016501030020001DE1015170\" replace 002 with 003 - wuSam", function () {
$('body').append('<input type="text" id="testmask" value="016501030020001DE1015170" />');
$("#testmask").inputmask("99 999 999 999 9999 \\D\\E*** 9999");
caret($("#testmask"), 11, 14);
$("#testmask").Type("003");
equal($("#testmask").val(), "01 650 103 003 0001 DE101 5170", "Result " + $("#testmask").val());

$("#testmask").remove();
});

test("inputmask(\"99 999 999 999 9999 \\D\\E*** 9999\") ~ value=\"016501030020001DE1015170\" replace 02 with 01 - wuSam", function () {
$('body').append('<input type="text" id="testmask" value="016501030020001DE1015170" />');
$("#testmask").inputmask("99 999 999 999 9999 \\D\\E*** 9999");
caret($("#testmask"), 12, 14);
$("#testmask").Type("01");
equal($("#testmask").val(), "01 650 103 001 0001 DE101 5170", "Result " + $("#testmask").val());

$("#testmask").remove();
});

test("inputmask(\"99 999 999 999 9999 \\D\\E*** 9999\", { greedy: false }) ~ value=\"016501030020001DE1015170\" replace 02 with 01 - wuSam", function () {
$('body').append('<input type="text" id="testmask" value="016501030020001DE1015170" />');
$("#testmask").inputmask("99 999 999 999 9999 \\D\\E*** 9999", { greedy:false });
caret($("#testmask"), 12, 14);
$("#testmask").Type("01");
equal($("#testmask").val(), "01 650 103 001 0001 DE101 5170", "Result " + $("#testmask").val());

$("#testmask").remove();
});


test("inputmask(\"\\D\\E***\") ~ value=\"DE001\" - wuSam", function () {
$('body').append('<input type="text" id="testmask" value="DE001" />');
$("#testmask").inputmask("\\D\\E***");
Expand Down

0 comments on commit 9c2f45a

Please sign in to comment.