Browse Source

fix nuget package for use with requirejs

Robin Herbots 11 years ago
parent
commit
8a9b1055e9

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.0.69",
+  "version": "3.0.70",
   "main": [
     "./dist/inputmask/jquery.inputmask.js",
     "./dist/inputmask/jquery.inputmask.extensions.js",

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 build.major = 3
 build.minor = 0
-build.revision = 69
+build.revision = 70
 
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js

+ 4 - 4
build.xml

@@ -10,9 +10,9 @@
 
 	<target name="updateVersions">
        <replaceregexp file="nuget/jquery.inputmask.nuspec" match="&lt;version&gt;.*&lt;/version&gt;" replace="&lt;version&gt;${build.major}.${build.minor}.${build.revision}&lt;/version&gt;" />
-       <replaceregexp file="nuget/jquery.inputmask.nuspec" match="-0.0.0" replace="-${build.major}.${build.minor}.${build.revision}"  byline="true"/>
+       <!-- <replaceregexp file="nuget/jquery.inputmask.nuspec" match="-0.0.0" replace="-${build.major}.${build.minor}.${build.revision}"  byline="true"/> -->
        <replaceregexp file="nuget/jquery.inputmask.linux.nuspec" match="&lt;version&gt;.*&lt;/version&gt;" replace="&lt;version&gt;${build.major}.${build.minor}.${build.revision}&lt;/version&gt;" />
-	   <replaceregexp file="nuget/jquery.inputmask.linux.nuspec" match="-0.0.0" replace="-${build.major}.${build.minor}.${build.revision}"  byline="true"/>
+	   <!-- <replaceregexp file="nuget/jquery.inputmask.linux.nuspec" match="-0.0.0" replace="-${build.major}.${build.minor}.${build.revision}"  byline="true"/> -->
 	   <replaceregexp file="${srcdir}/jquery.inputmask.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}"  byline="true"/>
 	   <replaceregexp file="${srcdir}/jquery.inputmask.extensions.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}"  byline="true"/>
 	   <replaceregexp file="${srcdir}/jquery.inputmask.date.extensions.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}"  byline="true"/>
@@ -26,9 +26,9 @@
 
 	<target name="resetVersions">
        <replaceregexp file="nuget/jquery.inputmask.nuspec" match="&lt;version&gt;.*&lt;/version&gt;" replace="&lt;version&gt;0.0.0&lt;/version&gt;" />
-	   <replaceregexp file="nuget/jquery.inputmask.nuspec" replace="-0.0.0" match="-${build.major}.${build.minor}.${build.revision}"  byline="true"/>
+	   <!-- <replaceregexp file="nuget/jquery.inputmask.nuspec" replace="-0.0.0" match="-${build.major}.${build.minor}.${build.revision}"  byline="true"/> -->
 	   <replaceregexp file="nuget/jquery.inputmask.linux.nuspec" match="&lt;version&gt;.*&lt;/version&gt;" replace="&lt;version&gt;0.0.0&lt;/version&gt;" />
-	   <replaceregexp file="nuget/jquery.inputmask.linux.nuspec" replace="-0.0.0" match="-${build.major}.${build.minor}.${build.revision}"  byline="true"/>
+	   <!-- <replaceregexp file="nuget/jquery.inputmask.linux.nuspec" replace="-0.0.0" match="-${build.major}.${build.minor}.${build.revision}"  byline="true"/> -->
 	   <replaceregexp file="${srcdir}/jquery.inputmask.js" match="Version:.*" replace="Version: 0.0.0"  byline="true"/>
 	   <replaceregexp file="${srcdir}/jquery.inputmask.extensions.js" match="Version:.*" replace="Version: 0.0.0"  byline="true"/>
 	   <replaceregexp file="${srcdir}/jquery.inputmask.date.extensions.js" match="Version:.*" replace="Version: 0.0.0"  byline="true"/>

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


+ 39 - 33
dist/jquery.inputmask.bundle.js

@@ -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: 3.0.69
+* Version: 3.0.70
 */
 
 (function (factory) {
@@ -750,23 +750,10 @@
 
                     return rslt;
                 }
-
-                //Check for a nonmask before the pos
-                var buffer = getBuffer();
-                for (var pndx = pos - 1; pndx > -1; pndx--) {
-                    if (getMaskSet()["validPositions"][pndx] && getMaskSet()["validPositions"][pndx].fn == null)
-                        break;
-                    else if ((!isMask(pndx) || buffer[pndx] != getPlaceholder(pndx)) && getTests(pndx).length > 1) {
-                        _isValid(pndx, buffer[pndx], true);
-                        break;
-                    }
-                }
-
-                var maskPos = pos;
-                if (maskPos >= getMaskLength()) { //try fuzzy alternator logic
-                    var continueMask = false;
+                function alternate(pos, c, strict, fromSetValid) {
                     if (opts.keepStatic) {
-                        var validPs = getMaskSet()["validPositions"],
+                        var validPsClone = $.extend(true, {}, getMaskSet()["validPositions"]),
+                            validPs = getMaskSet()["validPositions"],
                             firstAlt,
                             alternation;
                         //find first alternation
@@ -782,14 +769,15 @@
                                 var altPos = validPs[decisionPos],
                                     decisionTaker = altPos.locator[alternation],
                                     altNdxs = validPs[firstAlt].locator[alternation].split(",");
-                                if (decisionTaker == "0") {
-                                    for (var mndx = 0; mndx < altNdxs.length; mndx++) {
-                                        if (decisionTaker != altNdxs[mndx]) {
-                                            altPos = validPs[seekPrevious(decisionPos)];
-                                            altPos.locator[alternation] = altNdxs[mndx];
-                                            break;
-                                        }
+
+                                for (var mndx = 0; mndx < altNdxs.length; mndx++) {
+                                    if (decisionTaker < altNdxs[mndx]) {
+                                        altPos = validPs[seekPrevious(decisionPos)];
+                                        altPos.locator[alternation] = altNdxs[mndx];
+                                        break;
                                     }
+                                }
+                                if (decisionTaker != altPos.locator[alternation]) {
                                     getMaskSet()["buffer"].splice(decisionPos, 1);
                                     var buffer = getBuffer().slice(); //work on clone
                                     for (var i = decisionPos; i < getLastValidPosition() + 1; i++) {
@@ -804,15 +792,33 @@
                                     }
                                     altPos.locator[alternation] = decisionTaker; //reset forceddecision ~ needed for proper delete
 
-                                    continueMask = true;
-                                    break;
+                                    var isValidRslt = isValid(pos, c, strict, fromSetValid);
+                                    if (!isValidRslt) {
+                                        resetMaskSet();
+                                        getMaskSet()["validPositions"] = $.extend(true, {}, validPsClone);
+                                    }
+                                    return isValidRslt;
                                 }
                                 break;
                             }
                         }
                     }
-                    if (!continueMask)
-                        return false;
+                    return false;
+                }
+                //Check for a nonmask before the pos
+                var buffer = getBuffer();
+                for (var pndx = pos - 1; pndx > -1; pndx--) {
+                    if (getMaskSet()["validPositions"][pndx] && getMaskSet()["validPositions"][pndx].fn == null)
+                        break;
+                    else if ((!isMask(pndx) || buffer[pndx] != getPlaceholder(pndx)) && getTests(pndx).length > 1) {
+                        _isValid(pndx, buffer[pndx], true);
+                        break;
+                    }
+                }
+
+                var maskPos = pos;
+                if (maskPos >= getMaskLength()) { //try fuzzy alternator logic
+                    return alternate(pos, c, strict, fromSetValid);
                 }
                 var result = _isValid(maskPos, c, strict, fromSetValid);
                 if (!strict && result === false) {
@@ -1934,7 +1940,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: 3.0.69
+Version: 3.0.70
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2061,7 +2067,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: 3.0.69
+Version: 3.0.70
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2555,7 +2561,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: 3.0.69
+Version: 3.0.70
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2814,7 +2820,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: 3.0.69
+Version: 3.0.70
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
@@ -3007,7 +3013,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: 3.0.69
+Version: 3.0.70
 
 Phone extension.
 When using this extension make sure you specify the correct url to get the masks

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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 8 - 7
js/jquery.inputmask.js

@@ -769,14 +769,15 @@
                                 var altPos = validPs[decisionPos],
                                     decisionTaker = altPos.locator[alternation],
                                     altNdxs = validPs[firstAlt].locator[alternation].split(",");
-                                if (decisionTaker == "0") {
-                                    for (var mndx = 0; mndx < altNdxs.length; mndx++) {
-                                        if (decisionTaker != altNdxs[mndx]) {
-                                            altPos = validPs[seekPrevious(decisionPos)];
-                                            altPos.locator[alternation] = altNdxs[mndx];
-                                            break;
-                                        }
+
+                                for (var mndx = 0; mndx < altNdxs.length; mndx++) {
+                                    if (decisionTaker < altNdxs[mndx]) {
+                                        altPos = validPs[seekPrevious(decisionPos)];
+                                        altPos.locator[alternation] = altNdxs[mndx];
+                                        break;
                                     }
+                                }
+                                if (decisionTaker != altPos.locator[alternation]) {
                                     getMaskSet()["buffer"].splice(decisionPos, 1);
                                     var buffer = getBuffer().slice(); //work on clone
                                     for (var i = decisionPos; i < getLastValidPosition() + 1; i++) {

+ 6 - 6
nuget/jquery.inputmask.linux.nuspec

@@ -34,11 +34,11 @@ Highlights:
         <tags>jQuery, plugins, input, form, inputmask, mask</tags>
     </metadata>
     <files>
-        <file src="js/jquery.inputmask.date.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.date.extensions-0.0.0.js" />
-        <file src="js/jquery.inputmask.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.extensions-0.0.0.js" />
-        <file src="js/jquery.inputmask.numeric.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.numeric.extensions-0.0.0.js" />
-		<file src="js/jquery.inputmask.regex.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.regex.extensions-0.0.0.js" />
-		<file src="js/jquery.inputmask.phone.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.phone.extensions-0.0.0.js" />
-        <file src="js/jquery.inputmask.js" target="content/Scripts/jquery.inputmask/jquery.inputmask-0.0.0.js" />
+        <file src="js/jquery.inputmask.date.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.date.extensions.js" />
+        <file src="js/jquery.inputmask.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.extensions.js" />
+        <file src="js/jquery.inputmask.numeric.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.numeric.extensions.js" />
+		<file src="js/jquery.inputmask.regex.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.regex.extensions.js" />
+		<file src="js/jquery.inputmask.phone.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.phone.extensions.js" />
+        <file src="js/jquery.inputmask.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.js" />
     </files>
 </package>

+ 6 - 6
nuget/jquery.inputmask.nuspec

@@ -34,11 +34,11 @@ Highlights:
         <tags>jQuery, plugins, input, form, inputmask, mask</tags>
     </metadata>
     <files>
-        <file src="..\js\jquery.inputmask.date.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.date.extensions-0.0.0.js" />
-        <file src="..\js\jquery.inputmask.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.extensions-0.0.0.js" />
-        <file src="..\js\jquery.inputmask.numeric.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.numeric.extensions-0.0.0.js" />
-		<file src="..\js\jquery.inputmask.regex.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.regex.extensions-0.0.0.js" />
-		<file src="..\js\jquery.inputmask.phone.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.phone.extensions-0.0.0.js" />
-        <file src="..\js\jquery.inputmask.js" target="content\Scripts\jquery.inputmask\jquery.inputmask-0.0.0.js" />
+        <file src="..\js\jquery.inputmask.date.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.date.extensions.js" />
+        <file src="..\js\jquery.inputmask.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.extensions.js" />
+        <file src="..\js\jquery.inputmask.numeric.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.numeric.extensions.js" />
+		<file src="..\js\jquery.inputmask.regex.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.regex.extensions.js" />
+		<file src="..\js\jquery.inputmask.phone.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.phone.extensions.js" />
+        <file src="..\js\jquery.inputmask.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.js" />
     </files>
 </package>

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.0.69",
+  "version": "3.0.70",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
   "main": [
     "./dist/inputmask/jquery.inputmask.js",