dqs-jquery-form-validator-rails 2.2.164 → 2.2.165
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -14
- data/app/assets/javascripts/brazil.dev.js +6 -6
- data/app/assets/javascripts/brazil.js +3 -4
- data/app/assets/javascripts/date.dev.js +2 -2
- data/app/assets/javascripts/date.js +2 -3
- data/app/assets/javascripts/file.dev.js +30 -32
- data/app/assets/javascripts/file.js +3 -4
- data/app/assets/javascripts/html5.dev.js +9 -14
- data/app/assets/javascripts/html5.js +3 -4
- data/app/assets/javascripts/jquery.form-validator.js +1784 -0
- data/app/assets/javascripts/jquery.form-validator.min.js +3 -4
- data/app/assets/javascripts/jsconf.dev.js +8 -21
- data/app/assets/javascripts/jsconf.js +3 -4
- data/app/assets/javascripts/lang/de.dev.js +43 -45
- data/app/assets/javascripts/lang/de.js +3 -4
- data/app/assets/javascripts/lang/es.dev.js +40 -39
- data/app/assets/javascripts/lang/es.js +3 -4
- data/app/assets/javascripts/lang/fr.dev.js +43 -42
- data/app/assets/javascripts/lang/fr.js +3 -4
- data/app/assets/javascripts/lang/pt.dev.js +2 -3
- data/app/assets/javascripts/lang/pt.js +3 -4
- data/app/assets/javascripts/lang/sv.dev.js +2 -3
- data/app/assets/javascripts/lang/sv.js +3 -4
- data/app/assets/javascripts/location.dev.js +1 -1
- data/app/assets/javascripts/location.js +2 -3
- data/app/assets/javascripts/sanitize.dev.js +30 -39
- data/app/assets/javascripts/sanitize.js +3 -4
- data/app/assets/javascripts/security.dev.js +34 -51
- data/app/assets/javascripts/security.js +3 -4
- data/app/assets/javascripts/sweden.dev.js +13 -16
- data/app/assets/javascripts/sweden.js +3 -4
- data/app/assets/javascripts/toggleDisabled.dev.js +5 -6
- data/app/assets/javascripts/toggleDisabled.js +3 -4
- data/app/assets/javascripts/uk.dev.js +13 -13
- data/app/assets/javascripts/uk.js +3 -4
- data/lib/dqs/jquery/form/validator/rails/version.rb +1 -1
- metadata +2 -17
- data/app/assets/javascripts/lang/cz.dev.js +0 -65
- data/app/assets/javascripts/lang/cz.js +0 -9
- data/app/assets/javascripts/lang/it.dev.js +0 -62
- data/app/assets/javascripts/lang/it.js +0 -9
- data/app/assets/javascripts/lang/pl.dev.js +0 -65
- data/app/assets/javascripts/lang/pl.js +0 -9
- data/app/assets/javascripts/lang/ro.dev.js +0 -65
- data/app/assets/javascripts/lang/ro.js +0 -9
- data/app/assets/javascripts/lang/ru.dev.js +0 -66
- data/app/assets/javascripts/lang/ru.js +0 -9
- data/app/assets/javascripts/src/core-validators.js +0 -343
- data/app/assets/javascripts/src/dialogs.js +0 -123
- data/app/assets/javascripts/src/jquery-plugins.js +0 -452
- data/app/assets/javascripts/src/module-loader.js +0 -150
- data/app/assets/javascripts/src/setup.js +0 -168
- data/app/assets/javascripts/src/utils.js +0 -840
@@ -1,168 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Setup function for the plugin
|
3
|
-
*/
|
4
|
-
(function ($) {
|
5
|
-
|
6
|
-
'use strict';
|
7
|
-
|
8
|
-
|
9
|
-
/**
|
10
|
-
* A bit smarter split function
|
11
|
-
* delimiter can be space, comma, dash or pipe
|
12
|
-
* @param {String} val
|
13
|
-
* @param {Function|String} [callback]
|
14
|
-
* @returns {Array|void}
|
15
|
-
*/
|
16
|
-
$.split = function (val, callback) {
|
17
|
-
if (typeof callback !== 'function') {
|
18
|
-
// return array
|
19
|
-
if (!val) {
|
20
|
-
return [];
|
21
|
-
}
|
22
|
-
var values = [];
|
23
|
-
$.each(val.split(callback ? callback : /[,|\-\s]\s*/g),
|
24
|
-
function (i, str) {
|
25
|
-
str = $.trim(str);
|
26
|
-
if (str.length) {
|
27
|
-
values.push(str);
|
28
|
-
}
|
29
|
-
}
|
30
|
-
);
|
31
|
-
return values;
|
32
|
-
} else if (val) {
|
33
|
-
// exec callback func on each
|
34
|
-
$.each(val.split(/[,|\-\s]\s*/g),
|
35
|
-
function (i, str) {
|
36
|
-
str = $.trim(str);
|
37
|
-
if (str.length) {
|
38
|
-
return callback(str, i);
|
39
|
-
}
|
40
|
-
}
|
41
|
-
);
|
42
|
-
}
|
43
|
-
};
|
44
|
-
|
45
|
-
/**
|
46
|
-
* Short hand function that makes the validation setup require less code
|
47
|
-
* @param conf
|
48
|
-
*/
|
49
|
-
$.validate = function (conf) {
|
50
|
-
|
51
|
-
var defaultConf = $.extend($.formUtils.defaultConfig(), {
|
52
|
-
form: 'form',
|
53
|
-
validateOnEvent: false,
|
54
|
-
validateOnBlur: true,
|
55
|
-
validateCheckboxRadioOnClick: true,
|
56
|
-
showHelpOnFocus: true,
|
57
|
-
addSuggestions: true,
|
58
|
-
modules: '',
|
59
|
-
onModulesLoaded: null,
|
60
|
-
language: false,
|
61
|
-
onSuccess: false,
|
62
|
-
onError: false,
|
63
|
-
onElementValidate: false
|
64
|
-
});
|
65
|
-
|
66
|
-
conf = $.extend(defaultConf, conf || {});
|
67
|
-
|
68
|
-
if( conf.lang && conf.lang !== 'en' ) {
|
69
|
-
var langModule = 'lang/'+conf.lang+'.js';
|
70
|
-
conf.modules += conf.modules.length ? ','+langModule : langModule;
|
71
|
-
}
|
72
|
-
|
73
|
-
// Add validation to forms
|
74
|
-
$(conf.form).each(function (i, form) {
|
75
|
-
|
76
|
-
// Make a reference to the config for this form
|
77
|
-
form.validationConfig = conf;
|
78
|
-
|
79
|
-
// Trigger jQuery event that we're about to setup validation
|
80
|
-
var $form = $(form);
|
81
|
-
$.formUtils.$win.trigger('formValidationSetup', [$form, conf]);
|
82
|
-
$form.trigger('formValidationSetup', [conf]);
|
83
|
-
|
84
|
-
// Remove classes and event handlers that might have been
|
85
|
-
// added by a previous call to $.validate
|
86
|
-
$form.find('.has-help-txt')
|
87
|
-
.unbind('focus.validation')
|
88
|
-
.unbind('blur.validation');
|
89
|
-
|
90
|
-
$form
|
91
|
-
.removeClass('has-validation-callback')
|
92
|
-
.unbind('submit.validation')
|
93
|
-
.unbind('reset.validation')
|
94
|
-
.find('input[data-validation],textarea[data-validation]')
|
95
|
-
.unbind('blur.validation');
|
96
|
-
|
97
|
-
// Validate when submitted
|
98
|
-
$form.bind('submit.validation', function () {
|
99
|
-
|
100
|
-
var $form = $(this);
|
101
|
-
|
102
|
-
if ($.formUtils.haltValidation) {
|
103
|
-
// pressing several times on submit button while validation is halted
|
104
|
-
return false;
|
105
|
-
}
|
106
|
-
|
107
|
-
if ($.formUtils.isLoadingModules) {
|
108
|
-
setTimeout(function () {
|
109
|
-
$form.trigger('submit.validation');
|
110
|
-
}, 200);
|
111
|
-
return false;
|
112
|
-
}
|
113
|
-
|
114
|
-
var valid = $form.isValid(conf.language, conf);
|
115
|
-
|
116
|
-
if ($.formUtils.haltValidation) {
|
117
|
-
// Validation got halted by one of the validators
|
118
|
-
return false;
|
119
|
-
} else {
|
120
|
-
if (valid && typeof conf.onSuccess === 'function') {
|
121
|
-
var callbackResponse = conf.onSuccess($form);
|
122
|
-
if (callbackResponse === false) {
|
123
|
-
return false;
|
124
|
-
}
|
125
|
-
} else if (!valid && typeof conf.onError === 'function') {
|
126
|
-
conf.onError($form);
|
127
|
-
return false;
|
128
|
-
} else {
|
129
|
-
return valid;
|
130
|
-
}
|
131
|
-
}
|
132
|
-
})
|
133
|
-
.bind('reset.validation', function () {
|
134
|
-
var $this = $(this),
|
135
|
-
$elems = $this.find('.' + conf.errorElementClass + ',.valid');
|
136
|
-
$this.find('.' + conf.errorMessageClass + '.alert').remove();
|
137
|
-
$.formUtils.errorDialogs.removeErrorStyling($elems, conf);
|
138
|
-
})
|
139
|
-
.addClass('has-validation-callback');
|
140
|
-
|
141
|
-
if (conf.showHelpOnFocus) {
|
142
|
-
$form.showHelpOnFocus();
|
143
|
-
}
|
144
|
-
if (conf.addSuggestions) {
|
145
|
-
$form.addSuggestions();
|
146
|
-
}
|
147
|
-
if (conf.validateOnBlur) {
|
148
|
-
$form.validateOnBlur(conf.language, conf);
|
149
|
-
$form.bind('html5ValidationAttrsFound', function () {
|
150
|
-
$form.validateOnBlur(conf.language, conf);
|
151
|
-
});
|
152
|
-
}
|
153
|
-
if (conf.validateOnEvent) {
|
154
|
-
$form.validateOnEvent(conf.language, conf);
|
155
|
-
}
|
156
|
-
});
|
157
|
-
|
158
|
-
if (conf.modules !== '') {
|
159
|
-
$.formUtils.loadModules(conf.modules, false, function() {
|
160
|
-
if (typeof conf.onModulesLoaded === 'function') {
|
161
|
-
conf.onModulesLoaded();
|
162
|
-
}
|
163
|
-
$.formUtils.$win.trigger('validatorsLoaded', [typeof conf.form === 'string' ? $(conf.form) : conf.form, conf]);
|
164
|
-
});
|
165
|
-
}
|
166
|
-
};
|
167
|
-
|
168
|
-
})(jQuery);
|