浏览代码

jquery.inputmask 3.1.33

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

+ 1 - 1
bower.json

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

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

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.32
+* Version: 3.1.33
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./jquery.inputmask" ], factory) : factory(jQuery);

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

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.32
+* Version: 3.1.33
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./jquery.inputmask" ], factory) : factory(jQuery);

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

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.32
+* Version: 3.1.33
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery" ], factory) : factory(jQuery);

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

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.32
+* Version: 3.1.33
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./jquery.inputmask" ], factory) : factory(jQuery);

+ 15 - 10
dist/inputmask/jquery.inputmask.phone.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.32
+* Version: 3.1.33
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./jquery.inputmask" ], factory) : factory(jQuery);
@@ -12,6 +12,7 @@
         phone: {
             url: "phone-codes/phone-codes.js",
             maskInit: "+pp(pp)pppppppp",
+            countrycode: "",
             mask: function(opts) {
                 opts.definitions = {
                     p: {
@@ -32,24 +33,28 @@
                     dataType: "json",
                     success: function(response) {
                         maskList = response;
+                    },
+                    error: function(xhr, ajaxOptions, thrownError) {
+                        alert(thrownError + " - " + opts.url);
                     }
                 }), maskList = maskList.sort(function(a, b) {
                     return (a.mask || a) < (b.mask || b) ? -1 : 1;
-                }), maskList.splice(0, 0, opts.maskInit), maskList;
+                }), "" != opts.countrycode && (opts.maskInit = "+" + opts.countrycode + opts.maskInit.substring(3)), 
+                maskList.splice(0, 0, opts.maskInit), maskList;
             },
             nojumps: !0,
-            nojumpsThreshold: 1
+            nojumpsThreshold: 1,
+            onBeforeMask: function(value, opts) {
+                var processedValue = value.replace(/^0/g, "");
+                return (processedValue.indexOf(opts.countrycode) > 1 || -1 == processedValue.indexOf(opts.countrycode)) && (processedValue = opts.countrycode + processedValue), 
+                processedValue;
+            }
         },
         phonebe: {
             alias: "phone",
             url: "phone-codes/phone-be.js",
-            maskInit: "+32(pp)pppppppp",
-            nojumpsThreshold: 4,
-            onBeforeMask: function(value) {
-                var processedValue = value.replace(/^0/g, "");
-                return (processedValue.indexOf("32") > 1 || -1 == processedValue.indexOf("32")) && (processedValue = "32" + processedValue), 
-                processedValue;
-            }
+            countrycode: "32",
+            nojumpsThreshold: 4
         }
     }), $.fn.inputmask;
 });

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

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.32
+* Version: 3.1.33
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./jquery.inputmask" ], factory) : factory(jQuery);

+ 15 - 10
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.32
+* Version: 3.1.33
 */
 !function($) {
     function isInputEventSupported(eventName) {
@@ -1984,6 +1984,7 @@
         phone: {
             url: "phone-codes/phone-codes.js",
             maskInit: "+pp(pp)pppppppp",
+            countrycode: "",
             mask: function(opts) {
                 opts.definitions = {
                     p: {
@@ -2004,24 +2005,28 @@
                     dataType: "json",
                     success: function(response) {
                         maskList = response;
+                    },
+                    error: function(xhr, ajaxOptions, thrownError) {
+                        alert(thrownError + " - " + opts.url);
                     }
                 }), maskList = maskList.sort(function(a, b) {
                     return (a.mask || a) < (b.mask || b) ? -1 : 1;
-                }), maskList.splice(0, 0, opts.maskInit), maskList;
+                }), "" != opts.countrycode && (opts.maskInit = "+" + opts.countrycode + opts.maskInit.substring(3)), 
+                maskList.splice(0, 0, opts.maskInit), maskList;
             },
             nojumps: !0,
-            nojumpsThreshold: 1
+            nojumpsThreshold: 1,
+            onBeforeMask: function(value, opts) {
+                var processedValue = value.replace(/^0/g, "");
+                return (processedValue.indexOf(opts.countrycode) > 1 || -1 == processedValue.indexOf(opts.countrycode)) && (processedValue = opts.countrycode + processedValue), 
+                processedValue;
+            }
         },
         phonebe: {
             alias: "phone",
             url: "phone-codes/phone-be.js",
-            maskInit: "+32(pp)pppppppp",
-            nojumpsThreshold: 4,
-            onBeforeMask: function(value) {
-                var processedValue = value.replace(/^0/g, "");
-                return (processedValue.indexOf("32") > 1 || -1 == processedValue.indexOf("32")) && (processedValue = "32" + processedValue), 
-                processedValue;
-            }
+            countrycode: "32",
+            nojumpsThreshold: 4
         }
     }), $.fn.inputmask;
 }(jQuery), function($) {

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


+ 1 - 1
jquery.inputmask.jquery.json

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