ソースを参照

valhook fix from andywolk

Robin Herbots 12 年 前
コミット
dc78e2111e

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 
 build.major = 2
 build.major = 2
 build.minor = 4
 build.minor = 4
-build.revision = 1
+build.revision = 2
 
 
 target = jquery.inputmask.bundle.js
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js
 target.min = jquery.inputmask.bundle.min.js

+ 1 - 1
component.json

@@ -1,6 +1,6 @@
 {
 {
     "name": "jquery.inputmask",
     "name": "jquery.inputmask",
-    "version": "2.4.1",
+    "version": "2.4.2",
     "main": "./dist/jquery.inputmask.bundle.js",
     "main": "./dist/jquery.inputmask.bundle.js",
     "dependencies": {
     "dependencies": {
         "jquery": ">=1.7"
         "jquery": ">=1.7"

BIN
dist/jQuery.InputMask.2.4.1.nupkg


BIN
dist/jQuery.InputMask.2.4.2.nupkg


+ 11 - 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 - 2013 Robin Herbots
 * Copyright (c) 2010 - 2013 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: 2.4.1
+* Version: 2.4.2
 */
 */
 
 
 (function ($) {
 (function ($) {
@@ -1241,8 +1241,8 @@
                                 npt._valueSet = function (value) { this.value = isRTL ? value.split('').reverse().join('') : value; };
                                 npt._valueSet = function (value) { this.value = isRTL ? value.split('').reverse().join('') : value; };
                             }
                             }
                             if ($.valHooks.text == undefined || $.valHooks.text.inputmaskpatch != true) {
                             if ($.valHooks.text == undefined || $.valHooks.text.inputmaskpatch != true) {
-                                var valueGet = $.valHooks.text && $.valHooks.text.get ? $.valHooks.text.get : function () { return this.value; };
-                                var valueSet = $.valHooks.text && $.valHooks.text.set ? $.valHooks.text.set : function (value) { return this.value = value; };
+                                var valueGet = $.valHooks.text && $.valHooks.text.get ? $.valHooks.text.get : function (elem) { return elem.value; };
+                                var valueSet = $.valHooks.text && $.valHooks.text.set ? $.valHooks.text.set : function (elem, value) { elem.value = value; return elem; };
 
 
                                 jQuery.extend($.valHooks, {
                                 jQuery.extend($.valHooks, {
                                     text: {
                                     text: {
@@ -1252,16 +1252,16 @@
                                                 if ($elem.data('_inputmask')['opts'].autoUnmask)
                                                 if ($elem.data('_inputmask')['opts'].autoUnmask)
                                                     return $elem.inputmask('unmaskedvalue');
                                                     return $elem.inputmask('unmaskedvalue');
                                                 else {
                                                 else {
-                                                    var result = valueGet.call(elem),
+                                                    var result = valueGet(elem),
                                                         inputData = $elem.data('_inputmask'), masksets = inputData['masksets'],
                                                         inputData = $elem.data('_inputmask'), masksets = inputData['masksets'],
                                                         activeMasksetIndex = inputData['activeMasksetIndex'];
                                                         activeMasksetIndex = inputData['activeMasksetIndex'];
                                                     return result != masksets[activeMasksetIndex]['_buffer'].join('') ? result : '';
                                                     return result != masksets[activeMasksetIndex]['_buffer'].join('') ? result : '';
                                                 }
                                                 }
-                                            } else return valueGet.call(elem);
+                                            } else return valueGet(elem);
                                         },
                                         },
                                         set: function (elem, value) {
                                         set: function (elem, value) {
                                             var $elem = $(elem);
                                             var $elem = $(elem);
-                                            var result = valueSet.call(elem, value);
+                                            var result = valueSet(elem, value);
                                             if ($elem.data('_inputmask')) $elem.triggerHandler('setvalue.inputmask');
                                             if ($elem.data('_inputmask')) $elem.triggerHandler('setvalue.inputmask');
                                             return result;
                                             return result;
                                         },
                                         },
@@ -1645,7 +1645,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 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: 2.4.1
+Version: 2.4.2
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -1767,7 +1767,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2012 Robin Herbots
 Copyright (c) 2010 - 2012 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: 2.4.1
+Version: 2.4.2
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2251,7 +2251,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 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: 2.4.1
+Version: 2.4.2
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2428,7 +2428,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 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: 2.4.1
+Version: 2.4.2
 
 
 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
@@ -2598,7 +2598,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Copyright (c) 2010 - 2013 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: 2.4.1
+Version: 2.4.2
 
 
 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

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


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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 5 - 5
js/jquery.inputmask.js

@@ -1241,8 +1241,8 @@
                                 npt._valueSet = function (value) { this.value = isRTL ? value.split('').reverse().join('') : value; };
                                 npt._valueSet = function (value) { this.value = isRTL ? value.split('').reverse().join('') : value; };
                             }
                             }
                             if ($.valHooks.text == undefined || $.valHooks.text.inputmaskpatch != true) {
                             if ($.valHooks.text == undefined || $.valHooks.text.inputmaskpatch != true) {
-                                var valueGet = $.valHooks.text && $.valHooks.text.get ? $.valHooks.text.get : function () { return this.value; };
-                                var valueSet = $.valHooks.text && $.valHooks.text.set ? $.valHooks.text.set : function (value) { return this.value = value; };
+                                var valueGet = $.valHooks.text && $.valHooks.text.get ? $.valHooks.text.get : function (elem) { return elem.value; };
+                                var valueSet = $.valHooks.text && $.valHooks.text.set ? $.valHooks.text.set : function (elem, value) { elem.value = value; return elem; };
 
 
                                 jQuery.extend($.valHooks, {
                                 jQuery.extend($.valHooks, {
                                     text: {
                                     text: {
@@ -1252,16 +1252,16 @@
                                                 if ($elem.data('_inputmask')['opts'].autoUnmask)
                                                 if ($elem.data('_inputmask')['opts'].autoUnmask)
                                                     return $elem.inputmask('unmaskedvalue');
                                                     return $elem.inputmask('unmaskedvalue');
                                                 else {
                                                 else {
-                                                    var result = valueGet.call(elem),
+                                                    var result = valueGet(elem),
                                                         inputData = $elem.data('_inputmask'), masksets = inputData['masksets'],
                                                         inputData = $elem.data('_inputmask'), masksets = inputData['masksets'],
                                                         activeMasksetIndex = inputData['activeMasksetIndex'];
                                                         activeMasksetIndex = inputData['activeMasksetIndex'];
                                                     return result != masksets[activeMasksetIndex]['_buffer'].join('') ? result : '';
                                                     return result != masksets[activeMasksetIndex]['_buffer'].join('') ? result : '';
                                                 }
                                                 }
-                                            } else return valueGet.call(elem);
+                                            } else return valueGet(elem);
                                         },
                                         },
                                         set: function (elem, value) {
                                         set: function (elem, value) {
                                             var $elem = $(elem);
                                             var $elem = $(elem);
-                                            var result = valueSet.call(elem, value);
+                                            var result = valueSet(elem, value);
                                             if ($elem.data('_inputmask')) $elem.triggerHandler('setvalue.inputmask');
                                             if ($elem.data('_inputmask')) $elem.triggerHandler('setvalue.inputmask');
                                             return result;
                                             return result;
                                         },
                                         },

+ 22 - 36
js/phone-codes/phone-be.json

@@ -1,11 +1,3 @@
-/*
-Input Mask plugin - Belgian phone codes
-http://github.com/RobinHerbots/jquery.inputmask
-Copyright (c) 2010 - 2012 Robin Herbots
-Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 0.0.0
-*/
-
 [
 [
 	{ "mask": "+32(53)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Aalst (Alost)" },
 	{ "mask": "+32(53)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Aalst (Alost)" },
 	{ "mask": "+32(3)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Antwerpen (Anvers)" },
 	{ "mask": "+32(3)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Antwerpen (Anvers)" },
@@ -28,32 +20,26 @@ Version: 0.0.0
 	{ "mask": "+32(64)##-##-##", "cc": "BE", "cd": "Belgium", "city": "La Louvière" },
 	{ "mask": "+32(64)##-##-##", "cc": "BE", "cd": "Belgium", "city": "La Louvière" },
 	{ "mask": "+32(16)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Leuven (Louvain)" },
 	{ "mask": "+32(16)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Leuven (Louvain)" },
 	{ "mask": "+32(61)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Libramont" },
 	{ "mask": "+32(61)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Libramont" },
-Liège (Luik)	+32    4
-Mechelen (Malines)	+32    15
-Mobile Phones - Base	+32    485
-486
-Mobile Phones - Mobistar	+32    495
-496
-49
-Mobile Phones - Proximus	+32    472
-473
-47
-Mons (Bergen)	+32    65
-Namur (Namen)	+32    81
-Nieuwpoort (Nieuport)	+32    58
-Ninove	+32    54
-Nivelles (Nijvel)	+32    67
-Oostende (Ostende) "Ostend"	+32    59
-Roeselare (Roulers)	+32    51
-Ronse	+32    55
-Stavelot	+32    80
-Tongeren (Tongres)	+32    12
-Tounai	+32    69
-Turnhout	+32    14
-Verviers	+32    87
-Veurne	+32    58
-Wareme	+32    19
-Wavre (Waver)	+32    10
-Zeebrugge	+32    50
-
+	{ "mask": "+32(4)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Liège (Luik)" },
+	{ "mask": "+32(15)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mechelen (Malines)" },
+	{ "mask": "+32(47#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones" },    
+	{ "mask": "+32(48#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones" },    
+	{ "mask": "+32(49#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones" },    
+	{ "mask": "+32(65)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mons (Bergen)" },
+	{ "mask": "+32(81)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Namur (Namen)" },	
+	{ "mask": "+32(58)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Nieuwpoort (Nieuport)" },	
+	{ "mask": "+32(54)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ninove" },
+	{ "mask": "+32(67)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Nivelles (Nijvel)" },
+	{ "mask": "+32(59)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Oostende (Ostende)" },
+	{ "mask": "+32(51)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Roeselare (Roulers)" },
+	{ "mask": "+32(55)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ronse" },	
+	{ "mask": "+32(80)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Stavelot" },
+	{ "mask": "+32(12)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Tongeren (Tongres)" },
+	{ "mask": "+32(69)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Tounai" },
+	{ "mask": "+32(14)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Turnhout" },
+	{ "mask": "+32(87)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Verviers" },
+	{ "mask": "+32(58)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Veurne" },
+	{ "mask": "+32(19)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Wareme" },
+	{ "mask": "+32(10)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Wavre (Waver)" },
+	{ "mask": "+32(50)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Zeebrugge" }
 ]
 ]