浏览代码

fix for FF/Linux latin charset #192

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

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.0.61",
+  "version": "3.0.62",
   "main": "./dist/jquery.inputmask.bundle.js",
   "keywords" : ["jQuery", "plugins", "input", "form", "inputmask", "mask"],
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",

+ 1 - 1
build.properties

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

+ 32 - 23
dist/jquery.inputmask.bundle.js

@@ -3,12 +3,12 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.0.61
+* Version: 3.0.62
 */
 
 (function (factory) {
     if (typeof define === 'function' && define.amd) {
-        define("jquery.inputmask", ['jquery'], factory);
+        define(['jquery'], factory);
     } else {
         factory(jQuery);
     }
@@ -1267,10 +1267,6 @@
                             var keypressResult = opts.onKeyPress.call(this, e, getBuffer(), currentCaretPos.begin, opts);
                             handleOnKeyResult(input, keypressResult, currentCaretPos);
                         }
-                        var temp;
-                        for (var i in getMaskSet().validPositions) {
-                            temp += " " + i;
-                        }
                     }
                 }
             }
@@ -1344,6 +1340,18 @@
                 }
                 e.preventDefault();
             }
+            function compositionupdateEvent(e) {
+                var that = this;
+                setTimeout(function () {
+                    caret(that, caret(that).begin - 1);
+                    var keypress = $.Event("keypress");
+                    keypress.which = e.originalEvent.data.charCodeAt(0);
+                    keypressEvent.call(that, keypress, undefined, undefined, false);
+                    var forwardPosition = getMaskSet()["p"];
+                    writeBuffer(that, getBuffer(), opts.numericInput ? seekPrevious(forwardPosition) : forwardPosition);
+                }, 0);
+                return false;
+            }
 
             function mask(el) {
                 $el = $(el);
@@ -1473,11 +1481,12 @@
                         valueOnFocus = getBuffer().join('');
                     }).bind('complete.inputmask', opts.oncomplete
                     ).bind('incomplete.inputmask', opts.onincomplete
-                    ).bind('cleared.inputmask', opts.oncleared);
-
-                    $el.bind("keydown.inputmask", keydownEvent
-                    ).bind("keypress.inputmask", keypressEvent
-                    ).bind("keyup.inputmask", keyupEvent);
+                    ).bind('cleared.inputmask', opts.oncleared);
+
+                    $el.bind("keydown.inputmask", keydownEvent
+                    ).bind("keypress.inputmask", keypressEvent
+                    ).bind("keyup.inputmask", keyupEvent
+                    ).bind("compositionupdate.inputmask", compositionupdateEvent);
 
                     if (android || androidfirefox || androidchrome || kindle) {
                         if (PasteEventType == "input") {
@@ -1812,7 +1821,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.0.61
+* Version: 3.0.62
 *
 *  THIS IS A TEMPORARY HACK TO BE COMPATIBLE WITH MULTIPLE MASKS LIKE IN VERSION 2.X - WHEN THE ALTERNATOR SYNTAX IS IMPLEMENTED inputmask-multi WILL BE DELETED!!
 *
@@ -1820,7 +1829,7 @@
 */
 (function (factory) {
     if (typeof define === 'function' && define.amd) {
-        define("jquery.inputmask-multi", ['jquery', 'jquery.inputmask'], factory);
+        define(['jquery', './jquery.inputmask'], factory);
     } else {
         factory(jQuery);
     }
@@ -2117,13 +2126,13 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.61
+Version: 3.0.62
 
 Optional extensions on the jquery.inputmask base
 */
 (function (factory) {
     if (typeof define === 'function' && define.amd) {
-        define("jquery.inputmask.extensions", ['jquery', 'jquery.inputmask'], factory);
+        define(['jquery', './jquery.inputmask'], factory);
     } else {
         factory(jQuery);
     }
@@ -2244,13 +2253,13 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.61
+Version: 3.0.62
 
 Optional extensions on the jquery.inputmask base
 */
 (function (factory) {
     if (typeof define === 'function' && define.amd) {
-        define("jquery.inputmask.date.extensions", ['jquery', 'jquery.inputmask'], factory);
+        define(['jquery', './jquery.inputmask'], factory);
     } else {
         factory(jQuery);
     }
@@ -2738,13 +2747,13 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.61
+Version: 3.0.62
 
 Optional extensions on the jquery.inputmask base
 */
 (function (factory) {
     if (typeof define === 'function' && define.amd) {
-        define("jquery.inputmask.numeric.extensions", ['jquery', 'jquery.inputmask'], factory);
+        define(['jquery', './jquery.inputmask'], factory);
     } else {
         factory(jQuery);
     }
@@ -2996,14 +3005,14 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.61
+Version: 3.0.62
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
 */
 (function (factory) {
     if (typeof define === 'function' && define.amd) {
-        define("jquery.inputmask.regex.extensions", ['jquery', 'jquery.inputmask'], factory);
+        define(['jquery', './jquery.inputmask'], factory);
     } else {
         factory(jQuery);
     }
@@ -3189,7 +3198,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.61
+Version: 3.0.62
 
 Phone extension.
 When using this extension make sure you specify the correct url to get the masks
@@ -3205,7 +3214,7 @@ When using this extension make sure you specify the correct url to get the masks
 */
 (function (factory) {
     if (typeof define === 'function' && define.amd) {
-        define("jquery.inputmask.phone.extensions", ['jquery', 'jquery.inputmask'], factory);
+        define(['jquery', './jquery.inputmask'], factory);
     } else {
         factory(jQuery);
     }

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


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


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


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


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


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


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


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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 18 - 9
js/jquery.inputmask.js

@@ -1267,10 +1267,6 @@
                             var keypressResult = opts.onKeyPress.call(this, e, getBuffer(), currentCaretPos.begin, opts);
                             handleOnKeyResult(input, keypressResult, currentCaretPos);
                         }
-                        var temp;
-                        for (var i in getMaskSet().validPositions) {
-                            temp += " " + i;
-                        }
                     }
                 }
             }
@@ -1344,6 +1340,18 @@
                 }
                 e.preventDefault();
             }
+            function compositionupdateEvent(e) {
+                var that = this;
+                setTimeout(function () {
+                    caret(that, caret(that).begin - 1);
+                    var keypress = $.Event("keypress");
+                    keypress.which = e.originalEvent.data.charCodeAt(0);
+                    keypressEvent.call(that, keypress, undefined, undefined, false);
+                    var forwardPosition = getMaskSet()["p"];
+                    writeBuffer(that, getBuffer(), opts.numericInput ? seekPrevious(forwardPosition) : forwardPosition);
+                }, 0);
+                return false;
+            }
 
             function mask(el) {
                 $el = $(el);
@@ -1473,11 +1481,12 @@
                         valueOnFocus = getBuffer().join('');
                     }).bind('complete.inputmask', opts.oncomplete
                     ).bind('incomplete.inputmask', opts.onincomplete
-                    ).bind('cleared.inputmask', opts.oncleared);
-
-                    $el.bind("keydown.inputmask", keydownEvent
-                    ).bind("keypress.inputmask", keypressEvent
-                    ).bind("keyup.inputmask", keyupEvent);
+                    ).bind('cleared.inputmask', opts.oncleared);
+
+                    $el.bind("keydown.inputmask", keydownEvent
+                    ).bind("keypress.inputmask", keypressEvent
+                    ).bind("keyup.inputmask", keyupEvent
+                    ).bind("compositionupdate.inputmask", compositionupdateEvent);
 
                     if (android || androidfirefox || androidchrome || kindle) {
                         if (PasteEventType == "input") {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.0.61",
+  "version": "3.0.62",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
   "main": "dist/jquery.inputmask.bundle.js",
   "scripts": {