浏览代码

fix allowMinus #393

Robin Herbots 11 年之前
父节点
当前提交
d152eef3b2

+ 2 - 2
.gitignore

@@ -1,2 +1,2 @@
-InputMask
-test.html
+InputMask
+test.html

文件差异内容过多而无法显示
+ 838 - 838
README.md


+ 118 - 118
build.xml

@@ -1,118 +1,118 @@
-<?xml version="1.0"?>
-<project name="jquery.inputmask" default="build" basedir=".">
-
-    <!-- define the path of compressor in this file -->
-    <property file="build.properties" />
-
-    <target name="init">
-        <mkdir dir="${distdir}" />
-    </target>
-
-	<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.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="${srcdir}/jquery.inputmask.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}"  byline="true"/>
-	   <replaceregexp file="${srcdir}/jquery.inputmask-multi.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"/>
-	   <replaceregexp file="${srcdir}/jquery.inputmask.numeric.extensions.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}"  byline="true"/>
-	   <replaceregexp file="${srcdir}/jquery.inputmask.regex.extensions.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}"  byline="true"/>
-	   <replaceregexp file="${srcdir}/jquery.inputmask.phone.extensions.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}"  byline="true"/>
-	   <replaceregexp file="./jquery.inputmask.jquery.json" match="&quot;version&quot;:.*" replace="&quot;version&quot;: &quot;${build.major}.${build.minor}.${build.revision}&quot;,"  byline="true"/>
-	   <replaceregexp file="./bower.json" match="&quot;version&quot;:.*" replace="&quot;version&quot;: &quot;${build.major}.${build.minor}.${build.revision}&quot;,"  byline="true"/>
-	</target>
-
-	<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.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="${srcdir}/jquery.inputmask.js" match="Version:.*" replace="Version: 0.0.0"  byline="true"/>
-	   <replaceregexp file="${srcdir}/jquery.inputmask-multi.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"/>
-	   <replaceregexp file="${srcdir}/jquery.inputmask.numeric.extensions.js" match="Version:.*" replace="Version: 0.0.0"  byline="true"/>
-	   <replaceregexp file="${srcdir}/jquery.inputmask.regex.extensions.js" match="Version:.*" replace="Version: 0.0.0"  byline="true"/>
-	   <replaceregexp file="${srcdir}/jquery.inputmask.phone.extensions.js" match="Version:.*" replace="Version: 0.0.0"  byline="true"/>
-    </target>
-	
-    <target name="jquery.inputmask" depends="init, updateVersions">
-        <concat destfile="${distdir}/${target}">
-			<fileset file="${srcdir}/jquery.inputmask.js"/>
-			<fileset file="${srcdir}/jquery.inputmask-multi.js"/>
-			<fileset file="${srcdir}/jquery.inputmask.extensions.js"/>
-			<fileset file="${srcdir}/jquery.inputmask.date.extensions.js"/>
-			<fileset file="${srcdir}/jquery.inputmask.numeric.extensions.js"/>
-			<fileset file="${srcdir}/jquery.inputmask.regex.extensions.js"/>
-			<fileset file="${srcdir}/jquery.inputmask.phone.extensions.js"/>
-        </concat>
-    </target>
-
-    <target name="jquery.inputmask.min" depends="jquery.inputmask">
-        <apply executable="java" parallel="false" verbose="true" failonerror="true" dest="${distdir}">
-            <fileset dir="${distdir}">
-                <include name="${target}" />
-            </fileset>
-            <arg line="-jar" />
-            <arg path="${GoogleCompiler}" />
-			<arg value="--compilation_level" />
-			<arg value="SIMPLE_OPTIMIZATIONS" />
-            <arg value="--warning_level" />
-            <arg value="QUIET" />
-            <arg value="--js_output_file" />
-            <targetfile />
-            <arg value="--js" />
-            <mapper type="glob" from="${target}" to="${target.min}" />
-        </apply>
-      	<echo message="${target.min} built." />
-    </target>
-
-    <target name="minfiles">
-      <mkdir dir="${distdir}/min" />
-	<apply executable="java" parallel="false" verbose="true" failonerror="true" dest="${distdir}/min">
-	    <fileset dir="${srcdir}">
-                <include name="*.js" />
-            </fileset>
-            <arg line="-jar" />
-            <arg path="${GoogleCompiler}" />
-			<arg value="--compilation_level" />
-			<arg value="SIMPLE_OPTIMIZATIONS" />
-            <arg value="--warning_level" />
-            <arg value="QUIET" />
-            <arg value="--js_output_file" />
-            <targetfile />
-            <arg value="--js" />
-	    <mapper type="glob" from="*.js" to="*.js" />
-        </apply>
-    </target>
-
-	 <target name="jquery.inputmask.nuget" depends="jquery.inputmask, jquery.inputmask.min, minfiles">
-        <exec executable="${NugetExe}" failonerror="true" dir="tools" vmlauncher="false" osfamily="windows" >
-			 <arg value="pack"/>
-			 <arg value="..\nuget\${nuspec}" />
-			 <arg value="-OutputDirectory" />
-			 <arg value="..\${distdir}" />
-        </exec>
-        <exec executable="mono" failonerror="false" dir="tools" vmlauncher="false" osfamily="unix" >
-			 <arg value="--runtime=v4.0.30319"/>
-			 <arg value="${NugetExe}"/>
-			 <arg value="pack"/>
-			 <arg value="../nuget/${nuspeclinux}"/>
-			 <arg value="-BasePath"/>
-			 <arg value="../"/>
- 			 <arg value="-OutputDirectory"/>
-			 <arg value="../${distdir}"/>
-        </exec>
-    </target>
-	
-    <target name="build" depends="jquery.inputmask, jquery.inputmask.min, minfiles, jquery.inputmask.nuget, resetVersions"/>
-
-    <target name="clean">
-        <delete dir="${distdir}" />
-    </target>
-
-    <target name="all" depends="clean,build"/>
-
-</project>
+<?xml version="1.0"?>
+<project name="jquery.inputmask" default="build" basedir=".">
+
+    <!-- define the path of compressor in this file -->
+    <property file="build.properties" />
+
+    <target name="init">
+        <mkdir dir="${distdir}" />
+    </target>
+
+	<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.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="${srcdir}/jquery.inputmask.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}"  byline="true"/>
+	   <replaceregexp file="${srcdir}/jquery.inputmask-multi.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"/>
+	   <replaceregexp file="${srcdir}/jquery.inputmask.numeric.extensions.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}"  byline="true"/>
+	   <replaceregexp file="${srcdir}/jquery.inputmask.regex.extensions.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}"  byline="true"/>
+	   <replaceregexp file="${srcdir}/jquery.inputmask.phone.extensions.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}"  byline="true"/>
+	   <replaceregexp file="./jquery.inputmask.jquery.json" match="&quot;version&quot;:.*" replace="&quot;version&quot;: &quot;${build.major}.${build.minor}.${build.revision}&quot;,"  byline="true"/>
+	   <replaceregexp file="./bower.json" match="&quot;version&quot;:.*" replace="&quot;version&quot;: &quot;${build.major}.${build.minor}.${build.revision}&quot;,"  byline="true"/>
+	</target>
+
+	<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.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="${srcdir}/jquery.inputmask.js" match="Version:.*" replace="Version: 0.0.0"  byline="true"/>
+	   <replaceregexp file="${srcdir}/jquery.inputmask-multi.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"/>
+	   <replaceregexp file="${srcdir}/jquery.inputmask.numeric.extensions.js" match="Version:.*" replace="Version: 0.0.0"  byline="true"/>
+	   <replaceregexp file="${srcdir}/jquery.inputmask.regex.extensions.js" match="Version:.*" replace="Version: 0.0.0"  byline="true"/>
+	   <replaceregexp file="${srcdir}/jquery.inputmask.phone.extensions.js" match="Version:.*" replace="Version: 0.0.0"  byline="true"/>
+    </target>
+	
+    <target name="jquery.inputmask" depends="init, updateVersions">
+        <concat destfile="${distdir}/${target}">
+			<fileset file="${srcdir}/jquery.inputmask.js"/>
+			<fileset file="${srcdir}/jquery.inputmask-multi.js"/>
+			<fileset file="${srcdir}/jquery.inputmask.extensions.js"/>
+			<fileset file="${srcdir}/jquery.inputmask.date.extensions.js"/>
+			<fileset file="${srcdir}/jquery.inputmask.numeric.extensions.js"/>
+			<fileset file="${srcdir}/jquery.inputmask.regex.extensions.js"/>
+			<fileset file="${srcdir}/jquery.inputmask.phone.extensions.js"/>
+        </concat>
+    </target>
+
+    <target name="jquery.inputmask.min" depends="jquery.inputmask">
+        <apply executable="java" parallel="false" verbose="true" failonerror="true" dest="${distdir}">
+            <fileset dir="${distdir}">
+                <include name="${target}" />
+            </fileset>
+            <arg line="-jar" />
+            <arg path="${GoogleCompiler}" />
+			<arg value="--compilation_level" />
+			<arg value="SIMPLE_OPTIMIZATIONS" />
+            <arg value="--warning_level" />
+            <arg value="QUIET" />
+            <arg value="--js_output_file" />
+            <targetfile />
+            <arg value="--js" />
+            <mapper type="glob" from="${target}" to="${target.min}" />
+        </apply>
+      	<echo message="${target.min} built." />
+    </target>
+
+    <target name="minfiles">
+      <mkdir dir="${distdir}/min" />
+	<apply executable="java" parallel="false" verbose="true" failonerror="true" dest="${distdir}/min">
+	    <fileset dir="${srcdir}">
+                <include name="*.js" />
+            </fileset>
+            <arg line="-jar" />
+            <arg path="${GoogleCompiler}" />
+			<arg value="--compilation_level" />
+			<arg value="SIMPLE_OPTIMIZATIONS" />
+            <arg value="--warning_level" />
+            <arg value="QUIET" />
+            <arg value="--js_output_file" />
+            <targetfile />
+            <arg value="--js" />
+	    <mapper type="glob" from="*.js" to="*.js" />
+        </apply>
+    </target>
+
+	 <target name="jquery.inputmask.nuget" depends="jquery.inputmask, jquery.inputmask.min, minfiles">
+        <exec executable="${NugetExe}" failonerror="true" dir="tools" vmlauncher="false" osfamily="windows" >
+			 <arg value="pack"/>
+			 <arg value="..\nuget\${nuspec}" />
+			 <arg value="-OutputDirectory" />
+			 <arg value="..\${distdir}" />
+        </exec>
+        <exec executable="mono" failonerror="false" dir="tools" vmlauncher="false" osfamily="unix" >
+			 <arg value="--runtime=v4.0.30319"/>
+			 <arg value="${NugetExe}"/>
+			 <arg value="pack"/>
+			 <arg value="../nuget/${nuspeclinux}"/>
+			 <arg value="-BasePath"/>
+			 <arg value="../"/>
+ 			 <arg value="-OutputDirectory"/>
+			 <arg value="../${distdir}"/>
+        </exec>
+    </target>
+	
+    <target name="build" depends="jquery.inputmask, jquery.inputmask.min, minfiles, jquery.inputmask.nuget, resetVersions"/>
+
+    <target name="clean">
+        <delete dir="${distdir}" />
+    </target>
+
+    <target name="all" depends="clean,build"/>
+
+</project>

二进制
dist/jQuery.InputMask.3.0.31.nupkg


二进制
dist/jQuery.InputMask.3.0.32.nupkg


+ 1 - 1
dist/jquery.inputmask.bundle.js

@@ -2690,7 +2690,7 @@ Optional extensions on the jquery.inputmask base
             definitions: {
                 '~': {
                     validator: function (chrs, buffer, pos, strict, opts) {
-                        if (!strict && chrs === "-") {
+                        if (!strict && opts.allowMinus && chrs === "-") {
                             var matchRslt = buffer.join('').match(opts.regex.integerPart(opts));
 
                             if (matchRslt.length > 0) {

文件差异内容过多而无法显示
+ 2 - 2
dist/jquery.inputmask.bundle.min.js


文件差异内容过多而无法显示
+ 2 - 2
dist/min/jquery.inputmask.numeric.extensions.js


+ 366 - 366
js/jquery.inputmask-multi.js

@@ -1,366 +1,366 @@
-/**
-* @license Input Mask plugin for jquery
-* 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: 0.0.0
-*/
-
-(function ($) {
-    if ($.fn.inputmask != undefined) {
-        function multiMaskScope(actionObj, masksets, opts) {
-            function isInputEventSupported(eventName) {
-                var el = document.createElement('input'),
-                    eventName = 'on' + eventName,
-                    isSupported = (eventName in el);
-                if (!isSupported) {
-                    el.setAttribute(eventName, 'return;');
-                    isSupported = typeof el[eventName] == 'function';
-                }
-                el = null;
-                return isSupported;
-            }
-            var PasteEventType = isInputEventSupported('paste') ? 'paste' : isInputEventSupported('input') ? 'input' : "propertychange",
-                isRTL, el, $el, elmasks, activeMasksetIndex;
-
-            function PatchValhookMulti(type) {
-                if ($.valHooks[type] == undefined || $.valHooks[type].inputmaskmultipatch != true) {
-                    var valueGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function (elem) { return elem.value; };
-                    var valueSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function (elem, value) {
-                        elem.value = value;
-                        return elem;
-                    };
-
-                    $.valHooks[type] = {
-                        get: function (elem) {
-                            var $elem = $(elem);
-                            if ($elem.data('_inputmask-multi')) {
-                                var data = $elem.data('_inputmask-multi');
-                                return valueGet(data["elmasks"][data["activeMasksetIndex"]]);
-                            } else return valueGet(elem);
-                        },
-                        set: function (elem, value) {
-                            var $elem = $(elem);
-                            var result = valueSet(elem, value);
-                            if ($elem.data('_inputmask-multi')) $elem.triggerHandler('setvalue');
-                            return result;
-                        },
-                        inputmaskmultipatch: true
-                    };
-                }
-            }
-
-            function mcaret(input, begin, end) {
-                var npt = input.jquery && input.length > 0 ? input[0] : input, range;
-                if (typeof begin == 'number') {
-                    begin = TranslatePosition(begin);
-                    end = TranslatePosition(end);
-                    end = (typeof end == 'number') ? end : begin;
-
-                    //store caret for multi scope
-                    if (npt != el) {
-                        var data = $(npt).data('_inputmask') || {};
-                        data["caret"] = { "begin": begin, "end": end };
-                        $(npt).data('_inputmask', data);
-                    }
-                    if (!$(npt).is(":visible")) {
-                        return;
-                    }
-
-                    npt.scrollLeft = npt.scrollWidth;
-                    if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
-                    if (npt.setSelectionRange) {
-                        npt.selectionStart = begin;
-                        npt.selectionEnd = end;
-
-                    } else if (npt.createTextRange) {
-                        range = npt.createTextRange();
-                        range.collapse(true);
-                        range.moveEnd('character', end);
-                        range.moveStart('character', begin);
-                        range.select();
-                    }
-                } else {
-                    var data = $(npt).data('_inputmask');
-                    if (!$(npt).is(":visible") && data && data["caret"] != undefined) {
-                        begin = data["caret"]["begin"];
-                        end = data["caret"]["end"];
-                    } else if (npt.setSelectionRange) {
-                        begin = npt.selectionStart;
-                        end = npt.selectionEnd;
-                    } else if (document.selection && document.selection.createRange) {
-                        range = document.selection.createRange();
-                        begin = 0 - range.duplicate().moveStart('character', -100000);
-                        end = begin + range.text.length;
-                    }
-                    begin = TranslatePosition(begin);
-                    end = TranslatePosition(end);
-                    return { "begin": begin, "end": end };
-                }
-            }
-
-            function TranslatePosition(pos) {
-                if (isRTL && typeof pos == 'number' && (!opts.greedy || opts.placeholder != "")) {
-                    var bffrLght = el.value.length;
-                    pos = bffrLght - pos;
-                }
-                return pos;
-            }
-
-            function determineActiveMask(eventType, elmasks) {
-
-                if (eventType != "multiMaskScope") {
-                    if ($.isFunction(opts.determineActiveMasksetIndex))
-                        activeMasksetIndex = opts.determineActiveMasksetIndex.call($el, eventType, elmasks);
-                    else {
-                        var lpc = -1, cp = -1, lvp = -1;;
-                        $.each(elmasks, function (ndx, lmsk) {
-                            var data = $(lmsk).data('_inputmask');
-                            var maskset = data["maskset"];
-                            var lastValidPosition = -1, validPositionCount = 0, caretPos = mcaret(lmsk).begin;
-                            for (var posNdx in maskset["validPositions"]) {
-                                var psNdx = parseInt(posNdx);
-                                if (psNdx > lastValidPosition) lastValidPosition = psNdx;
-                                validPositionCount++;
-                            }
-                            if (validPositionCount > lpc
-                                    || (validPositionCount == lpc && cp > caretPos && lvp > lastValidPosition)
-                                    || (validPositionCount == lpc && cp == caretPos && lvp < lastValidPosition)
-                            ) {
-                                //console.log("lvp " + lastValidPosition + " vpc " + validPositionCount + " caret " + caretPos + " ams " + ndx);
-                                lpc = validPositionCount;
-                                cp = caretPos;
-                                activeMasksetIndex = ndx;
-                                lvp = lastValidPosition;
-                            }
-                        });
-                    }
-
-                    var data = $el.data('_inputmask-multi') || { "activeMasksetIndex": 0, "elmasks": elmasks };
-                    data["activeMasksetIndex"] = activeMasksetIndex;
-                    $el.data('_inputmask-multi', data);
-                }
-
-                if ($.inArray(eventType, ["focus"]) == -1 && el.value != elmasks[activeMasksetIndex]._valueGet()) {
-                    var value = $(elmasks[activeMasksetIndex]).val() == "" ? elmasks[activeMasksetIndex]._valueGet() : $(elmasks[activeMasksetIndex]).val();
-                    el.value = value;
-                }
-                if ($.inArray(eventType, ["blur", "focus"]) == -1) {
-                    if ($(elmasks[activeMasksetIndex]).hasClass("focus.inputmask")) {
-                        var activeCaret = mcaret(elmasks[activeMasksetIndex]);
-                        mcaret(el, activeCaret.begin, activeCaret.end);
-                    }
-                }
-            }
-
-            opts.multi = true;
-
-            function mask(npt) {
-                el = npt;
-                $el = $(el);
-                isRTL = el.dir == "rtl" || opts.numericInput;
-                activeMasksetIndex = 0;
-                elmasks = $.map(masksets, function (msk, ndx) {
-                    var elMaskStr = '<input type="text" ';
-                    if ($el.attr("value")) elMaskStr += 'value="' + $el.attr("value") + '" ';
-                    if ($el.attr("dir")) elMaskStr += 'dir="' + $el.attr("dir") + '" ';
-                    elMaskStr += '/>';
-                    var elmask = $(elMaskStr)[0];
-                    $(elmask).inputmask($.extend({}, opts, { mask: msk.mask }));
-                    return elmask;
-                });
-
-                $el.data('_inputmask-multi', { "activeMasksetIndex": 0, "elmasks": elmasks });
-                if (el.dir == "rtl" || opts.rightAlign)
-                    $el.css("text-align", "right");
-                el.dir = "ltr";
-                $el.removeAttr("dir");
-                if ($el.attr("value") != "") {
-                    determineActiveMask("init", elmasks);
-                }
-
-                $el.bind("mouseenter blur focus mouseleave click dblclick keydown keypress keypress", function (e) {
-                    var caretPos = mcaret(el), k, goDetermine = true;
-                    if (e.type == "keydown") {
-                        k = e.keyCode;
-                        if (k == opts.keyCode.DOWN && activeMasksetIndex < elmasks.length - 1) {
-                            activeMasksetIndex++;
-                            determineActiveMask("multiMaskScope", elmasks);
-                            return false;
-                        } else if (k == opts.keyCode.UP && activeMasksetIndex > 0) {
-                            activeMasksetIndex--;
-                            determineActiveMask("multiMaskScope", elmasks);
-                            return false;
-                        }
-                        if (e.ctrlKey || e.shiftKey || e.altKey) {
-                            return true;
-                        }
-                    } else if (e.type == "keypress" && (e.ctrlKey || e.shiftKey || e.altKey)) {
-                        return true;
-                    }
-                    $.each(elmasks, function (ndx, lmnt) {
-                        if (e.type == "keydown") {
-                            k = e.keyCode;
-
-                            if (k == opts.keyCode.BACKSPACE && lmnt._valueGet().length < caretPos.begin) {
-                                return;
-                            } else if (k == opts.keyCode.TAB) {
-                                goDetermine = false;
-                            } else if (k == opts.keyCode.RIGHT) {
-                                mcaret(lmnt, caretPos.begin + 1, caretPos.end + 1);
-                                goDetermine = false;
-                                return;
-                            } else if (k == opts.keyCode.LEFT) {
-                                mcaret(lmnt, caretPos.begin - 1, caretPos.end - 1);
-                                goDetermine = false;
-                                return;
-                            }
-                        }
-                        if ($.inArray(e.type, ["click"]) != -1) {
-                            mcaret(lmnt, TranslatePosition(caretPos.begin), TranslatePosition(caretPos.end));
-                            if (caretPos.begin != caretPos.end) {
-                                goDetermine = false;
-                                return;
-                            }
-                        }
-
-                        if ($.inArray(e.type, ["keydown"]) != -1 && caretPos.begin != caretPos.end) {
-                            mcaret(lmnt, caretPos.begin, caretPos.end);
-                        }
-
-                        $(lmnt).triggerHandler(e);
-                    });
-                    if (goDetermine) {
-                        setTimeout(function () {
-                            determineActiveMask(e.type, elmasks);
-                        }, 0);
-                    }
-                });
-                $el.bind(PasteEventType + " dragdrop drop setvalue", function (e) {
-                    var caretPos = mcaret(el);
-                    setTimeout(function () {
-                        $.each(elmasks, function (ndx, lmnt) {
-                            lmnt._valueSet(el.value);
-                            $(lmnt).triggerHandler(e);
-                        });
-                        setTimeout(function () {
-                            determineActiveMask(e.type, elmasks);
-                        }, 0);
-                    }, 0);
-                });
-                PatchValhookMulti(el.type);
-            }
-
-            //action object
-            if (actionObj != undefined) {
-                switch (actionObj["action"]) {
-                    case "isComplete":
-                        $el = $(actionObj["el"]);
-                        var imdata = $el.data('_inputmask-multi'),
-                            activeMask = imdata["elmasks"][imdata["activeMasksetIndex"]];
-                        return $(activeMask).inputmask("isComplete");
-                    case "unmaskedvalue":
-                        $el = actionObj["$input"];
-                        var imdata = $el.data('_inputmask-multi'),
-                            activeMask = imdata["elmasks"][imdata["activeMasksetIndex"]];
-                        return $(activeMask).inputmask("unmaskedvalue");
-                    case "mask":
-                        mask(actionObj["el"]);
-                        break;
-                    case "format": //TODO
-                        $el = $({});
-                        $el.data('_inputmask', {
-                            'maskset': maskset,
-                            'opts': opts,
-                            'isRTL': opts.numericInput
-                        });
-                        if (opts.numericInput) {
-                            isRTL = true;
-                        }
-                        var valueBuffer = actionObj["value"].split('');
-                        checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer, true);
-                        return isRTL ? getBuffer().reverse().join('') : getBuffer().join('');
-                    case "isValid": //TODO
-                        $el = $({});
-                        $el.data('_inputmask', {
-                            'maskset': maskset,
-                            'opts': opts,
-                            'isRTL': opts.numericInput
-                        });
-                        if (opts.numericInput) {
-                            isRTL = true;
-                        }
-                        var valueBuffer = actionObj["value"].split('');
-                        checkVal($el, false, true, isRTL ? valueBuffer.reverse() : valueBuffer);
-                        return isComplete(getBuffer());
-                    case "getemptymask": //TODO
-                        $el = $(actionObj["el"]);
-                        maskset = $el.data('_inputmask')['maskset'];
-                        opts = $el.data('_inputmask')['opts'];
-                        return getBufferTemplate();
-                    case "remove": //TODO
-                        var el = actionObj["el"];
-                        $el = $(el);
-                        maskset = $el.data('_inputmask')['maskset'];
-                        opts = $el.data('_inputmask')['opts'];
-                        //writeout the unmaskedvalue
-                        el._valueSet(unmaskedvalue($el));
-                        //unbind all events
-                        $el.unbind(".inputmask");
-                        $el.removeClass('focus.inputmask');
-                        //clear data
-                        $el.removeData('_inputmask');
-                        //restore the value property
-                        var valueProperty;
-                        if (Object.getOwnPropertyDescriptor)
-                            valueProperty = Object.getOwnPropertyDescriptor(el, "value");
-                        if (valueProperty && valueProperty.get) {
-                            if (el._valueGet) {
-                                Object.defineProperty(el, "value", {
-                                    get: el._valueGet,
-                                    set: el._valueSet
-                                });
-                            }
-                        } else if (document.__lookupGetter__ && el.__lookupGetter__("value")) {
-                            if (el._valueGet) {
-                                el.__defineGetter__("value", el._valueGet);
-                                el.__defineSetter__("value", el._valueSet);
-                            }
-                        }
-                        try { //try catch needed for IE7 as it does not supports deleting fns
-                            delete el._valueGet;
-                            delete el._valueSet;
-                        } catch (e) {
-                            el._valueGet = undefined;
-                            el._valueSet = undefined;
-
-                        }
-                        break;
-                }
-            }
-        };
-
-        $.extend($.inputmask.defaults, {
-            //multi-masks
-            multi: false, //do not alter - internal use
-            nojumps: false, //do not jump over fixed parts in the mask
-            nojumpsThreshold: 0, //start nojumps as of
-            determineActiveMasksetIndex: undefined //override determineActiveMasksetIndex - args => eventType, elmasks - return int
-        });
-
-        $.inputmask._fn = $.fn.inputmask;
-        $.fn.inputmask = function (fn, options) {
-            if (typeof fn === "string") {
-                if ($.inputmask._fn("_detectScope", options, undefined, undefined, fn))
-                    return $.inputmask._fn.call(this, fn, options, multiMaskScope, "_inputmask-multi");
-                else return $.inputmask._fn.call(this, fn, options);
-            } else if (typeof fn == "object") {
-                opts = $.extend(true, {}, $.inputmask.defaults, fn);
-                if ($.inputmask._fn("_detectScope", fn))
-                    return $.inputmask._fn.call(this, fn, options, multiMaskScope, "_inputmask-multi");
-                else return $.inputmask._fn.call(this, fn, options);
-            } else if (fn == undefined)
-                return $.inputmask._fn.call(this, fn, options);
-        };
-    }
-})(jQuery);
+/**
+* @license Input Mask plugin for jquery
+* 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: 0.0.0
+*/
+
+(function ($) {
+    if ($.fn.inputmask != undefined) {
+        function multiMaskScope(actionObj, masksets, opts) {
+            function isInputEventSupported(eventName) {
+                var el = document.createElement('input'),
+                    eventName = 'on' + eventName,
+                    isSupported = (eventName in el);
+                if (!isSupported) {
+                    el.setAttribute(eventName, 'return;');
+                    isSupported = typeof el[eventName] == 'function';
+                }
+                el = null;
+                return isSupported;
+            }
+            var PasteEventType = isInputEventSupported('paste') ? 'paste' : isInputEventSupported('input') ? 'input' : "propertychange",
+                isRTL, el, $el, elmasks, activeMasksetIndex;
+
+            function PatchValhookMulti(type) {
+                if ($.valHooks[type] == undefined || $.valHooks[type].inputmaskmultipatch != true) {
+                    var valueGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function (elem) { return elem.value; };
+                    var valueSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function (elem, value) {
+                        elem.value = value;
+                        return elem;
+                    };
+
+                    $.valHooks[type] = {
+                        get: function (elem) {
+                            var $elem = $(elem);
+                            if ($elem.data('_inputmask-multi')) {
+                                var data = $elem.data('_inputmask-multi');
+                                return valueGet(data["elmasks"][data["activeMasksetIndex"]]);
+                            } else return valueGet(elem);
+                        },
+                        set: function (elem, value) {
+                            var $elem = $(elem);
+                            var result = valueSet(elem, value);
+                            if ($elem.data('_inputmask-multi')) $elem.triggerHandler('setvalue');
+                            return result;
+                        },
+                        inputmaskmultipatch: true
+                    };
+                }
+            }
+
+            function mcaret(input, begin, end) {
+                var npt = input.jquery && input.length > 0 ? input[0] : input, range;
+                if (typeof begin == 'number') {
+                    begin = TranslatePosition(begin);
+                    end = TranslatePosition(end);
+                    end = (typeof end == 'number') ? end : begin;
+
+                    //store caret for multi scope
+                    if (npt != el) {
+                        var data = $(npt).data('_inputmask') || {};
+                        data["caret"] = { "begin": begin, "end": end };
+                        $(npt).data('_inputmask', data);
+                    }
+                    if (!$(npt).is(":visible")) {
+                        return;
+                    }
+
+                    npt.scrollLeft = npt.scrollWidth;
+                    if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
+                    if (npt.setSelectionRange) {
+                        npt.selectionStart = begin;
+                        npt.selectionEnd = end;
+
+                    } else if (npt.createTextRange) {
+                        range = npt.createTextRange();
+                        range.collapse(true);
+                        range.moveEnd('character', end);
+                        range.moveStart('character', begin);
+                        range.select();
+                    }
+                } else {
+                    var data = $(npt).data('_inputmask');
+                    if (!$(npt).is(":visible") && data && data["caret"] != undefined) {
+                        begin = data["caret"]["begin"];
+                        end = data["caret"]["end"];
+                    } else if (npt.setSelectionRange) {
+                        begin = npt.selectionStart;
+                        end = npt.selectionEnd;
+                    } else if (document.selection && document.selection.createRange) {
+                        range = document.selection.createRange();
+                        begin = 0 - range.duplicate().moveStart('character', -100000);
+                        end = begin + range.text.length;
+                    }
+                    begin = TranslatePosition(begin);
+                    end = TranslatePosition(end);
+                    return { "begin": begin, "end": end };
+                }
+            }
+
+            function TranslatePosition(pos) {
+                if (isRTL && typeof pos == 'number' && (!opts.greedy || opts.placeholder != "")) {
+                    var bffrLght = el.value.length;
+                    pos = bffrLght - pos;
+                }
+                return pos;
+            }
+
+            function determineActiveMask(eventType, elmasks) {
+
+                if (eventType != "multiMaskScope") {
+                    if ($.isFunction(opts.determineActiveMasksetIndex))
+                        activeMasksetIndex = opts.determineActiveMasksetIndex.call($el, eventType, elmasks);
+                    else {
+                        var lpc = -1, cp = -1, lvp = -1;;
+                        $.each(elmasks, function (ndx, lmsk) {
+                            var data = $(lmsk).data('_inputmask');
+                            var maskset = data["maskset"];
+                            var lastValidPosition = -1, validPositionCount = 0, caretPos = mcaret(lmsk).begin;
+                            for (var posNdx in maskset["validPositions"]) {
+                                var psNdx = parseInt(posNdx);
+                                if (psNdx > lastValidPosition) lastValidPosition = psNdx;
+                                validPositionCount++;
+                            }
+                            if (validPositionCount > lpc
+                                    || (validPositionCount == lpc && cp > caretPos && lvp > lastValidPosition)
+                                    || (validPositionCount == lpc && cp == caretPos && lvp < lastValidPosition)
+                            ) {
+                                //console.log("lvp " + lastValidPosition + " vpc " + validPositionCount + " caret " + caretPos + " ams " + ndx);
+                                lpc = validPositionCount;
+                                cp = caretPos;
+                                activeMasksetIndex = ndx;
+                                lvp = lastValidPosition;
+                            }
+                        });
+                    }
+
+                    var data = $el.data('_inputmask-multi') || { "activeMasksetIndex": 0, "elmasks": elmasks };
+                    data["activeMasksetIndex"] = activeMasksetIndex;
+                    $el.data('_inputmask-multi', data);
+                }
+
+                if ($.inArray(eventType, ["focus"]) == -1 && el.value != elmasks[activeMasksetIndex]._valueGet()) {
+                    var value = $(elmasks[activeMasksetIndex]).val() == "" ? elmasks[activeMasksetIndex]._valueGet() : $(elmasks[activeMasksetIndex]).val();
+                    el.value = value;
+                }
+                if ($.inArray(eventType, ["blur", "focus"]) == -1) {
+                    if ($(elmasks[activeMasksetIndex]).hasClass("focus.inputmask")) {
+                        var activeCaret = mcaret(elmasks[activeMasksetIndex]);
+                        mcaret(el, activeCaret.begin, activeCaret.end);
+                    }
+                }
+            }
+
+            opts.multi = true;
+
+            function mask(npt) {
+                el = npt;
+                $el = $(el);
+                isRTL = el.dir == "rtl" || opts.numericInput;
+                activeMasksetIndex = 0;
+                elmasks = $.map(masksets, function (msk, ndx) {
+                    var elMaskStr = '<input type="text" ';
+                    if ($el.attr("value")) elMaskStr += 'value="' + $el.attr("value") + '" ';
+                    if ($el.attr("dir")) elMaskStr += 'dir="' + $el.attr("dir") + '" ';
+                    elMaskStr += '/>';
+                    var elmask = $(elMaskStr)[0];
+                    $(elmask).inputmask($.extend({}, opts, { mask: msk.mask }));
+                    return elmask;
+                });
+
+                $el.data('_inputmask-multi', { "activeMasksetIndex": 0, "elmasks": elmasks });
+                if (el.dir == "rtl" || opts.rightAlign)
+                    $el.css("text-align", "right");
+                el.dir = "ltr";
+                $el.removeAttr("dir");
+                if ($el.attr("value") != "") {
+                    determineActiveMask("init", elmasks);
+                }
+
+                $el.bind("mouseenter blur focus mouseleave click dblclick keydown keypress keypress", function (e) {
+                    var caretPos = mcaret(el), k, goDetermine = true;
+                    if (e.type == "keydown") {
+                        k = e.keyCode;
+                        if (k == opts.keyCode.DOWN && activeMasksetIndex < elmasks.length - 1) {
+                            activeMasksetIndex++;
+                            determineActiveMask("multiMaskScope", elmasks);
+                            return false;
+                        } else if (k == opts.keyCode.UP && activeMasksetIndex > 0) {
+                            activeMasksetIndex--;
+                            determineActiveMask("multiMaskScope", elmasks);
+                            return false;
+                        }
+                        if (e.ctrlKey || e.shiftKey || e.altKey) {
+                            return true;
+                        }
+                    } else if (e.type == "keypress" && (e.ctrlKey || e.shiftKey || e.altKey)) {
+                        return true;
+                    }
+                    $.each(elmasks, function (ndx, lmnt) {
+                        if (e.type == "keydown") {
+                            k = e.keyCode;
+
+                            if (k == opts.keyCode.BACKSPACE && lmnt._valueGet().length < caretPos.begin) {
+                                return;
+                            } else if (k == opts.keyCode.TAB) {
+                                goDetermine = false;
+                            } else if (k == opts.keyCode.RIGHT) {
+                                mcaret(lmnt, caretPos.begin + 1, caretPos.end + 1);
+                                goDetermine = false;
+                                return;
+                            } else if (k == opts.keyCode.LEFT) {
+                                mcaret(lmnt, caretPos.begin - 1, caretPos.end - 1);
+                                goDetermine = false;
+                                return;
+                            }
+                        }
+                        if ($.inArray(e.type, ["click"]) != -1) {
+                            mcaret(lmnt, TranslatePosition(caretPos.begin), TranslatePosition(caretPos.end));
+                            if (caretPos.begin != caretPos.end) {
+                                goDetermine = false;
+                                return;
+                            }
+                        }
+
+                        if ($.inArray(e.type, ["keydown"]) != -1 && caretPos.begin != caretPos.end) {
+                            mcaret(lmnt, caretPos.begin, caretPos.end);
+                        }
+
+                        $(lmnt).triggerHandler(e);
+                    });
+                    if (goDetermine) {
+                        setTimeout(function () {
+                            determineActiveMask(e.type, elmasks);
+                        }, 0);
+                    }
+                });
+                $el.bind(PasteEventType + " dragdrop drop setvalue", function (e) {
+                    var caretPos = mcaret(el);
+                    setTimeout(function () {
+                        $.each(elmasks, function (ndx, lmnt) {
+                            lmnt._valueSet(el.value);
+                            $(lmnt).triggerHandler(e);
+                        });
+                        setTimeout(function () {
+                            determineActiveMask(e.type, elmasks);
+                        }, 0);
+                    }, 0);
+                });
+                PatchValhookMulti(el.type);
+            }
+
+            //action object
+            if (actionObj != undefined) {
+                switch (actionObj["action"]) {
+                    case "isComplete":
+                        $el = $(actionObj["el"]);
+                        var imdata = $el.data('_inputmask-multi'),
+                            activeMask = imdata["elmasks"][imdata["activeMasksetIndex"]];
+                        return $(activeMask).inputmask("isComplete");
+                    case "unmaskedvalue":
+                        $el = actionObj["$input"];
+                        var imdata = $el.data('_inputmask-multi'),
+                            activeMask = imdata["elmasks"][imdata["activeMasksetIndex"]];
+                        return $(activeMask).inputmask("unmaskedvalue");
+                    case "mask":
+                        mask(actionObj["el"]);
+                        break;
+                    case "format": //TODO
+                        $el = $({});
+                        $el.data('_inputmask', {
+                            'maskset': maskset,
+                            'opts': opts,
+                            'isRTL': opts.numericInput
+                        });
+                        if (opts.numericInput) {
+                            isRTL = true;
+                        }
+                        var valueBuffer = actionObj["value"].split('');
+                        checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer, true);
+                        return isRTL ? getBuffer().reverse().join('') : getBuffer().join('');
+                    case "isValid": //TODO
+                        $el = $({});
+                        $el.data('_inputmask', {
+                            'maskset': maskset,
+                            'opts': opts,
+                            'isRTL': opts.numericInput
+                        });
+                        if (opts.numericInput) {
+                            isRTL = true;
+                        }
+                        var valueBuffer = actionObj["value"].split('');
+                        checkVal($el, false, true, isRTL ? valueBuffer.reverse() : valueBuffer);
+                        return isComplete(getBuffer());
+                    case "getemptymask": //TODO
+                        $el = $(actionObj["el"]);
+                        maskset = $el.data('_inputmask')['maskset'];
+                        opts = $el.data('_inputmask')['opts'];
+                        return getBufferTemplate();
+                    case "remove": //TODO
+                        var el = actionObj["el"];
+                        $el = $(el);
+                        maskset = $el.data('_inputmask')['maskset'];
+                        opts = $el.data('_inputmask')['opts'];
+                        //writeout the unmaskedvalue
+                        el._valueSet(unmaskedvalue($el));
+                        //unbind all events
+                        $el.unbind(".inputmask");
+                        $el.removeClass('focus.inputmask');
+                        //clear data
+                        $el.removeData('_inputmask');
+                        //restore the value property
+                        var valueProperty;
+                        if (Object.getOwnPropertyDescriptor)
+                            valueProperty = Object.getOwnPropertyDescriptor(el, "value");
+                        if (valueProperty && valueProperty.get) {
+                            if (el._valueGet) {
+                                Object.defineProperty(el, "value", {
+                                    get: el._valueGet,
+                                    set: el._valueSet
+                                });
+                            }
+                        } else if (document.__lookupGetter__ && el.__lookupGetter__("value")) {
+                            if (el._valueGet) {
+                                el.__defineGetter__("value", el._valueGet);
+                                el.__defineSetter__("value", el._valueSet);
+                            }
+                        }
+                        try { //try catch needed for IE7 as it does not supports deleting fns
+                            delete el._valueGet;
+                            delete el._valueSet;
+                        } catch (e) {
+                            el._valueGet = undefined;
+                            el._valueSet = undefined;
+
+                        }
+                        break;
+                }
+            }
+        };
+
+        $.extend($.inputmask.defaults, {
+            //multi-masks
+            multi: false, //do not alter - internal use
+            nojumps: false, //do not jump over fixed parts in the mask
+            nojumpsThreshold: 0, //start nojumps as of
+            determineActiveMasksetIndex: undefined //override determineActiveMasksetIndex - args => eventType, elmasks - return int
+        });
+
+        $.inputmask._fn = $.fn.inputmask;
+        $.fn.inputmask = function (fn, options) {
+            if (typeof fn === "string") {
+                if ($.inputmask._fn("_detectScope", options, undefined, undefined, fn))
+                    return $.inputmask._fn.call(this, fn, options, multiMaskScope, "_inputmask-multi");
+                else return $.inputmask._fn.call(this, fn, options);
+            } else if (typeof fn == "object") {
+                opts = $.extend(true, {}, $.inputmask.defaults, fn);
+                if ($.inputmask._fn("_detectScope", fn))
+                    return $.inputmask._fn.call(this, fn, options, multiMaskScope, "_inputmask-multi");
+                else return $.inputmask._fn.call(this, fn, options);
+            } else if (fn == undefined)
+                return $.inputmask._fn.call(this, fn, options);
+        };
+    }
+})(jQuery);

文件差异内容过多而无法显示
+ 1637 - 1637
js/jquery.inputmask.js


+ 1 - 1
js/jquery.inputmask.numeric.extensions.js

@@ -103,7 +103,7 @@ Optional extensions on the jquery.inputmask base
             definitions: {
                 '~': {
                     validator: function (chrs, buffer, pos, strict, opts) {
-                        if (!strict && chrs === "-") {
+                        if (!strict && opts.allowMinus && chrs === "-") {
                             var matchRslt = buffer.join('').match(opts.regex.integerPart(opts));
 
                             if (matchRslt.length > 0) {

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

@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
-    <metadata>
-        <id>jQuery.InputMask</id>
-        <version>0.0.0</version>
-        <title>jQuery Input Mask</title>
-        <authors>Robin Herbots</authors>
-        <owners>Robin Herbots</owners>
-        <licenseUrl>http://opensource.org/licenses/mit-license.php</licenseUrl>
-        <projectUrl>https://github.com/RobinHerbots/jquery.inputmask</projectUrl>
-        <requireLicenseAcceptance>true</requireLicenseAcceptance>
-		<summary>jquery.inputmask is a jquery plugin which create an input mask.</summary>
-        <description>jquery.inputmask is a jquery plugin which create an input mask.
-
-An inputmask helps the user with the input by ensuring a predefined format. This can be useful for dates, numerics, phone numbers, ...
-
-Highlights:
-- easy to use
-- optional parts anywere in the mask
-- possibility to define aliases which hide complexity
-- date / datetime masks
-- numeric masks
-- lots of callbacks
-- non-greedy masks
-- many features can be enabled/disabled/configured by options
-- supports readonly/disabled/dir="rtl" attributes
-- support data-inputmask attribute
-- multi-mask support
-- regex-mask support
-- value formatting without input element
-</description>
-        <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-multi.js" target="content/Scripts/jquery.inputmask/jquery.inputmask-multi-0.0.0.js" />
-    </files>
-</package>
+<?xml version="1.0" encoding="utf-8"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+    <metadata>
+        <id>jQuery.InputMask</id>
+        <version>0.0.0</version>
+        <title>jQuery Input Mask</title>
+        <authors>Robin Herbots</authors>
+        <owners>Robin Herbots</owners>
+        <licenseUrl>http://opensource.org/licenses/mit-license.php</licenseUrl>
+        <projectUrl>https://github.com/RobinHerbots/jquery.inputmask</projectUrl>
+        <requireLicenseAcceptance>true</requireLicenseAcceptance>
+		<summary>jquery.inputmask is a jquery plugin which create an input mask.</summary>
+        <description>jquery.inputmask is a jquery plugin which create an input mask.
+
+An inputmask helps the user with the input by ensuring a predefined format. This can be useful for dates, numerics, phone numbers, ...
+
+Highlights:
+- easy to use
+- optional parts anywere in the mask
+- possibility to define aliases which hide complexity
+- date / datetime masks
+- numeric masks
+- lots of callbacks
+- non-greedy masks
+- many features can be enabled/disabled/configured by options
+- supports readonly/disabled/dir="rtl" attributes
+- support data-inputmask attribute
+- multi-mask support
+- regex-mask support
+- value formatting without input element
+</description>
+        <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-multi.js" target="content/Scripts/jquery.inputmask/jquery.inputmask-multi-0.0.0.js" />
+    </files>
+</package>

+ 43 - 43
nuget/jquery.inputmask.nuspec

@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
-    <metadata>
-        <id>jQuery.InputMask</id>
-        <version>0.0.0</version>
-        <title>jQuery Input Mask</title>
-        <authors>Robin Herbots</authors>
-        <owners>Robin Herbots</owners>
-        <licenseUrl>http://opensource.org/licenses/mit-license.php</licenseUrl>
-        <projectUrl>https://github.com/RobinHerbots/jquery.inputmask</projectUrl>
-        <requireLicenseAcceptance>true</requireLicenseAcceptance>
-		<summary>jquery.inputmask is a jquery plugin which create an input mask.</summary>
-        <description>jquery.inputmask is a jquery plugin which create an input mask.
-
-An inputmask helps the user with the input by ensuring a predefined format. This can be useful for dates, numerics, phone numbers, ...
-
-Highlights:
-- easy to use
-- optional parts anywere in the mask
-- possibility to define aliases which hide complexity
-- date / datetime masks
-- numeric masks
-- lots of callbacks
-- non-greedy masks
-- many features can be enabled/disabled/configured by options
-- supports readonly/disabled/dir="rtl" attributes
-- support data-inputmask attribute
-- multi-mask support
-- regex-mask support
-- value formatting without input element
-</description>
-        <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-multi.js" target="content\Scripts\jquery.inputmask\jquery.inputmask-multi-0.0.0.js" />
-    </files>
-</package>
+<?xml version="1.0" encoding="utf-8"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+    <metadata>
+        <id>jQuery.InputMask</id>
+        <version>0.0.0</version>
+        <title>jQuery Input Mask</title>
+        <authors>Robin Herbots</authors>
+        <owners>Robin Herbots</owners>
+        <licenseUrl>http://opensource.org/licenses/mit-license.php</licenseUrl>
+        <projectUrl>https://github.com/RobinHerbots/jquery.inputmask</projectUrl>
+        <requireLicenseAcceptance>true</requireLicenseAcceptance>
+		<summary>jquery.inputmask is a jquery plugin which create an input mask.</summary>
+        <description>jquery.inputmask is a jquery plugin which create an input mask.
+
+An inputmask helps the user with the input by ensuring a predefined format. This can be useful for dates, numerics, phone numbers, ...
+
+Highlights:
+- easy to use
+- optional parts anywere in the mask
+- possibility to define aliases which hide complexity
+- date / datetime masks
+- numeric masks
+- lots of callbacks
+- non-greedy masks
+- many features can be enabled/disabled/configured by options
+- supports readonly/disabled/dir="rtl" attributes
+- support data-inputmask attribute
+- multi-mask support
+- regex-mask support
+- value formatting without input element
+</description>
+        <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-multi.js" target="content\Scripts\jquery.inputmask\jquery.inputmask-multi-0.0.0.js" />
+    </files>
+</package>

+ 17 - 17
qunit/qunit.html

@@ -1,17 +1,17 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>jquery.inputmask - QUnit</title>
-  <link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.14.0.css">
-</head>
-<body>
-  <div id="qunit"></div>
-  <div id="qunit-fixture"></div>
-  <script src="http://code.jquery.com/jquery-1.11.0.js"></script>
-  <script src="http://code.jquery.com/qunit/qunit-1.14.0.js"></script>
-  <script src="../dist/jquery.inputmask.bundle.js"></script>
-  <script src="./simulator.js"></script>
-  <script src="./tests.js"></script>
-</body>
-</html>
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>jquery.inputmask - QUnit</title>
+  <link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.14.0.css">
+</head>
+<body>
+  <div id="qunit"></div>
+  <div id="qunit-fixture"></div>
+  <script src="http://code.jquery.com/jquery-1.11.0.js"></script>
+  <script src="http://code.jquery.com/qunit/qunit-1.14.0.js"></script>
+  <script src="../dist/jquery.inputmask.bundle.js"></script>
+  <script src="./simulator.js"></script>
+  <script src="./tests.js"></script>
+</body>
+</html>

+ 96 - 96
qunit/simulator.js

@@ -1,97 +1,97 @@
-var keyCodes = {
-    ALT: 18, BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, COMMAND: 91, COMMAND_LEFT: 91, COMMAND_RIGHT: 93, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, MENU: 93, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108,
-    NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38, WINDOWS: 91
-}
-function caret(input, begin, end) {
-    var npt = input.jquery && input.length > 0 ? input[0] : input, range;
-    if (typeof begin == 'number') {
-        if (!$(input).is(':visible')) {
-            return;
-        }
-        end = (typeof end == 'number') ? end : begin;
-        if (npt.setSelectionRange) {
-            npt.selectionStart = begin;
-            npt.selectionEnd = end;
-
-        } else if (npt.createTextRange) {
-            range = npt.createTextRange();
-            range.collapse(true);
-            range.moveEnd('character', end);
-            range.moveStart('character', begin);
-            range.select();
-        }
-    } else {
-        if (!$(input).is(':visible')) {
-            return { "begin": 0, "end": 0 };
-        }
-        if (npt.setSelectionRange) {
-            begin = npt.selectionStart;
-            end = npt.selectionEnd;
-        } else if (document.selection && document.selection.createRange) {
-            range = document.selection.createRange();
-            begin = 0 - range.duplicate().moveStart('character', -100000);
-            end = begin + range.text.length;
-        }
-        return { "begin": begin, "end": end };
-    }
-};
-$.fn.SendKey = function (keyCode, modifier) {
-    var sendDummyKeydown = false;
-    if (Object.prototype.toString.call(keyCode) == '[object String]') {
-        keyCode = keyCode.charCodeAt(0);
-        sendDummyKeydown = true;
-    }
-
-    switch (keyCode) {
-        case keyCodes.LEFT: {
-            if (modifier == undefined) {
-                var pos = caret(this);
-                caret(this, pos.begin - 1);
-                break;
-            }
-        }
-        case keyCodes.RIGHT: {
-            if (modifier == undefined) {
-                var pos = caret(this);
-                caret(this, pos.begin + 1);
-                break;
-            }
-        }
-        default: {
-            var keydown = $.Event("keydown"),
-                keypress = $.Event("keypress"),
-                keyup = $.Event("keyup");
-
-            if (!sendDummyKeydown) {
-                keydown.keyCode = keyCode;
-                if (modifier == keyCodes.CONTROL)
-                    keydown.ctrlKey = true;
-            }
-            $(this).trigger(keydown);
-            if (!keydown.isDefaultPrevented()) {
-                keypress.keyCode = keyCode;
-                if (modifier == keyCodes.CONTROL)
-                    keypress.ctrlKey = true;
-                $(this).trigger(keypress);
-                if (!keypress.isDefaultPrevented()) {
-                    keyup.keyCode = keyCode;
-                    if (modifier == keyCodes.CONTROL)
-                        keyup.ctrlKey = true;
-                    $(this).trigger(keyup);
-                }
-            }
-        }
-    }
-}
-$.fn.Type = function (inputStr) {
-    var $input = $(this);
-    $.each(inputStr.split(''), function (ndx, lmnt) {
-        $input.SendKey(lmnt);
-    });
-}
-
-$.fn.paste = function (inputStr) {
-    var $input = $(this);
-    $input[0]._valueSet(inputStr);
-    $input.trigger('paste');
+var keyCodes = {
+    ALT: 18, BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, COMMAND: 91, COMMAND_LEFT: 91, COMMAND_RIGHT: 93, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, MENU: 93, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108,
+    NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38, WINDOWS: 91
+}
+function caret(input, begin, end) {
+    var npt = input.jquery && input.length > 0 ? input[0] : input, range;
+    if (typeof begin == 'number') {
+        if (!$(input).is(':visible')) {
+            return;
+        }
+        end = (typeof end == 'number') ? end : begin;
+        if (npt.setSelectionRange) {
+            npt.selectionStart = begin;
+            npt.selectionEnd = end;
+
+        } else if (npt.createTextRange) {
+            range = npt.createTextRange();
+            range.collapse(true);
+            range.moveEnd('character', end);
+            range.moveStart('character', begin);
+            range.select();
+        }
+    } else {
+        if (!$(input).is(':visible')) {
+            return { "begin": 0, "end": 0 };
+        }
+        if (npt.setSelectionRange) {
+            begin = npt.selectionStart;
+            end = npt.selectionEnd;
+        } else if (document.selection && document.selection.createRange) {
+            range = document.selection.createRange();
+            begin = 0 - range.duplicate().moveStart('character', -100000);
+            end = begin + range.text.length;
+        }
+        return { "begin": begin, "end": end };
+    }
+};
+$.fn.SendKey = function (keyCode, modifier) {
+    var sendDummyKeydown = false;
+    if (Object.prototype.toString.call(keyCode) == '[object String]') {
+        keyCode = keyCode.charCodeAt(0);
+        sendDummyKeydown = true;
+    }
+
+    switch (keyCode) {
+        case keyCodes.LEFT: {
+            if (modifier == undefined) {
+                var pos = caret(this);
+                caret(this, pos.begin - 1);
+                break;
+            }
+        }
+        case keyCodes.RIGHT: {
+            if (modifier == undefined) {
+                var pos = caret(this);
+                caret(this, pos.begin + 1);
+                break;
+            }
+        }
+        default: {
+            var keydown = $.Event("keydown"),
+                keypress = $.Event("keypress"),
+                keyup = $.Event("keyup");
+
+            if (!sendDummyKeydown) {
+                keydown.keyCode = keyCode;
+                if (modifier == keyCodes.CONTROL)
+                    keydown.ctrlKey = true;
+            }
+            $(this).trigger(keydown);
+            if (!keydown.isDefaultPrevented()) {
+                keypress.keyCode = keyCode;
+                if (modifier == keyCodes.CONTROL)
+                    keypress.ctrlKey = true;
+                $(this).trigger(keypress);
+                if (!keypress.isDefaultPrevented()) {
+                    keyup.keyCode = keyCode;
+                    if (modifier == keyCodes.CONTROL)
+                        keyup.ctrlKey = true;
+                    $(this).trigger(keyup);
+                }
+            }
+        }
+    }
+}
+$.fn.Type = function (inputStr) {
+    var $input = $(this);
+    $.each(inputStr.split(''), function (ndx, lmnt) {
+        $input.SendKey(lmnt);
+    });
+}
+
+$.fn.paste = function (inputStr) {
+    var $input = $(this);
+    $input[0]._valueSet(inputStr);
+    $input.trigger('paste');
 }

文件差异内容过多而无法显示
+ 2412 - 2376
qunit/tests.js


+ 202 - 202
tools/COPYING

@@ -1,202 +1,202 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.