|
1 |
| -(function($){ |
2 |
| - $.fn.validationEngineLanguage = function(){ |
3 |
| - }; |
4 |
| - $.validationEngineLanguage = { |
5 |
| - newLang: function(){ |
6 |
| - $.validationEngineLanguage.allRules = { |
7 |
| - "required": { // Add your regex rules here, you can take telephone as an example |
8 |
| - "regex": "none", |
9 |
| - "alertText": "* Dieses Feld ist ein Pflichtfeld", |
10 |
| - "alertTextCheckboxMultiple": "* Bitte wählen Sie eine Option", |
11 |
| - "alertTextCheckboxe": "* Dieses Feld ist ein Pflichtfeld" |
12 |
| - }, |
13 |
| - "requiredInFunction": { |
14 |
| - "func": function(field, rules, i, options){ |
15 |
| - return (field.val() == "test") ? true : false; |
16 |
| - }, |
17 |
| - "alertText": "* Field must equal test" |
18 |
| - }, |
19 |
| - "minSize": { |
20 |
| - "regex": "none", |
21 |
| - "alertText": "* Mindestens ", |
22 |
| - "alertText2": " Zeichen benötigt" |
23 |
| - }, |
24 |
| - "maxSize": { |
25 |
| - "regex": "none", |
26 |
| - "alertText": "* Maximal ", |
27 |
| - "alertText2": " Zeichen erlaubt" |
28 |
| - }, |
29 |
| - "groupRequired": { |
30 |
| - "regex": "none", |
31 |
| - "alertText": "* Sie müssen mindestens eines dieser Felder ausfüllen" |
32 |
| - }, |
33 |
| - "min": { |
34 |
| - "regex": "none", |
35 |
| - "alertText": "* Mindeswert ist " |
36 |
| - }, |
37 |
| - "max": { |
38 |
| - "regex": "none", |
39 |
| - "alertText": "* Maximalwert ist " |
40 |
| - }, |
41 |
| - "past": { |
42 |
| - "regex": "none", |
43 |
| - "alertText": "* Datum vor " |
44 |
| - }, |
45 |
| - "future": { |
46 |
| - "regex": "none", |
47 |
| - "alertText": "* Datum nach " |
48 |
| - }, |
49 |
| - "maxCheckbox": { |
50 |
| - "regex": "none", |
51 |
| - "alertText": "* Maximale Anzahl Markierungen überschritten" |
52 |
| - }, |
53 |
| - "minCheckbox": { |
54 |
| - "regex": "none", |
55 |
| - "alertText": "* Bitte wählen Sie ", |
56 |
| - "alertText2": " Optionen" |
57 |
| - }, |
58 |
| - "equals": { |
59 |
| - "regex": "none", |
60 |
| - "alertText": "* Felder stimmen nicht überein" |
61 |
| - }, |
62 |
| - "creditCard": { |
63 |
| - "regex": "none", |
64 |
| - "alertText": "* Ungültige Kreditkartennummer" |
65 |
| - }, |
66 |
| - "phone": { |
67 |
| - // credit: jquery.h5validate.js / orefalo |
68 |
| - "regex": /^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/, |
69 |
| - "alertText": "* Ungültige Telefonnummer" |
70 |
| - }, |
71 |
| - "email": { |
72 |
| - // Shamelessly lifted from Scott Gonzalez via the Bassistance Validation plugin http://projects.scottsplayground.com/email_address_validation/ |
73 |
| - "regex": /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, |
74 |
| - "alertText": "* Ungültige E-Mail Adresse" |
75 |
| - }, |
76 |
| - "integer": { |
77 |
| - "regex": /^[\-\+]?\d+$/, |
78 |
| - "alertText": "* Keine gültige Ganzzahl" |
79 |
| - }, |
80 |
| - "number": { |
81 |
| - // Number, including positive, negative, and floating decimal. credit: orefalo |
82 |
| - "regex": /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/, |
83 |
| - "alertText": "* Keine gültige Fließkommazahl" |
84 |
| - }, |
85 |
| - "date": { |
86 |
| - // Date in ISO format. Credit: bassistance |
87 |
| - "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/, |
88 |
| - "alertText": "* Ungültiges Datumsformat, erwartet wird das Format JJJJ-MM-TT" |
89 |
| - }, |
90 |
| - "ipv4": { |
91 |
| - "regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/, |
92 |
| - "alertText": "* Ungültige IP Adresse" |
93 |
| - }, |
94 |
| - "url": { |
95 |
| - "regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i, |
96 |
| - "alertText": "* Ungültige URL" |
97 |
| - }, |
98 |
| - "onlyLetterSp": { |
99 |
| - "regex": /^[a-zA-ZäüöÄÜÖßs\ \\\']+$/, |
100 |
| - "alertText": "* Nur Buchstaben erlaubt" |
101 |
| - }, |
102 |
| - "onlyLetterNumber": { |
103 |
| - "regex": /^[0-9a-zA-ZäüöÄÜÖßs-]+$/, |
104 |
| - "alertText": "* Keine Sonderzeichen erlaubt" |
105 |
| - }, |
106 |
| - "onlyLetterNumber": { |
107 |
| - "regex": /^[0-9a-zA-Z]+$/, |
108 |
| - "alertText": "* Keine Sonderzeichen erlaubt" |
109 |
| - }, |
110 |
| - // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings |
111 |
| - "ajaxUserCall": { |
112 |
| - "url": "ajaxValidateFieldUser", |
113 |
| - // you may want to pass extra data on the ajax call |
114 |
| - "extraData": "name=eric", |
115 |
| - "alertText": "* Dieser Benutzer ist bereits vergeben", |
116 |
| - "alertTextLoad": "* Überprüfe Angaben, bitte warten" |
117 |
| - }, |
118 |
| - "ajaxNameCall": { |
119 |
| - // remote json service location |
120 |
| - "url": "ajaxValidateFieldName", |
121 |
| - // error |
122 |
| - "alertText": "* Dieser Name ist bereits vergeben", |
123 |
| - // if you provide an "alertTextOk", it will show as a green prompt when the field validates |
124 |
| - "alertTextOk": "* Dieser Name ist verfügbar", |
125 |
| - // speaks by itself |
126 |
| - "alertTextLoad": "* Überprüfe Angaben, bitte warten" |
127 |
| - }, |
128 |
| - "validate2fields": { |
129 |
| - "alertText": "* Bitte HELLO eingeben" |
130 |
| - } |
131 |
| - }; |
132 |
| - |
133 |
| - } |
134 |
| - }; |
135 |
| - $.validationEngineLanguage.newLang(); |
136 |
| -})(jQuery); |
137 |
| - |
138 |
| - |
139 |
| - |
| 1 | +(function($){ |
| 2 | + $.fn.validationEngineLanguage = function(){ |
| 3 | + }; |
| 4 | + $.validationEngineLanguage = { |
| 5 | + newLang: function(){ |
| 6 | + $.validationEngineLanguage.allRules = { |
| 7 | + "required": { // Add your regex rules here, you can take telephone as an example |
| 8 | + "regex": "none", |
| 9 | + "alertText": "* Dieses Feld ist ein Pflichtfeld", |
| 10 | + "alertTextCheckboxMultiple": "* Bitte wählen Sie eine Option", |
| 11 | + "alertTextCheckboxe": "* Dieses Feld ist ein Pflichtfeld" |
| 12 | + }, |
| 13 | + "requiredInFunction": { |
| 14 | + "func": function(field, rules, i, options){ |
| 15 | + return (field.val() == "test") ? true : false; |
| 16 | + }, |
| 17 | + "alertText": "* Field must equal test" |
| 18 | + }, |
| 19 | + "minSize": { |
| 20 | + "regex": "none", |
| 21 | + "alertText": "* Mindestens ", |
| 22 | + "alertText2": " Zeichen benötigt" |
| 23 | + }, |
| 24 | + "maxSize": { |
| 25 | + "regex": "none", |
| 26 | + "alertText": "* Maximal ", |
| 27 | + "alertText2": " Zeichen erlaubt" |
| 28 | + }, |
| 29 | + "groupRequired": { |
| 30 | + "regex": "none", |
| 31 | + "alertText": "* Sie müssen mindestens eines dieser Felder ausfüllen" |
| 32 | + }, |
| 33 | + "min": { |
| 34 | + "regex": "none", |
| 35 | + "alertText": "* Mindestwert ist " |
| 36 | + }, |
| 37 | + "max": { |
| 38 | + "regex": "none", |
| 39 | + "alertText": "* Maximalwert ist " |
| 40 | + }, |
| 41 | + "past": { |
| 42 | + "regex": "none", |
| 43 | + "alertText": "* Datum vor " |
| 44 | + }, |
| 45 | + "future": { |
| 46 | + "regex": "none", |
| 47 | + "alertText": "* Datum nach " |
| 48 | + }, |
| 49 | + "maxCheckbox": { |
| 50 | + "regex": "none", |
| 51 | + "alertText": "* Maximale Anzahl Markierungen überschritten" |
| 52 | + }, |
| 53 | + "minCheckbox": { |
| 54 | + "regex": "none", |
| 55 | + "alertText": "* Bitte wählen Sie ", |
| 56 | + "alertText2": " Optionen" |
| 57 | + }, |
| 58 | + "equals": { |
| 59 | + "regex": "none", |
| 60 | + "alertText": "* Felder stimmen nicht überein" |
| 61 | + }, |
| 62 | + "creditCard": { |
| 63 | + "regex": "none", |
| 64 | + "alertText": "* Ungültige Kreditkartennummer" |
| 65 | + }, |
| 66 | + "phone": { |
| 67 | + // credit: jquery.h5validate.js / orefalo |
| 68 | + "regex": /^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/, |
| 69 | + "alertText": "* Ungültige Telefonnummer" |
| 70 | + }, |
| 71 | + "email": { |
| 72 | + // Shamelessly lifted from Scott Gonzalez via the Bassistance Validation plugin http://projects.scottsplayground.com/email_address_validation/ |
| 73 | + "regex": /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, |
| 74 | + "alertText": "* Ungültige E-Mail-Adresse" |
| 75 | + }, |
| 76 | + "integer": { |
| 77 | + "regex": /^[\-\+]?\d+$/, |
| 78 | + "alertText": "* Keine gültige Ganzzahl" |
| 79 | + }, |
| 80 | + "number": { |
| 81 | + // Number, including positive, negative, and floating decimal. credit: orefalo |
| 82 | + "regex": /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/, |
| 83 | + "alertText": "* Keine gültige Fließkommazahl" |
| 84 | + }, |
| 85 | + "date": { |
| 86 | + // Date in ISO format. Credit: bassistance |
| 87 | + "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/, |
| 88 | + "alertText": "* Ungültiges Datumsformat, erwartet wird das Format JJJJ-MM-TT" |
| 89 | + }, |
| 90 | + "ipv4": { |
| 91 | + "regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/, |
| 92 | + "alertText": "* Ungültige IP-Adresse" |
| 93 | + }, |
| 94 | + "url": { |
| 95 | + "regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i, |
| 96 | + "alertText": "* Ungültige URL" |
| 97 | + }, |
| 98 | + "onlyLetterSp": { |
| 99 | + "regex": /^[a-zA-ZäüöÄÜÖßs\ \\\']+$/, |
| 100 | + "alertText": "* Nur Buchstaben erlaubt" |
| 101 | + }, |
| 102 | + "onlyLetterNumber": { |
| 103 | + "regex": /^[0-9a-zA-ZäüöÄÜÖßs-]+$/, |
| 104 | + "alertText": "* Keine Sonderzeichen erlaubt" |
| 105 | + }, |
| 106 | + "onlyLetterNumber": { |
| 107 | + "regex": /^[0-9a-zA-Z]+$/, |
| 108 | + "alertText": "* Keine Sonderzeichen erlaubt" |
| 109 | + }, |
| 110 | + // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings |
| 111 | + "ajaxUserCall": { |
| 112 | + "url": "ajaxValidateFieldUser", |
| 113 | + // you may want to pass extra data on the ajax call |
| 114 | + "extraData": "name=eric", |
| 115 | + "alertText": "* Dieser Benutzer ist bereits vergeben", |
| 116 | + "alertTextLoad": "* Überprüfe Angaben, bitte warten" |
| 117 | + }, |
| 118 | + "ajaxNameCall": { |
| 119 | + // remote json service location |
| 120 | + "url": "ajaxValidateFieldName", |
| 121 | + // error |
| 122 | + "alertText": "* Dieser Name ist bereits vergeben", |
| 123 | + // if you provide an "alertTextOk", it will show as a green prompt when the field validates |
| 124 | + "alertTextOk": "* Dieser Name ist verfügbar", |
| 125 | + // speaks by itself |
| 126 | + "alertTextLoad": "* Überprüfe Angaben, bitte warten" |
| 127 | + }, |
| 128 | + "validate2fields": { |
| 129 | + "alertText": "* Bitte HELLO eingeben" |
| 130 | + } |
| 131 | + }; |
| 132 | + |
| 133 | + } |
| 134 | + }; |
| 135 | + $.validationEngineLanguage.newLang(); |
| 136 | +})(jQuery); |
| 137 | + |
| 138 | + |
| 139 | + |
0 commit comments