Browse Source

fix oncomplete - thx to qunitgit rm dist/jQuery.InputMask.2.2.70.nupkg

Robin Herbots 12 years ago
parent
commit
5a4e081fad

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 
 build.major = 2
 build.major = 2
 build.minor = 2
 build.minor = 2
-build.revision = 70
+build.revision = 71
 
 
 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.70",
+    "version": "2.2.71",
     "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.70.nupkg


+ 6 - 6
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.70
+* Version: 2.2.71
 */
 */
 
 
 (function ($) {
 (function ($) {
@@ -1418,7 +1418,7 @@
                                                         shiftR(p, buffer.length, c);
                                                         shiftR(p, buffer.length, c);
                                                         //shift the lvp if needed
                                                         //shift the lvp if needed
                                                         var lvp = getActiveMaskSet()["lastValidPosition"], nlvp = seekNext(lvp);
                                                         var lvp = getActiveMaskSet()["lastValidPosition"], nlvp = seekNext(lvp);
-                                                        if (lvp >= p && (getBufferElement(getActiveBuffer(), nlvp) != getPlaceHolder(nlvp))) {
+                                                        if (nlvp != getMaskLength() && lvp >= p && (getBufferElement(getActiveBuffer(), nlvp) != getPlaceHolder(nlvp))) {
                                                             getActiveMaskSet()["lastValidPosition"] = nlvp;
                                                             getActiveMaskSet()["lastValidPosition"] = nlvp;
                                                         }
                                                         }
                                                     } else getActiveMaskSet()["writeOutBuffer"] = false;
                                                     } else getActiveMaskSet()["writeOutBuffer"] = false;
@@ -1483,7 +1483,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.70
+Version: 2.2.71
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -1585,7 +1585,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.70
+Version: 2.2.71
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2054,7 +2054,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.70
+Version: 2.2.71
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2221,7 +2221,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.70
+Version: 2.2.71
 
 
 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
+ 67 - 67
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.70",
+    "version": "2.2.71",
     "author": {
     "author": {
         "name": "Robin Herbots",
         "name": "Robin Herbots",
         "url": "http://github.com/RobinHerbots/jquery.inputmask"
         "url": "http://github.com/RobinHerbots/jquery.inputmask"

+ 1 - 1
js/jquery.inputmask.js

@@ -1418,7 +1418,7 @@
                                                         shiftR(p, buffer.length, c);
                                                         shiftR(p, buffer.length, c);
                                                         //shift the lvp if needed
                                                         //shift the lvp if needed
                                                         var lvp = getActiveMaskSet()["lastValidPosition"], nlvp = seekNext(lvp);
                                                         var lvp = getActiveMaskSet()["lastValidPosition"], nlvp = seekNext(lvp);
-                                                        if (lvp >= p && (getBufferElement(getActiveBuffer(), nlvp) != getPlaceHolder(nlvp))) {
+                                                        if (nlvp != getMaskLength() && lvp >= p && (getBufferElement(getActiveBuffer(), nlvp) != getPlaceHolder(nlvp))) {
                                                             getActiveMaskSet()["lastValidPosition"] = nlvp;
                                                             getActiveMaskSet()["lastValidPosition"] = nlvp;
                                                         }
                                                         }
                                                     } else getActiveMaskSet()["writeOutBuffer"] = false;
                                                     } else getActiveMaskSet()["writeOutBuffer"] = false;

+ 38 - 0
qunit/tests.js

@@ -36,6 +36,27 @@ test( "inputmask(\"999.999.999\")", function() {
 		$("#testmask").remove();
 		$("#testmask").remove();
 });
 });
 
 
+asyncTest( "inputmask(\"999.999.999\", { oncomplete: ... })", 1,function() {
+		$('body').append('<input type="text" id="testmask" />');
+		$("#testmask").inputmask("999.999.999", {
+			oncomplete: function(){ 
+							equal( $("#testmask").val(), "123.456.789", "Result " + $("#testmask").val());
+							start();
+							$("#testmask").remove();
+						}
+		});
+  
+		$("#testmask")[0].focus();			     
+		$("#testmask").SendKey( 49 );
+		$("#testmask").SendKey( 50 );
+		$("#testmask").SendKey( 51 );
+		$("#testmask").SendKey( 52 );
+		$("#testmask").SendKey( 53 );
+		$("#testmask").SendKey( 54 );
+		$("#testmask").SendKey( 55 );
+		$("#testmask").SendKey( 56 );
+		$("#testmask").SendKey( 57 );		
+});
 
 
 
 
 module("Initial value setting");
 module("Initial value setting");
@@ -73,3 +94,20 @@ test( "inputmask(\"\\D\\E***\") ~ value=\"DE001\"", function() {
   $("#testmask").remove();
   $("#testmask").remove();
 });
 });
 
 
+test( "inputmask(\"decimal\") ~ value=\"123.45\"", function() {
+  $('body').append('<input type="text" id="testmask" value="123.45" />');
+  $("#testmask").inputmask("decimal");
+  equal( $("#testmask").val(), "123.45", "Result " + $("#testmask").val());
+  
+  $("#testmask").remove();
+});
+
+module("Set value with fn.val");
+test( "inputmask(\"decimal\") ~ value=\"123.45\"", function() {
+  $('body').append('<input type="text" id="testmask" />');
+  $("#testmask").inputmask("decimal");
+  $("#testmask").val("123.45");
+  equal( $("#testmask").val(), "123.45", "Result " + $("#testmask").val());
+  
+  $("#testmask").remove();
+});