ソースを参照

Enhance Email extension

Robin Herbots 11 年 前
コミット
6571c5142e

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
 {
     "name": "jquery.inputmask",
     "name": "jquery.inputmask",
-    "version": "3.0.31",
+    "version": "3.0.32",
     "main": "./dist/jquery.inputmask.bundle.js",
     "main": "./dist/jquery.inputmask.bundle.js",
 	"keywords" : ["jQuery", "plugins", "input", "form", "inputmask", "mask"],
 	"keywords" : ["jQuery", "plugins", "input", "form", "inputmask", "mask"],
 	"description": "jquery.inputmask is a jquery plugin which create an input 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.major = 3
 build.minor = 0
 build.minor = 0
-build.revision = 31
+build.revision = 32
 
 
 target = jquery.inputmask.bundle.js
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js
 target.min = jquery.inputmask.bundle.min.js

BIN
dist/jQuery.InputMask.3.0.30.nupkg


BIN
dist/jQuery.InputMask.3.0.32.nupkg


+ 22 - 11
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.0.31
+* Version: 3.0.32
 */
 */
 
 
 (function ($) {
 (function ($) {
@@ -1553,7 +1553,7 @@
                         if (maskset.length == 0) { return this; }
                         if (maskset.length == 0) { return this; }
 
 
                         return this.each(function () {
                         return this.each(function () {
-                            targetScope({ "action": "mask", "el": this }, $.extend(true, {}, maskset), importAttributeOptions(this, opts));
+                            targetScope({ "action": "mask", "el": this }, $.extend(true, {}, $.isArray(maskset) && targetScope === maskScope ? maskset[0] : maskset), importAttributeOptions(this, opts));
                         });
                         });
                     case "unmaskedvalue":
                     case "unmaskedvalue":
                         var $input = $(this);
                         var $input = $(this);
@@ -1603,7 +1603,7 @@
                         maskset = generateMaskSet(opts);
                         maskset = generateMaskSet(opts);
                         if (maskset == undefined) { return this; }
                         if (maskset == undefined) { return this; }
                         return this.each(function () {
                         return this.each(function () {
-                            targetScope({ "action": "mask", "el": this }, $.extend(true, {}, maskset), importAttributeOptions(this, opts));
+                            targetScope({ "action": "mask", "el": this }, $.extend(true, {}, $.isArray(maskset) && targetScope === maskScope ? maskset[0] : maskset), importAttributeOptions(this, opts));
                         });
                         });
                 }
                 }
             } else if (typeof fn == "object") {
             } else if (typeof fn == "object") {
@@ -1613,7 +1613,7 @@
                 maskset = generateMaskSet(opts);
                 maskset = generateMaskSet(opts);
                 if (maskset == undefined) { return this; }
                 if (maskset == undefined) { return this; }
                 return this.each(function () {
                 return this.each(function () {
-                    targetScope({ "action": "mask", "el": this }, $.extend(true, {}, maskset), importAttributeOptions(this, opts));
+                    targetScope({ "action": "mask", "el": this }, $.extend(true, {}, $.isArray(maskset) && targetScope === maskScope ? maskset[0] : maskset), importAttributeOptions(this, opts));
                 });
                 });
             } else if (fn == undefined) {
             } else if (fn == undefined) {
                 //look for data-inputmask atribute - the attribute should only contain optipns
                 //look for data-inputmask atribute - the attribute should only contain optipns
@@ -1640,7 +1640,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.0.31
+* Version: 3.0.32
 */
 */
 
 
 (function ($) {
 (function ($) {
@@ -2006,7 +2006,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.31
+Version: 3.0.32
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2107,7 +2107,18 @@ Optional extensions on the jquery.inputmask base
         },
         },
         "email": {
         "email": {
             mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}.*{2,6}[.*{1,2}]",
             mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}.*{2,6}[.*{1,2}]",
-            greedy: false
+            greedy: false,
+            onBeforePaste: function (pastedValue, opts) {
+                pastedValue = pastedValue.toLowerCase();
+                return pastedValue.replace("mailto:", "");
+            },
+            definitions: {
+                '*': {
+                    validator: "[A-Za-z\u0410-\u044F\u0401\u04510-9]",
+                    cardinality: 1,
+                    casing: "lower"
+                }
+            }
         }
         }
     });
     });
 })(jQuery);
 })(jQuery);
@@ -2116,7 +2127,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.31
+Version: 3.0.32
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2579,7 +2590,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.31
+Version: 3.0.32
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2735,7 +2746,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.31
+Version: 3.0.32
 
 
 Regex extensions on the jquery.inputmask base
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
 Allows for using regular expressions as a mask
@@ -2922,7 +2933,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.31
+Version: 3.0.32
 
 
 Phone extension.
 Phone extension.
 When using this extension make sure you specify the correct url to get the masks
 When using this extension make sure you specify the correct url to get the masks

ファイルの差分が大きいため隠しています
+ 83 - 82
dist/jquery.inputmask.bundle.min.js


ファイルの差分が大きいため隠しています
+ 1 - 1
dist/min/jquery.inputmask-multi.js


ファイルの差分が大きいため隠しています
+ 4 - 3
dist/min/jquery.inputmask.extensions.js


ファイルの差分が大きいため隠しています
+ 48 - 48
dist/min/jquery.inputmask.js


+ 1 - 1
jquery.inputmask.jquery.json

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

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

@@ -104,7 +104,18 @@ Optional extensions on the jquery.inputmask base
         },
         },
         "email": {
         "email": {
             mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}.*{2,6}[.*{1,2}]",
             mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}.*{2,6}[.*{1,2}]",
-            greedy: false
+            greedy: false,
+            onBeforePaste: function (pastedValue, opts) {
+                pastedValue = pastedValue.toLowerCase();
+                return pastedValue.replace("mailto:", "");
+            },
+            definitions: {
+                '*': {
+                    validator: "[A-Za-z\u0410-\u044F\u0401\u04510-9]",
+                    cardinality: 1,
+                    casing: "lower"
+                }
+            }
         }
         }
     });
     });
 })(jQuery);
 })(jQuery);

+ 3 - 3
js/jquery.inputmask.js

@@ -1553,7 +1553,7 @@
                         if (maskset.length == 0) { return this; }
                         if (maskset.length == 0) { return this; }
 
 
                         return this.each(function () {
                         return this.each(function () {
-                            targetScope({ "action": "mask", "el": this }, $.extend(true, {}, maskset), importAttributeOptions(this, opts));
+                            targetScope({ "action": "mask", "el": this }, $.extend(true, {}, $.isArray(maskset) && targetScope === maskScope ? maskset[0] : maskset), importAttributeOptions(this, opts));
                         });
                         });
                     case "unmaskedvalue":
                     case "unmaskedvalue":
                         var $input = $(this);
                         var $input = $(this);
@@ -1603,7 +1603,7 @@
                         maskset = generateMaskSet(opts);
                         maskset = generateMaskSet(opts);
                         if (maskset == undefined) { return this; }
                         if (maskset == undefined) { return this; }
                         return this.each(function () {
                         return this.each(function () {
-                            targetScope({ "action": "mask", "el": this }, $.extend(true, {}, maskset), importAttributeOptions(this, opts));
+                            targetScope({ "action": "mask", "el": this }, $.extend(true, {}, $.isArray(maskset) && targetScope === maskScope ? maskset[0] : maskset), importAttributeOptions(this, opts));
                         });
                         });
                 }
                 }
             } else if (typeof fn == "object") {
             } else if (typeof fn == "object") {
@@ -1613,7 +1613,7 @@
                 maskset = generateMaskSet(opts);
                 maskset = generateMaskSet(opts);
                 if (maskset == undefined) { return this; }
                 if (maskset == undefined) { return this; }
                 return this.each(function () {
                 return this.each(function () {
-                    targetScope({ "action": "mask", "el": this }, $.extend(true, {}, maskset), importAttributeOptions(this, opts));
+                    targetScope({ "action": "mask", "el": this }, $.extend(true, {}, $.isArray(maskset) && targetScope === maskScope ? maskset[0] : maskset), importAttributeOptions(this, opts));
                 });
                 });
             } else if (fn == undefined) {
             } else if (fn == undefined) {
                 //look for data-inputmask atribute - the attribute should only contain optipns
                 //look for data-inputmask atribute - the attribute should only contain optipns