Browse Source

wusam fix

Robin Herbots 12 years ago
parent
commit
16a162da0d

+ 1 - 1
build.properties

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

+ 1 - 1
component.json

@@ -1,6 +1,6 @@
 {
 {
     "name": "jquery.inputmask",
     "name": "jquery.inputmask",
-    "version": "2.2.58",
+    "version": "2.2.59",
     "main": "./dist/jquery.inputmask.bundle.js",
     "main": "./dist/jquery.inputmask.bundle.js",
     "dependencies": {
     "dependencies": {
         "jquery": ">=1.5"
         "jquery": ">=1.5"

BIN
dist/jQuery.InputMask.2.2.58.nupkg


BIN
dist/jQuery.InputMask.2.2.59.nupkg


+ 10 - 8
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.2.58
+* Version: 2.2.59
 */
 */
 
 
 (function ($) {
 (function ($) {
@@ -634,7 +634,7 @@
                         ms["p"] = isRTL ? getMaskLength() : 0;
                         ms["p"] = isRTL ? getMaskLength() : 0;
                     });
                     });
                     if (strict !== true) activeMasksetIndex = 0;
                     if (strict !== true) activeMasksetIndex = 0;
-                    //caret(input, getActiveMaskSet()["p"]);
+                    if (writeOut) input._valueSet(""); //initial clear
 
 
                     if (isRTL && !opts.numericInput)
                     if (isRTL && !opts.numericInput)
                         inputValue = inputValue.reverse();
                         inputValue = inputValue.reverse();
@@ -642,8 +642,10 @@
                     var ml = getMaskLength();
                     var ml = getMaskLength();
                     $.each(inputValue, function (ndx, charCode) {
                     $.each(inputValue, function (ndx, charCode) {
                         var index = isRTL ? (opts.numericInput ? ml : ml - ndx) : ndx;
                         var index = isRTL ? (opts.numericInput ? ml : ml - ndx) : ndx;
-                        if ((strict && isMask(isRTL ? index - 1 : index))
-                        || $.inArray(charCode, getActiveBufferTemplate().slice(getActiveMaskSet()["lastValidPosition"] + 1, getActiveMaskSet()["p"])) == -1) {
+                        if ((strict && isMask(isRTL ? index - 1 : index)) ||
+                            (charCode != getBufferElement(getActiveBufferTemplate(), isRTL ? index - 1 : index, true) &&
+                             $.inArray(charCode, getActiveBufferTemplate().slice(getActiveMaskSet()["lastValidPosition"] + 1, getActiveMaskSet()["p"])) == -1)
+                            ) {
                             $(input).trigger("keypress", [true, charCode.charCodeAt(0), writeOut, strict, index, isRTL]);
                             $(input).trigger("keypress", [true, charCode.charCodeAt(0), writeOut, strict, index, isRTL]);
                         }
                         }
                     });
                     });
@@ -1463,7 +1465,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.2.58
+Version: 2.2.59
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -1565,7 +1567,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.2.58
+Version: 2.2.59
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2034,7 +2036,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.2.58
+Version: 2.2.59
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2197,7 +2199,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.2.58
+Version: 2.2.59
 
 
 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

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


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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 5 - 3
js/jquery.inputmask.js

@@ -634,7 +634,7 @@
                         ms["p"] = isRTL ? getMaskLength() : 0;
                         ms["p"] = isRTL ? getMaskLength() : 0;
                     });
                     });
                     if (strict !== true) activeMasksetIndex = 0;
                     if (strict !== true) activeMasksetIndex = 0;
-                    //caret(input, getActiveMaskSet()["p"]);
+                    if (writeOut) input._valueSet(""); //initial clear
 
 
                     if (isRTL && !opts.numericInput)
                     if (isRTL && !opts.numericInput)
                         inputValue = inputValue.reverse();
                         inputValue = inputValue.reverse();
@@ -642,8 +642,10 @@
                     var ml = getMaskLength();
                     var ml = getMaskLength();
                     $.each(inputValue, function (ndx, charCode) {
                     $.each(inputValue, function (ndx, charCode) {
                         var index = isRTL ? (opts.numericInput ? ml : ml - ndx) : ndx;
                         var index = isRTL ? (opts.numericInput ? ml : ml - ndx) : ndx;
-                        if ((strict && isMask(isRTL ? index - 1 : index))
-                        || $.inArray(charCode, getActiveBufferTemplate().slice(getActiveMaskSet()["lastValidPosition"] + 1, getActiveMaskSet()["p"])) == -1) {
+                        if ((strict && isMask(isRTL ? index - 1 : index)) ||
+                            (charCode != getBufferElement(getActiveBufferTemplate(), isRTL ? index - 1 : index, true) &&
+                             $.inArray(charCode, getActiveBufferTemplate().slice(getActiveMaskSet()["lastValidPosition"] + 1, getActiveMaskSet()["p"])) == -1)
+                            ) {
                             $(input).trigger("keypress", [true, charCode.charCodeAt(0), writeOut, strict, index, isRTL]);
                             $(input).trigger("keypress", [true, charCode.charCodeAt(0), writeOut, strict, index, isRTL]);
                         }
                         }
                     });
                     });