|
1 | 1 | /** |
2 | | - * RestrictedTextField v1.0 |
| 2 | + * RestrictedTextField v1.0.1 |
3 | 3 | * https://www.github.com/kloverde/jquery-RestrictedTextField |
4 | 4 | * |
5 | 5 | * This software is licensed under the 3-clause BSD license. |
|
14 | 14 |
|
15 | 15 | /** |
16 | 16 | * Developers: Instantiate this to add your own types |
17 | | - */ |
| 17 | + */ |
18 | 18 | $.fn.RestrictedTextFieldConfig = function() { |
19 | 19 | var dest = $.fn.RestrictedTextFieldConfig.customTypes = $.fn.RestrictedTextFieldConfig.customTypes || []; |
20 | 20 |
|
21 | | - return { |
22 | | - /** |
23 | | - * Adds a custom type |
24 | | - * |
25 | | - * @param id - The identifier you will use to access the new type |
26 | | - * |
27 | | - * @param fullRegex - RegExp object. This regular expression describes what a valid value looks like when the user is finished |
28 | | - * entering data, NOT what valid input looks like as it's being entered. If your type is complex, like a |
29 | | - * phone number for example, you need to provide a value for partialRegex to ensure that your user will be |
30 | | - * able to continue to type into the field. If partialRegex is not defined or is null, the text field will |
31 | | - * be validated against this regular expression on every keystroke. Notwithstanding any of the foregoing, |
32 | | - * this regular expression is also used to validate the text field on blur. |
33 | | - * |
34 | | - * @param partialRegex - RegExp object. This regular expression describes what a valid value looks like while the user is entering |
35 | | - * it, NOT what valid input looks like after the user has finished. If you provide a value for this, this |
36 | | - * regular expression will be used to validate the text field on every keystroke. This parameter may be |
37 | | - * null, but if your type is complex, you will find it necessary to provide a value. |
38 | | - */ |
39 | | - addType : function addType( id, fullRegex, partialRegex ) { |
40 | | - _addType( dest, id, fullRegex, partialRegex ); |
41 | | - } |
42 | | - }; |
| 21 | + /** |
| 22 | + * Adds a custom type |
| 23 | + * |
| 24 | + * @param id - The identifier you will use to access the new type |
| 25 | + * |
| 26 | + * @param fullRegex - RegExp object. This regular expression describes what a valid value looks like when the user is finished |
| 27 | + * entering data, NOT what valid input looks like as it's being entered. If your type is complex, like a |
| 28 | + * phone number for example, you need to provide a value for partialRegex to ensure that your user will be |
| 29 | + * able to continue to type into the field. If partialRegex is not defined or is null, the text field will |
| 30 | + * be validated against this regular expression on every keystroke. Notwithstanding any of the foregoing, |
| 31 | + * this regular expression is also used to validate the text field on blur. |
| 32 | + * |
| 33 | + * @param partialRegex - RegExp object. This regular expression describes what a valid value looks like while the user is entering |
| 34 | + * it, NOT what valid input looks like after the user has finished. If you provide a value for this, this |
| 35 | + * regular expression will be used to validate the text field on every keystroke. This parameter may be |
| 36 | + * null, but if your type is complex, you will find it necessary to provide a value. |
| 37 | + */ |
| 38 | + this.addType = function( id, fullRegex, partialRegex ) { |
| 39 | + _addType( dest, id, fullRegex, partialRegex ); |
| 40 | + } |
43 | 41 | }; |
44 | 42 |
|
45 | 43 | $.fn.restrictedTextField = function( options ) { |
|
0 commit comments