浏览代码

add inputmask-multi format support + metadata in mask #324

Robin Herbots 12 年之前
父节点
当前提交
056b5801b2

+ 20 - 0
README.md

@@ -336,6 +336,26 @@ This can be usefull when the masks are too different to solve it with optional p
   $(selector).inputmask({ mask: ["999.999", "aa-aa-aa"]});
 ```
 
+#### inputmask-multi format
+
+You can also pass an array for masking with the a format alike the format used in inputmask-multi
+
+```javascript
+var phones = [
+            { "mask": "+247-####", "cc": "AC", "name_en": "Ascension", "desc_en": "", "name_ru": "Остров Вознесения", "desc_ru": "" },
+            { "mask": "+376-###-###", "cc": "AD", "name_en": "Andorra", "desc_en": "", "name_ru": "Андорра", "desc_ru": "" },
+            { "mask": "+971-5#-###-####", "cc": "AE", "name_en": "United Arab Emirates", "desc_en": "mobile", "name_ru": "Объединенные Арабские Эмираты", "desc_ru": "мобильные" },
+          ...
+]
+$(selector).inputmask({ mask: phones, definitions: { '#': { validator: "[0-9]", cardinality: 1}} }); //in case of inputmask-multi you need to specify the validator for #
+```
+
+The metadata of the actual mask provided in the mask definitions can be obtained by calling
+
+```javascript
+$(selector).inputmask("getmetadata");
+```
+
 ### aliases option
 
 First you have to create an alias definition (more examples can be found in jquery.inputmask.extensions.js)

+ 1 - 1
build.properties

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

+ 1 - 1
component.json

@@ -1,6 +1,6 @@
 {
     "name": "jquery.inputmask",
-    "version": "2.3.26",
+    "version": "2.3.27",
     "main": "./dist/jquery.inputmask.bundle.js",
     "dependencies": {
         "jquery": ">=1.5"

二进制
dist/jQuery.InputMask.2.3.26.nupkg


二进制
dist/jQuery.InputMask.2.3.27.nupkg


+ 5 - 5
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2013 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 2.3.26
+* Version: 2.3.27
 */
 
 (function ($) {
@@ -1572,7 +1572,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.26
+Version: 2.3.27
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1674,7 +1674,7 @@ Input Mask plugin extensions
 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: 2.3.26
+Version: 2.3.27
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2151,7 +2151,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.26
+Version: 2.3.27
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2320,7 +2320,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.26
+Version: 2.3.27
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask

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


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


+ 1 - 1
jquery.inputmask.jquery.json

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