Skip to content

Commit d0aed70

Browse files
committed
added module jsconf, issue victorjonsson#221
1 parent 41872c0 commit d0aed70

11 files changed

+58
-14
lines changed

form-validator/date.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/#location-validators
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.beta.55
13+
* @version 2.2.beta.56
1414
*/
1515
(function($) {
1616

form-validator/file.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.beta.55
13+
* @version 2.2.beta.56
1414
*/
1515
(function($, window) {
1616

form-validator/html5.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* @website http://formvalidator.net/
1919
* @license Dual licensed under the MIT or GPL Version 2 licenses
20-
* @version 2.2.beta.55
20+
* @version 2.2.beta.56
2121
*/
2222
(function($, window) {
2323

form-validator/jquery.form-validator.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @website http://formvalidator.net/
77
* @license Dual licensed under the MIT or GPL Version 2 licenses
8-
* @version 2.2.beta.55
8+
* @version 2.2.beta.56
99
*/
1010
(function($) {
1111

@@ -627,10 +627,9 @@
627627
$form.validateOnBlur(conf.language, conf);
628628
})
629629
}
630-
if( conf.validateOnEvent ){
631-
$form.validateOnEvent(conf.language, conf);
632-
}
633-
630+
if( conf.validateOnEvent ){
631+
$form.validateOnEvent(conf.language, conf);
632+
}
634633
});
635634

636635
if( conf.modules != '' ) {

form-validator/jquery.form-validator.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/jsconf.dev.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* jQuery Form Validator Module: JSconf
3+
* ------------------------------------------
4+
* Created by Victor Jonsson <http://www.victorjonsson.se>
5+
*
6+
* This module makes it possible to configure form validation using javascript
7+
*
8+
* @website http://formvalidator.net/#location-validators
9+
* @license Dual licensed under the MIT or GPL Version 2 licenses
10+
* @version 2.2.beta.56
11+
*/
12+
(function($) {
13+
14+
"use strict";
15+
16+
$.setupValidation = function(conf) {
17+
var $forms = $(conf.form || 'form');
18+
$.each(conf.validate || conf.validation || {}, function(elemRef, attr) {
19+
if( elemRef != 'form' ) {
20+
21+
var $elem;
22+
if( elemRef[0] == '#' ) {
23+
$elem = $(elemRef);
24+
} else if( elemRef[0] == '.' ) {
25+
$elem = $forms.find(elemRef);
26+
} else {
27+
$elem = $forms.find('*[name="' +elemRef+ '"]');
28+
}
29+
30+
$elem.attr('data-validation', attr.validation);
31+
32+
$.each(attr, function(name, val) {
33+
if( name != 'validation' ) {
34+
$elem.attr('data-validation-'+name, val);
35+
}
36+
});
37+
38+
}
39+
});
40+
41+
$.validate(conf);
42+
};
43+
44+
})(jQuery);

form-validator/jsconf.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/location.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/#location-validators
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.beta.55
13+
* @version 2.2.beta.56
1414
*/
1515
(function($) {
1616

form-validator/security.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* - cvv
1414
*
1515
* @website http://formvalidator.net/#security-validators
16-
* @version 2.2.beta.55
16+
* @version 2.2.beta.56
1717
*/
1818
(function($, window) {
1919

form-validator/sweden.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @website http://formvalidator.net/#swedish-validators
1515
* @license Dual licensed under the MIT or GPL Version 2 licenses
16-
* @version 2.2.beta.55
16+
* @version 2.2.beta.56
1717
*/
1818
(function($, window) {
1919

form-validator/uk.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* @website http://formvalidator.net/#uk-validators
1111
* @license Dual licensed under the MIT or GPL Version 2 licenses
12-
* @version 2.2.beta.55
12+
* @version 2.2.beta.56
1313
*/
1414
$.formUtils.addValidator({
1515
name : 'ukvatnumber',

0 commit comments

Comments
 (0)