Browse Source

separate jquery plugincode from inputmask core

Robin Herbots 10 years ago
parent
commit
52c59a2d12

+ 2 - 0
CHANGELOG.md

@@ -4,9 +4,11 @@ All notable changes to this project will be documented in this file.
 ## [Unreleased]
 
 ### Updates
+- separate jquery plugin code from the inputmask core (first step to remove jquery dependency from the inputmask core)
 - Update placeholder handling
 
 ### Fixed
+- Can't delete digits after decimal point on negative numbers #892
 - decimal : extra number after delete and typing new numbers #904
 - Dynamic masks with {*} and zero repeats #875
 - Mask does not alternate back after deleting digit #905

+ 148 - 124
Gruntfile.js

@@ -1,140 +1,164 @@
-module.exports = function (grunt) {
-    function createBanner(fileName) {
-        return '/*!\n' +
-            '* ' + fileName + '\n' +
-            '* http://github.com/RobinHerbots/jquery.inputmask\n' +
-            '* Copyright (c) 2010 - <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
-            '* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n' +
-            '* Version: <%= pkg.version %>\n' +
-            '*/\n';
-    }
-
-    function createUglifyConfig(path) {
-        var uglifyConfig = {};
-        var srcFiles = grunt.file.expand(path + "/*.js");
-        for (var srcNdx in srcFiles) {
-            var dstFile = srcFiles[srcNdx].replace("js/", ""),
-                dstFileMin = dstFile.replace(".js", ".min.js");
-            wrapModuleLoaders(srcFiles[srcNdx], "build/" + dstFile, dstFile.indexOf("extension") == -1 ? ["jquery"] : ["jquery", "./jquery.inputmask"]);
-            uglifyConfig[dstFile] = {
-                dest: 'dist/inputmask/' + dstFile,
-                src: "build/" + dstFile,
-                options: { banner: createBanner(dstFile), beautify: true, mangle: false, preserveComments: "some", ASCIIOnly: true }
-            };
-            uglifyConfig[dstFileMin] = {
-                dest: 'dist/inputmask/' + dstFileMin,
-                src: "build/" + dstFile,
-                options: { banner: createBanner(dstFileMin), preserveComments: "some", ASCIIOnly: true }
-            };
-        }
+module.exports = function(grunt) {
+  function createBanner(fileName) {
+    return '/*!\n' +
+      '* ' + fileName + '\n' +
+      '* http://github.com/RobinHerbots/jquery.inputmask\n' +
+      '* Copyright (c) 2010 - <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
+      '* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n' +
+      '* Version: <%= pkg.version %>\n' +
+      '*/\n';
+  }
 
-        srcFiles = grunt.file.expand(path + "/*.extensions.js");
-        srcFiles.splice(0, 0, "js/jquery.inputmask.js");
-        uglifyConfig["inputmaskbundle"] = {
-            files: {
-                'dist/<%= pkg.name %>.bundle.js': srcFiles
-            },
-            options: { banner: createBanner('<%= pkg.name %>.bundle'), beautify: true, mangle: false, preserveComments: "some", ASCIIOnly: true }
+  function createUglifyConfig(path) {
+    var uglifyConfig = {};
+    var srcFiles = grunt.file.expand(path + "/*.js");
+    for (var srcNdx in srcFiles) {
+      var dstFile = srcFiles[srcNdx].replace("js/", ""),
+        dstFileMin = dstFile.replace(".js", ".min.js");
+      wrapModuleLoaders(srcFiles[srcNdx], "build/" + dstFile, dstFile.indexOf("jquery") == -1 ? ["jquery"] : (dstFile.indexOf("extension") == -1 ? ["jquery", "./inputmask"] : ["jquery", "./inputmask", "./jquery.inputmask"]));
+      uglifyConfig[dstFile] = {
+        dest: 'dist/inputmask/' + dstFile,
+        src: "build/" + dstFile,
+        options: {
+          banner: createBanner(dstFile),
+          beautify: true,
+          mangle: false,
+          preserveComments: "some",
+          ASCIIOnly: true
         }
-        uglifyConfig["inputmaskbundlemin"] = {
-            files: {
-                'dist/<%= pkg.name %>.bundle.min.js': srcFiles
-            },
-            options: { banner: createBanner('<%= pkg.name %>.bundle'), preserveComments: "some", ASCIIOnly: true }
+      };
+      uglifyConfig[dstFileMin] = {
+        dest: 'dist/inputmask/' + dstFileMin,
+        src: "build/" + dstFile,
+        options: {
+          banner: createBanner(dstFileMin),
+          preserveComments: "some",
+          ASCIIOnly: true
         }
-        return uglifyConfig;
+      };
     }
-    function wrapModuleLoaders(src, dst, dependencies) {
-        function stripClosureExecution() {
-            return srcFile.replace(new RegExp("\\(jQuery\\)[\\s\\S]*$"), "");
-        }
 
-        function createCommonJsRequires(dependencies) {
-            var res = [];
+    srcFiles = grunt.file.expand(path + "/*.extensions.js");
+    srcFiles.splice(0, 0, "js/jquery.inputmask.js");
+    srcFiles.splice(0, 0, "js/inputmask.js");
+    uglifyConfig["inputmaskbundle"] = {
+      files: {
+        'dist/<%= pkg.name %>.bundle.js': srcFiles
+      },
+      options: {
+        banner: createBanner('<%= pkg.name %>.bundle'),
+        beautify: true,
+        mangle: false,
+        preserveComments: "some",
+        ASCIIOnly: true
+      }
+    }
+    uglifyConfig["inputmaskbundlemin"] = {
+      files: {
+        'dist/<%= pkg.name %>.bundle.min.js': srcFiles
+      },
+      options: {
+        banner: createBanner('<%= pkg.name %>.bundle'),
+        preserveComments: "some",
+        ASCIIOnly: true
+      }
+    }
+    return uglifyConfig;
+  }
 
-            dependencies.forEach(function (dep) {
-                res.push("require('" + dep + "')");
-            });
+  function wrapModuleLoaders(src, dst, dependencies) {
+    function stripClosureExecution() {
+      return srcFile.replace(new RegExp("\\(jQuery\\)[\\s\\S]*$"), "");
+    }
 
-            return res.join(", ");
-        }
+    function createCommonJsRequires(dependencies) {
+      var res = [];
+
+      dependencies.forEach(function(dep) {
+        res.push("require('" + dep + "')");
+      });
 
-        var srcFile = grunt.file.read(src),
-            dstContent = "(function (factory) {" +
-                "if (typeof define === 'function' && define.amd) {" +
-                "define(" + JSON.stringify(dependencies) + ", factory);" +
-                "} else if (typeof exports === 'object') {" +
-                "module.exports = factory(" + createCommonJsRequires(dependencies) + ");" +
-                "} else {" +
-                "factory(jQuery);" +
-                "}}\n" + stripClosureExecution() + ");";
-        grunt.file.write(dst, dstContent);
+      return res.join(", ");
     }
 
-    // Project configuration.
-    grunt.initConfig({
-        pkg: grunt.file.readJSON('package.json'),
-        uglify: createUglifyConfig("js"),
-        clean: ["dist"],
-        qunit: {
-            files: ['qunit/qunit.html']
-        },
-        bump: {
-            options: {
-                files: ['package.json', 'bower.json', 'composer.json', 'component.json'],
-                updateConfigs: ['pkg'],
-                commit: false,
-                createTag: false,
-                push: false
-            }
-        },
-        release: {
-            options: {
-                bump: false,
-                commitMessage: 'jquery.inputmask <%= version %>'
-            }
-        },
-        nugetpack: {
-            dist: {
-                src: function () { return process.platform === "linux" ? 'nuspecs/jquery.inputmask.linux.nuspec' : 'nuspecs/jquery.inputmask.nuspec'; }(),
-                dest: 'dist/',
-                options: {
-                    version: '<%= pkg.version %>'
-                }
-            }
-        },
-        nugetpush: {
-            dist: {
-                src: 'dist/jQuery.InputMask.<%= pkg.version %>.nupkg'
-            }
-        },
-        shell: {
-            options: {
-                stderr: false
-            },
-            gitcommitchanges: {
-                command: ['git add .',
-                    'git reset -- package.json',
-                    'git commit -m "jquery.inputmask <%= pkg.version %>"'
-                ].join('&&')
-            }
+    var srcFile = grunt.file.read(src),
+      dstContent = "(function (factory) {" +
+      "if (typeof define === 'function' && define.amd) {" +
+      "define(" + JSON.stringify(dependencies) + ", factory);" +
+      "} else if (typeof exports === 'object') {" +
+      "module.exports = factory(" + createCommonJsRequires(dependencies) + ");" +
+      "} else {" +
+      "factory(jQuery);" +
+      "}}\n" + stripClosureExecution() + ");";
+    grunt.file.write(dst, dstContent);
+  }
+
+  // Project configuration.
+  grunt.initConfig({
+    pkg: grunt.file.readJSON('package.json'),
+    uglify: createUglifyConfig("js"),
+    clean: ["dist"],
+    qunit: {
+      files: ['qunit/qunit.html']
+    },
+    bump: {
+      options: {
+        files: ['package.json', 'bower.json', 'composer.json', 'component.json'],
+        updateConfigs: ['pkg'],
+        commit: false,
+        createTag: false,
+        push: false
+      }
+    },
+    release: {
+      options: {
+        bump: false,
+        commitMessage: 'jquery.inputmask <%= version %>'
+      }
+    },
+    nugetpack: {
+      dist: {
+        src: function() {
+          return process.platform === "linux" ? 'nuspecs/jquery.inputmask.linux.nuspec' : 'nuspecs/jquery.inputmask.nuspec';
+        }(),
+        dest: 'dist/',
+        options: {
+          version: '<%= pkg.version %>'
         }
-    });
+      }
+    },
+    nugetpush: {
+      dist: {
+        src: 'dist/jQuery.InputMask.<%= pkg.version %>.nupkg'
+      }
+    },
+    shell: {
+      options: {
+        stderr: false
+      },
+      gitcommitchanges: {
+        command: ['git add .',
+          'git reset -- package.json',
+          'git commit -m "jquery.inputmask <%= pkg.version %>"'
+        ].join('&&')
+      }
+    }
+  });
 
-    // Load the plugin that provides the tasks.
-    grunt.loadNpmTasks('grunt-contrib-uglify');
-    grunt.loadNpmTasks('grunt-contrib-clean');
-    grunt.loadNpmTasks('grunt-contrib-qunit');
-    grunt.loadNpmTasks('grunt-bump');
-    grunt.loadNpmTasks('grunt-release');
-    grunt.loadNpmTasks('grunt-nuget');
-    grunt.loadNpmTasks('grunt-shell');
+  // Load the plugin that provides the tasks.
+  grunt.loadNpmTasks('grunt-contrib-uglify');
+  grunt.loadNpmTasks('grunt-contrib-clean');
+  grunt.loadNpmTasks('grunt-contrib-qunit');
+  grunt.loadNpmTasks('grunt-bump');
+  grunt.loadNpmTasks('grunt-release');
+  grunt.loadNpmTasks('grunt-nuget');
+  grunt.loadNpmTasks('grunt-shell');
 
-    grunt.registerTask('publish:patch', ['clean', 'bump:patch', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
-    grunt.registerTask('publish:minor', ['clean', 'bump:minor', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
-    grunt.registerTask('publish:major', ['clean', 'bump:major', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
+  grunt.registerTask('publish:patch', ['clean', 'bump:patch', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
+  grunt.registerTask('publish:minor', ['clean', 'bump:minor', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
+  grunt.registerTask('publish:major', ['clean', 'bump:major', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
 
-    // Default task(s).
-    grunt.registerTask('default', ['bump:prerelease','clean', 'uglify']);
+  // Default task(s).
+  grunt.registerTask('default', ['bump:prerelease', 'clean', 'uglify']);
 
 };

+ 4 - 2
README.md

@@ -38,10 +38,11 @@ Include the js-files which you can find in the dist-folder. You have the bundled
 
 If you use a module loader like requireJS, use the js-files in dist/inputmask
 
-The minimum to include is the jquery.inputmask.js
+The minimum to include is inputmask.js && jquery.inputmask.js
 
 ```html
 <script src="jquery.js" type="text/javascript"></script>
+<script src="inputmask.js" type="text/javascript"></script>
 <script src="jquery.inputmask.js" type="text/javascript"></script>
 ```
 
@@ -944,7 +945,8 @@ PM> Install-Package jQuery.InputMask
 In App_Start, BundleConfig.cs
 ```c#
 bundles.Add(new ScriptBundle("~/bundles/inputmask").Include(
-                        "~/Scripts/jquery.inputmask/jquery.inputmask.js",
+            "~/Scripts/jquery.inputmask/inputmask.js",
+            "~/Scripts/jquery.inputmask/jquery.inputmask.js",
 						"~/Scripts/jquery.inputmask/jquery.inputmask.extensions.js",
 						"~/Scripts/jquery.inputmask/jquery.inputmask.date.extensions.js",
 						//and other extensions you want to include

+ 1 - 1
bower.json

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

+ 1 - 1
component.json

@@ -2,7 +2,7 @@
     "name": "jquery_inputmask",
     "repository": "robinherbots/jquery.inputmask",
     "description": "jquery.inputmask is a jquery plugin which create an input mask.",
-    "version": "3.1.64-24",
+    "version": "3.1.64-45",
     "keywords": [ "jquery", "plugins", "input", "form", "inputmask", "mask" ],
     "main": "./dist/jquery.inputmask.bundle.js",
     "scripts": [

+ 1 - 1
composer.json

@@ -1,7 +1,7 @@
 {
     "name": "robinherbots/jquery.inputmask",
     "description": "jquery.inputmask is a jquery plugin which create an input mask.",
-	"version": "3.1.64-24",
+	"version": "3.1.64-45",
     "type": "library",
     "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
     "homepage": "http://robinherbots.github.io/jquery.inputmask",

+ 2 - 2
dist/inputmask/jquery.inputmask.date.extensions.js

@@ -3,10 +3,10 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-24
+* Version: 3.1.64-45
 */
 !function(factory) {
-    "function" == typeof define && define.amd ? define([ "jquery", "./jquery.inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./jquery.inputmask")) : factory(jQuery);
+    "function" == typeof define && define.amd ? define([ "jquery", "./inputmask", "./jquery.inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask"), require("./jquery.inputmask")) : factory(jQuery);
 }(function($) {
     return $.extend($.inputmask.defaults.definitions, {
         h: {

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


+ 2 - 2
dist/inputmask/jquery.inputmask.extensions.js

@@ -3,10 +3,10 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-24
+* Version: 3.1.64-45
 */
 !function(factory) {
-    "function" == typeof define && define.amd ? define([ "jquery", "./jquery.inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./jquery.inputmask")) : factory(jQuery);
+    "function" == typeof define && define.amd ? define([ "jquery", "./inputmask", "./jquery.inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask"), require("./jquery.inputmask")) : factory(jQuery);
 }(function($) {
     return $.extend($.inputmask.defaults.definitions, {
         A: {

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


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


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


+ 4 - 4
dist/inputmask/jquery.inputmask.numeric.extensions.js

@@ -3,10 +3,10 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-24
+* Version: 3.1.64-45
 */
 !function(factory) {
-    "function" == typeof define && define.amd ? define([ "jquery", "./jquery.inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./jquery.inputmask")) : factory(jQuery);
+    "function" == typeof define && define.amd ? define([ "jquery", "./inputmask", "./jquery.inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask"), require("./jquery.inputmask")) : factory(jQuery);
 }(function($) {
     return $.extend($.inputmask.defaults.aliases, {
         numeric: {
@@ -79,8 +79,8 @@
                 needsRefresh = bufValOrigin != bufVal, buffer.length = bufVal.length;
                 for (var i = 0, l = bufVal.length; l > i; i++) buffer[i] = bufVal.charAt(i);
                 var newPos = $.inArray("?", buffer);
-                if (-1 == newPos && (newPos = $.inArray(opts.radixpoint, buffer)), reformatOnly ? buffer[newPos] = charAtPos : buffer.splice(newPos, 1), 
-                !needsRefresh && suffixStripped) for (var i = 0, l = opts.suffix.length; l > i; i++) buffer.push(opts.suffix.charAt(i));
+                if (-1 == newPos && charAtPos == opts.radixPoint && (newPos = $.inArray(opts.radixPoint, buffer)), 
+                reformatOnly ? buffer[newPos] = charAtPos : buffer.splice(newPos, 1), !needsRefresh && suffixStripped) for (var i = 0, l = opts.suffix.length; l > i; i++) buffer.push(opts.suffix.charAt(i));
                 return {
                     pos: newPos,
                     refreshFromBuffer: needsRefresh,

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


+ 2 - 2
dist/inputmask/jquery.inputmask.phone.extensions.js

@@ -3,10 +3,10 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-24
+* Version: 3.1.64-45
 */
 !function(factory) {
-    "function" == typeof define && define.amd ? define([ "jquery", "./jquery.inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./jquery.inputmask")) : factory(jQuery);
+    "function" == typeof define && define.amd ? define([ "jquery", "./inputmask", "./jquery.inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask"), require("./jquery.inputmask")) : factory(jQuery);
 }(function($) {
     return $.extend($.inputmask.defaults.aliases, {
         phone: {

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


+ 2 - 2
dist/inputmask/jquery.inputmask.regex.extensions.js

@@ -3,10 +3,10 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-24
+* Version: 3.1.64-45
 */
 !function(factory) {
-    "function" == typeof define && define.amd ? define([ "jquery", "./jquery.inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./jquery.inputmask")) : factory(jQuery);
+    "function" == typeof define && define.amd ? define([ "jquery", "./inputmask", "./jquery.inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask"), require("./jquery.inputmask")) : factory(jQuery);
 }(function($) {
     return $.extend($.inputmask.defaults.aliases, {
         Regex: {

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


+ 229 - 224
dist/jquery.inputmask.bundle.js

@@ -3,12 +3,12 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-24
+* Version: 3.1.64-45
 */
 !function($) {
     function inputmask(options) {
-        this.opts = $.extend(!0, {}, this.defaults, options), this.noMasksCache = options && void 0 !== options.definitions, 
-        resolveAlias(this.opts.alias, options, this.opts);
+        this.el = void 0, this.opts = $.extend(!0, {}, this.defaults, options), this.noMasksCache = options && void 0 !== options.definitions, 
+        this.userOptions = options || {}, resolveAlias(this.opts.alias, options, this.opts);
     }
     function isInputEventSupported(eventName) {
         var el = document.createElement("input"), evName = "on" + eventName, isSupported = evName in el;
@@ -26,19 +26,24 @@
     function resolveAlias(aliasStr, options, opts) {
         var aliasDefinition = opts.aliases[aliasStr];
         return aliasDefinition ? (aliasDefinition.alias && resolveAlias(aliasDefinition.alias, void 0, opts), 
-        $.extend(!0, opts, aliasDefinition), $.extend(!0, opts, options), !0) : !1;
+        $.extend(!0, opts, aliasDefinition), $.extend(!0, opts, options), !0) : (void 0 == opts.mask && (opts.mask = aliasStr), 
+        !1);
     }
-    function importAttributeOptions(npt, opts, importedOptionsContainer) {
-        var $npt = $(npt);
-        $npt.data("inputmask-alias") && resolveAlias($npt.data("inputmask-alias"), $.extend(!0, {}, opts), opts);
+    function importAttributeOptions(npt, opts, userOptions) {
+        var $npt = $(npt), attrOptions = $npt.data("inputmask");
+        if (attrOptions && "" != attrOptions) try {
+            attrOptions = attrOptions.replace(new RegExp("'", "g"), '"');
+            var dataoptions = $.parseJSON("{" + attrOptions + "}");
+            $.extend(!0, userOptions, dataoptions);
+        } catch (ex) {}
         for (var option in opts) {
             var optionData = $npt.data("inputmask-" + option.toLowerCase());
             void 0 != optionData && (optionData = "boolean" == typeof optionData ? optionData : optionData.toString(), 
-            "mask" == option && 0 == optionData.indexOf("[") ? (opts[option] = optionData.replace(/[\s[\]]/g, "").split("','"), 
-            opts[option][0] = opts[option][0].replace("'", ""), opts[option][opts[option].length - 1] = opts[option][opts[option].length - 1].replace("'", "")) : opts[option] = optionData, 
-            importedOptionsContainer && (importedOptionsContainer[option] = opts[option]));
+            "mask" == option && 0 == optionData.indexOf("[") ? (userOptions[option] = optionData.replace(/[\s[\]]/g, "").split("','"), 
+            userOptions[option][0] = userOptions[option][0].replace("'", ""), userOptions[option][userOptions[option].length - 1] = userOptions[option][userOptions[option].length - 1].replace("'", "")) : userOptions[option] = optionData);
         }
-        return opts;
+        return userOptions.alias ? resolveAlias(userOptions.alias, userOptions, opts) : $.extend(!0, opts, userOptions), 
+        opts;
     }
     function generateMaskSet(opts, nocache) {
         function analyseMask(mask) {
@@ -1088,8 +1093,8 @@
             isComplete(actionObj.buffer);
 
           case "unmaskedvalue":
-            return $el = actionObj.$input, maskset = $el.data("_inputmask").maskset, opts = $el.data("_inputmask").opts, 
-            isRTL = actionObj.$input.data("_inputmask").isRTL, unmaskedvalue(actionObj.$input);
+            return $el = $(actionObj.el), maskset = $el.data("_inputmask").maskset, opts = $el.data("_inputmask").opts, 
+            isRTL = $el.data("_inputmask").isRTL, unmaskedvalue($el);
 
           case "mask":
             undoValue = getBuffer().join(""), mask(actionObj.el);
@@ -1153,226 +1158,226 @@
             return maskset.metadata;
         }
     }
-    if (void 0 === $.fn.inputmask) {
-        inputmask.prototype = {
-            defaults: {
-                placeholder: "_",
-                optionalmarker: {
-                    start: "[",
-                    end: "]"
-                },
-                quantifiermarker: {
-                    start: "{",
-                    end: "}"
-                },
-                groupmarker: {
-                    start: "(",
-                    end: ")"
-                },
-                alternatormarker: "|",
-                escapeChar: "\\",
-                mask: null,
-                oncomplete: $.noop,
-                onincomplete: $.noop,
-                oncleared: $.noop,
-                repeat: 0,
-                greedy: !0,
-                autoUnmask: !1,
-                removeMaskOnSubmit: !1,
-                clearMaskOnLostFocus: !0,
-                insertMode: !0,
-                clearIncomplete: !1,
-                aliases: {},
-                alias: null,
-                onKeyDown: $.noop,
-                onBeforeMask: void 0,
-                onBeforePaste: void 0,
-                onBeforeWrite: void 0,
-                onUnMask: void 0,
-                showMaskOnFocus: !0,
-                showMaskOnHover: !0,
-                onKeyValidation: $.noop,
-                skipOptionalPartCharacter: " ",
-                showTooltip: !1,
-                numericInput: !1,
-                rightAlign: !1,
-                undoOnEscape: !0,
-                radixPoint: "",
-                radixFocus: !1,
-                nojumps: !1,
-                nojumpsThreshold: 0,
-                keepStatic: void 0,
-                definitions: {
-                    "9": {
-                        validator: "[0-9]",
-                        cardinality: 1,
-                        definitionSymbol: "*"
-                    },
-                    a: {
-                        validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
-                        cardinality: 1,
-                        definitionSymbol: "*"
-                    },
-                    "*": {
-                        validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
-                        cardinality: 1
-                    }
-                },
-                ignorables: [ 8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123 ],
-                isComplete: void 0,
-                canClearPosition: $.noop,
-                postValidation: void 0
-            },
-            keyCode: {
-                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
+    inputmask.prototype = {
+        defaults: {
+            placeholder: "_",
+            optionalmarker: {
+                start: "[",
+                end: "]"
             },
-            masksCache: {},
-            escapeRegex: function(str) {
-                var specials = [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^" ];
-                return str.replace(new RegExp("(\\" + specials.join("|\\") + ")", "gim"), "\\$1");
+            quantifiermarker: {
+                start: "{",
+                end: "}"
             },
-            format: function(value, options, metadata) {
-                var opts = $.extend(!0, {}, $.inputmask.defaults, options);
-                return resolveAlias(opts.alias, options, opts), maskScope({
-                    action: "format",
-                    value: value,
-                    metadata: metadata
-                }, generateMaskSet(opts, options && void 0 !== options.definitions), opts);
+            groupmarker: {
+                start: "(",
+                end: ")"
             },
-            isValid: function(value, options) {
-                var opts = $.extend(!0, {}, $.inputmask.defaults, options);
-                return resolveAlias(opts.alias, options, opts), maskScope({
-                    action: "isValid",
-                    value: value
-                }, generateMaskSet(opts, options && void 0 !== options.definitions), opts);
+            alternatormarker: "|",
+            escapeChar: "\\",
+            mask: null,
+            oncomplete: $.noop,
+            onincomplete: $.noop,
+            oncleared: $.noop,
+            repeat: 0,
+            greedy: !0,
+            autoUnmask: !1,
+            removeMaskOnSubmit: !1,
+            clearMaskOnLostFocus: !0,
+            insertMode: !0,
+            clearIncomplete: !1,
+            aliases: {},
+            alias: null,
+            onKeyDown: $.noop,
+            onBeforeMask: void 0,
+            onBeforePaste: void 0,
+            onBeforeWrite: void 0,
+            onUnMask: void 0,
+            showMaskOnFocus: !0,
+            showMaskOnHover: !0,
+            onKeyValidation: $.noop,
+            skipOptionalPartCharacter: " ",
+            showTooltip: !1,
+            numericInput: !1,
+            rightAlign: !1,
+            undoOnEscape: !0,
+            radixPoint: "",
+            radixFocus: !1,
+            nojumps: !1,
+            nojumpsThreshold: 0,
+            keepStatic: void 0,
+            definitions: {
+                "9": {
+                    validator: "[0-9]",
+                    cardinality: 1,
+                    definitionSymbol: "*"
+                },
+                a: {
+                    validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
+                    cardinality: 1,
+                    definitionSymbol: "*"
+                },
+                "*": {
+                    validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
+                    cardinality: 1
+                }
             },
-            mask: function(el) {
-                importAttributeOptions(el, this.opts);
-                var maskset = generateMaskSet(this.opts, this.noMasksCache);
-                return void 0 != maskset && maskScope({
-                    action: "mask",
-                    el: el
-                }, maskset, this.opts), el;
-            }
-        };
-        var ua = navigator.userAgent, iphone = null !== ua.match(new RegExp("iphone", "i")), androidchrome = (null !== ua.match(new RegExp("android.*safari.*", "i")), 
-        null !== ua.match(new RegExp("android.*chrome.*", "i"))), androidfirefox = null !== ua.match(new RegExp("android.*firefox.*", "i")), PasteEventType = (/Kindle/i.test(ua) || /Silk/i.test(ua) || /KFTT/i.test(ua) || /KFOT/i.test(ua) || /KFJWA/i.test(ua) || /KFJWI/i.test(ua) || /KFSOWI/i.test(ua) || /KFTHWA/i.test(ua) || /KFTHWI/i.test(ua) || /KFAPWA/i.test(ua) || /KFAPWI/i.test(ua), 
-        isInputEventSupported("paste") ? "paste" : isInputEventSupported("input") ? "input" : "propertychange");
-        $.inputmask = inputmask.prototype, $.fn.inputmask = function(fn, options) {
-            var maskset, opts = $.extend(!0, {}, $.inputmask.defaults, options);
-            if ("string" == typeof fn) switch (fn) {
-              case "mask":
-                return this.each(function() {
-                    return new inputmask(options).mask(this);
-                });
+            ignorables: [ 8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123 ],
+            isComplete: void 0,
+            canClearPosition: $.noop,
+            postValidation: void 0
+        },
+        keyCode: {
+            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
+        },
+        masksCache: {},
+        escapeRegex: function(str) {
+            var specials = [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^" ];
+            return str.replace(new RegExp("(\\" + specials.join("|\\") + ")", "gim"), "\\$1");
+        },
+        format: function(value, options, metadata) {
+            var opts = $.extend(!0, {}, $.inputmask.defaults, options);
+            return resolveAlias(opts.alias, options, opts), maskScope({
+                action: "format",
+                value: value,
+                metadata: metadata
+            }, generateMaskSet(opts, options && void 0 !== options.definitions), opts);
+        },
+        isValid: function(value, options) {
+            var opts = $.extend(!0, {}, $.inputmask.defaults, options);
+            return resolveAlias(opts.alias, options, opts), maskScope({
+                action: "isValid",
+                value: value
+            }, generateMaskSet(opts, options && void 0 !== options.definitions), opts);
+        },
+        mask: function(el) {
+            var input = el.jquery && el.length > 0 ? el[0] : el;
+            importAttributeOptions(el, this.opts, this.userOptions);
+            var maskset = generateMaskSet(this.opts, this.noMasksCache);
+            return void 0 != maskset && maskScope({
+                action: "mask",
+                el: input
+            }, maskset, this.opts), input.inputmask = new inputmask(), input.inputmask.opts = this.opts, 
+            input.inputmask.noMasksCache = this.noMasksCache, input.inputmask.el = input, el;
+        },
+        unmaskedvalue: function() {
+            return this.el ? maskScope({
+                action: "unmaskedvalue",
+                el: this.el
+            }) : void 0;
+        },
+        remove: function() {
+            return this.el ? (maskScope({
+                action: "remove",
+                el: this.el
+            }), this.el.inputmask = void 0, this.el) : void 0;
+        },
+        getemptymask: function() {
+            return this.el ? maskScope({
+                action: "getemptymask",
+                el: this.el
+            }) : void 0;
+        },
+        hasMaskedValue: function() {
+            return !this.opts.autoUnmask;
+        },
+        isComplete: function() {
+            return this.el ? maskScope({
+                action: "isComplete",
+                buffer: this.el._valueGet().split(""),
+                el: this.el
+            }) : void 0;
+        },
+        getmetadata: function() {
+            return this.el ? maskScope({
+                action: "getmetadata",
+                el: this.el
+            }) : void 0;
+        }
+    };
+    var ua = navigator.userAgent, iphone = null !== ua.match(new RegExp("iphone", "i")), androidchrome = (null !== ua.match(new RegExp("android.*safari.*", "i")), 
+    null !== ua.match(new RegExp("android.*chrome.*", "i"))), androidfirefox = null !== ua.match(new RegExp("android.*firefox.*", "i")), PasteEventType = (/Kindle/i.test(ua) || /Silk/i.test(ua) || /KFTT/i.test(ua) || /KFOT/i.test(ua) || /KFJWA/i.test(ua) || /KFJWI/i.test(ua) || /KFSOWI/i.test(ua) || /KFTHWA/i.test(ua) || /KFTHWI/i.test(ua) || /KFAPWA/i.test(ua) || /KFAPWI/i.test(ua), 
+    isInputEventSupported("paste") ? "paste" : isInputEventSupported("input") ? "input" : "propertychange");
+    return window.inputmask = inputmask, inputmask;
+}(jQuery), function($) {
+    return void 0 === $.fn.inputmask && ($.inputmask = inputmask.prototype, $.fn.inputmask = function(fn, options) {
+        var nptmask;
+        if ("string" == typeof fn) switch (fn) {
+          case "mask":
+            return nptmask = new inputmask(options), this.each(function() {
+                nptmask.mask(this);
+            });
 
-              case "unmaskedvalue":
-                var $input = $(this);
-                return $input.data("_inputmask") ? maskScope({
-                    action: "unmaskedvalue",
-                    $input: $input
-                }) : $input.val();
+          case "unmaskedvalue":
+            var input = this.jquery && this.length > 0 ? this[0] : this;
+            return input.inputmask ? input.inputmask.unmaskedvalue() : $(input).val();
 
-              case "remove":
-                return this.each(function() {
-                    var $input = $(this);
-                    $input.data("_inputmask") && maskScope({
-                        action: "remove",
-                        el: this
-                    });
-                });
+          case "remove":
+            return this.each(function() {
+                this.inputmask && this.inputmask.remove();
+            });
 
-              case "getemptymask":
-                return this.data("_inputmask") ? maskScope({
-                    action: "getemptymask",
-                    el: this
-                }) : "";
+          case "getemptymask":
+            var input = this.jquery && this.length > 0 ? this[0] : this;
+            return input.inputmask ? input.inputmask.getemptymask() : "";
 
-              case "hasMaskedValue":
-                return this.data("_inputmask") ? !this.data("_inputmask").opts.autoUnmask : !1;
+          case "hasMaskedValue":
+            var input = this.jquery && this.length > 0 ? this[0] : this;
+            return input.inputmask ? input.inputmask.hasMaskedValue() : !1;
 
-              case "isComplete":
-                return this.data("_inputmask") ? maskScope({
-                    action: "isComplete",
-                    buffer: this[0]._valueGet().split(""),
-                    el: this
-                }) : !0;
+          case "isComplete":
+            var input = this.jquery && this.length > 0 ? this[0] : this;
+            return input.inputmask ? input.inputmask.isComplete() : !0;
 
-              case "getmetadata":
-                return this.data("_inputmask") ? maskScope({
-                    action: "getmetadata",
-                    el: this
-                }) : void 0;
+          case "getmetadata":
+            var input = this.jquery && this.length > 0 ? this[0] : this;
+            return input.inputmask ? input.inputmask.getmetadata() : void 0;
 
-              default:
-                return resolveAlias(opts.alias, options, opts), resolveAlias(fn, options, opts) || (opts.mask = fn), 
-                this.each(function() {
-                    return importAttributeOptions(this, opts), maskset = generateMaskSet(opts, options && void 0 !== options.definitions), 
-                    void 0 == maskset ? this : void maskScope({
-                        action: "mask",
-                        el: this
-                    }, maskset, opts);
-                });
-            } else {
-                if ("object" == typeof fn) return opts = $.extend(!0, {}, $.inputmask.defaults, fn), 
-                resolveAlias(opts.alias, fn, opts), this.each(function() {
-                    return importAttributeOptions(this, opts), maskset = generateMaskSet(opts, fn && void 0 !== fn.definitions), 
-                    void 0 == maskset ? this : void maskScope({
-                        action: "mask",
-                        el: this
-                    }, maskset, opts);
-                });
-                if (void 0 == fn) return this.each(function() {
-                    var attrOptions = $(this).attr("data-inputmask");
-                    if (attrOptions && "" != attrOptions) try {
-                        attrOptions = attrOptions.replace(new RegExp("'", "g"), '"');
-                        var dataoptions = $.parseJSON("{" + attrOptions + "}");
-                        $.extend(!0, dataoptions, options), opts = $.extend(!0, {}, $.inputmask.defaults, dataoptions), 
-                        opts = importAttributeOptions(this, opts), resolveAlias(opts.alias, dataoptions, opts), 
-                        opts.alias = void 0, $(this).inputmask("mask", opts);
-                    } catch (ex) {}
-                    if ($(this).attr("data-inputmask-mask") || $(this).attr("data-inputmask-alias")) {
-                        opts = $.extend(!0, {}, $.inputmask.defaults, {});
-                        var dataOptions = {};
-                        opts = importAttributeOptions(this, opts, dataOptions), resolveAlias(opts.alias, dataOptions, opts), 
-                        opts.alias = void 0, $(this).inputmask("mask", opts);
-                    }
-                });
-            }
-        };
-    }
-    return $.fn.inputmask;
+          default:
+            return options = options || {}, options.alias = fn, nptmask = new inputmask(options), 
+            this.each(function() {
+                nptmask.mask(this);
+            });
+        } else {
+            if ("object" == typeof fn) return nptmask = new inputmask(fn), this.each(function() {
+                nptmask.mask(this);
+            });
+            if (void 0 == fn) return this.each(function() {
+                nptmask = new inputmask(), nptmask.mask(this);
+            });
+        }
+    }), $.fn.inputmask;
 }(jQuery), function($) {
     return $.extend($.inputmask.defaults.definitions, {
         h: {
@@ -1993,8 +1998,8 @@
                 needsRefresh = bufValOrigin != bufVal, buffer.length = bufVal.length;
                 for (var i = 0, l = bufVal.length; l > i; i++) buffer[i] = bufVal.charAt(i);
                 var newPos = $.inArray("?", buffer);
-                if (-1 == newPos && (newPos = $.inArray(opts.radixpoint, buffer)), reformatOnly ? buffer[newPos] = charAtPos : buffer.splice(newPos, 1), 
-                !needsRefresh && suffixStripped) for (var i = 0, l = opts.suffix.length; l > i; i++) buffer.push(opts.suffix.charAt(i));
+                if (-1 == newPos && charAtPos == opts.radixPoint && (newPos = $.inArray(opts.radixPoint, buffer)), 
+                reformatOnly ? buffer[newPos] = charAtPos : buffer.splice(newPos, 1), !needsRefresh && suffixStripped) for (var i = 0, l = opts.suffix.length; l > i; i++) buffer.push(opts.suffix.charAt(i));
                 return {
                     pos: newPos,
                     refreshFromBuffer: needsRefresh,

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


File diff suppressed because it is too large
+ 2546 - 0
js/inputmask.js


File diff suppressed because it is too large
+ 54 - 2587
js/jquery.inputmask.js


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

@@ -151,7 +151,7 @@ Optional extensions on the jquery.inputmask base
 					buffer[i] = bufVal.charAt(i);
 				}
 				var newPos = $.inArray("?", buffer);
-				if (newPos == -1) newPos = $.inArray(opts.radixpoint, buffer);
+				if (newPos == -1 && charAtPos == opts.radixPoint) newPos = $.inArray(opts.radixPoint, buffer);
 				if (reformatOnly) buffer[newPos] = charAtPos;
 				else buffer.splice(newPos, 1);
 

+ 40 - 41
nuspecs/jquery.inputmask.linux.nuspec

@@ -1,44 +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(s)  
-- alternator-mask support
-- regex-mask support
-- dynamic-mask support
-- preprocessing-mask support
-- value formatting / validating without input element
-</description>
-        <tags>jQuery, plugins, input, form, inputmask, mask</tags>
-    </metadata>
-    <files>
-        <file src="dist/inputmask/jquery.inputmask.date.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.date.extensions.js" />
-        <file src="dist/inputmask/jquery.inputmask.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.extensions.js" />
-        <file src="dist/inputmask/jquery.inputmask.numeric.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.numeric.extensions.js" />
-		    <file src="dist/inputmask/jquery.inputmask.regex.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.regex.extensions.js" />
-		    <file src="dist/inputmask/jquery.inputmask.phone.extensions.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.phone.extensions.js" />
-        <file src="dist/inputmask/jquery.inputmask.js" target="content/Scripts/jquery.inputmask/jquery.inputmask.js" />
-    </files>
+  <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(s) - alternator-mask support - regex-mask support - dynamic-mask
+      support - preprocessing-mask support - value formatting / validating without
+      input element
+    </description>
+    <tags>jQuery, plugins, input, form, inputmask, mask</tags>
+  </metadata>
+  <files>
+    <file src="dist/inputmask/jquery.inputmask.date.extensions.js"
+      target="content/Scripts/jquery.inputmask/jquery.inputmask.date.extensions.js"/>
+    <file src="dist/inputmask/jquery.inputmask.extensions.js"
+      target="content/Scripts/jquery.inputmask/jquery.inputmask.extensions.js"/>
+    <file src="dist/inputmask/jquery.inputmask.numeric.extensions.js"
+      target="content/Scripts/jquery.inputmask/jquery.inputmask.numeric.extensions.js"/>
+    <file src="dist/inputmask/jquery.inputmask.regex.extensions.js"
+      target="content/Scripts/jquery.inputmask/jquery.inputmask.regex.extensions.js"/>
+    <file src="dist/inputmask/jquery.inputmask.phone.extensions.js"
+      target="content/Scripts/jquery.inputmask/jquery.inputmask.phone.extensions.js"/>
+    <file src="dist/inputmask/jquery.inputmask.js"
+      target="content/Scripts/jquery.inputmask/jquery.inputmask.js"/>
+    <file src="dist/inputmask/inputmask.js"
+      target="content/Scripts/jquery.inputmask/inputmask.js"/>
+  </files>
 </package>

+ 40 - 41
nuspecs/jquery.inputmask.nuspec

@@ -1,44 +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(s)  
-- alternator-mask support
-- regex-mask support
-- dynamic-mask support
-- preprocessing-mask support
-- value formatting / validating without input element
-</description>
-        <tags>jQuery, plugins, input, form, inputmask, mask</tags>
-    </metadata>
-    <files>
-        <file src="..\dist\inputmask\jquery.inputmask.date.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.date.extensions.js" />
-        <file src="..\dist\inputmask\jquery.inputmask.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.extensions.js" />
-        <file src="..\dist\inputmask\jquery.inputmask.numeric.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.numeric.extensions.js" />
-		    <file src="..\dist\inputmask\jquery.inputmask.regex.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.regex.extensions.js" />
-		    <file src="..\dist\inputmask\jquery.inputmask.phone.extensions.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.phone.extensions.js" />
-        <file src="..\dist\inputmask\jquery.inputmask.js" target="content\Scripts\jquery.inputmask\jquery.inputmask.js" />
-    </files>
+  <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(s) - alternator-mask support - regex-mask support - dynamic-mask
+      support - preprocessing-mask support - value formatting / validating without
+      input element
+    </description>
+    <tags>jQuery, plugins, input, form, inputmask, mask</tags>
+  </metadata>
+  <files>
+    <file src="..\dist\inputmask\jquery.inputmask.date.extensions.js"
+      target="content\Scripts\jquery.inputmask\jquery.inputmask.date.extensions.js"/>
+    <file src="..\dist\inputmask\jquery.inputmask.extensions.js"
+      target="content\Scripts\jquery.inputmask\jquery.inputmask.extensions.js"/>
+    <file src="..\dist\inputmask\jquery.inputmask.numeric.extensions.js"
+      target="content\Scripts\jquery.inputmask\jquery.inputmask.numeric.extensions.js"/>
+    <file src="..\dist\inputmask\jquery.inputmask.regex.extensions.js"
+      target="content\Scripts\jquery.inputmask\jquery.inputmask.regex.extensions.js"/>
+    <file src="..\dist\inputmask\jquery.inputmask.phone.extensions.js"
+      target="content\Scripts\jquery.inputmask\jquery.inputmask.phone.extensions.js"/>
+    <file src="..\dist\inputmask\jquery.inputmask.js"
+      target="content\Scripts\jquery.inputmask\jquery.inputmask.js"/>
+    <file src="..\dist\inputmask\inputmask.js"
+      target="content\Scripts\jquery.inputmask\inputmask.js"/>
+  </files>
 </package>

+ 1 - 1
package.json

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

+ 2 - 2
qunit/tests_numeric.js

@@ -1287,7 +1287,7 @@ test("decimal alias - type 1234567890 - add , before 9 - jpontet", function () {
     $("#testmask")[0].focus();
     $("#testmask").click();
     $("#testmask").Type("1234567890");
-    $.caret($("#testmask"), 10);
+    $.caret($("#testmask"), 11);
     $("#testmask").SendKey(",");
     equal($("#testmask")[0]._valueGet(), "12 345 678,90", "Result " + $("#testmask")[0]._valueGet());
     $("#testmask").remove();
@@ -1301,7 +1301,7 @@ test("decimal alias - type 1234567890 - add , before 9 - backspace - jpontet", f
     $("#testmask")[0].focus();
     $("#testmask").click();
     $("#testmask").Type("1234567890");
-    $.caret($("#testmask"), 10);
+    $.caret($("#testmask"), 11);
     $("#testmask").SendKey(",");
     $("#testmask").SendKey($.inputmask.keyCode.BACKSPACE);
     equal($("#testmask")[0]._valueGet(), "1 234 567,90", "Result " + $("#testmask")[0]._valueGet());