Skip to content

Commit 711dd71

Browse files
Victor JonssonVictor Jonsson
authored andcommitted
version 2.2.8 on the way
1 parent 38cc4d6 commit 711dd71

39 files changed

+127
-85
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module.exports = function(grunt) {
5151
// Banner definitions
5252
meta: {
5353
banner: "/**\n" +
54-
" * <%= pkg.title || pkg.name %> %>\n" +
54+
" * <%= (pkg.title || pkg.name).toUpperCase() %>\n" +
5555
" *\n" +
5656
" * @website by <%= pkg.author.homepage %>\n" +
5757
" * @license <%= pkg.license %>\n" +

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,14 @@ it calls jQ func **$.formUtils.validateInput** to validate the single input when
236236

237237
## Changelog
238238

239+
#### 2.2.8 (unreleased)
240+
- The plugin is now again possible to install via bower.
241+
- Portoguese language pack and validators
242+
- New module used for data-sanitiation
243+
- E-mail addresses now validated in accordance to rfc 6531
244+
- Now possible to use $.fn.validate to programmatically validate inputs
245+
- Hidden inputs won't get validated by default (can be overriden using option validateHiddenInputs)
246+
239247

240248
#### 2.2.43
241249
- Fixed min/max parse error in HTML5 module

form-validator/brazil.dev.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
* - brphone
1111
*
1212
* @website http://formvalidator.net/#brazil-validators
13-
* @license Dual licensed under the MIT or GPL Version 2 licenses
14-
* @version 2.2.71
13+
* @license MIT
14+
* @version 2.2.8
1515
*/
1616

1717
$.formUtils.addValidator({
@@ -22,7 +22,7 @@ $.formUtils.addValidator({
2222
// http://www.devmedia.com.br/validar-cpf-com-javascript/23916
2323

2424
// clean up the input (digits only) and set some support vars
25-
var cpf = string.replace(/\D/g,"");
25+
var cpf = string.replace(/\D/g,"");
2626
var sum1 = 0;
2727
var sum2 = 0;
2828
var remainder1 = 0;

form-validator/brazil.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/date.dev.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* - Birth date
1010
*
1111
* @website http://formvalidator.net/#location-validators
12-
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.71
12+
* @license MIT
13+
* @version 2.2.8
1414
*/
1515
(function($) {
1616

@@ -78,4 +78,4 @@
7878
errorMessageKey: 'badDate'
7979
});
8080

81-
})(jQuery);
81+
})(jQuery);

form-validator/date.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* jquery-form-validator %>
2+
* JQUERY-FORM-VALIDATOR
33
*
44
* @website by
55
* @license MIT
6-
* @version 2.2.71
6+
* @version 2.2.8
77
*/
88
!function(a){a.formUtils.addValidator({name:"time",validatorFunction:function(a){if(null===a.match(/^(\d{2}):(\d{2})$/))return!1;var b=parseInt(a.split(":")[0],10),c=parseInt(a.split(":")[1],10);return b>23||c>59?!1:!0},errorMessage:"",errorMessageKey:"badTime"}),a.formUtils.addValidator({name:"birthdate",validatorFunction:function(b,c,d){var e="yyyy-mm-dd";c.valAttr("format")?e=c.valAttr("format"):"undefined"!=typeof d.dateFormat&&(e=d.dateFormat);var f=a.formUtils.parseDate(b,e);if(!f)return!1;var g=new Date,h=g.getFullYear(),i=f[0],j=f[1],k=f[2];if(i===h){var l=g.getMonth()+1;if(j===l){var m=g.getDate();return m>=k}return l>j}return h>i&&i>h-124},errorMessage:"",errorMessageKey:"badDate"})}(jQuery);

form-validator/file.dev.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* - file extension
1010
*
1111
* @website http://formvalidator.net/#file-validators
12-
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.71
12+
* @license MIT
13+
* @version 2.2.8
1414
*/
1515
(function($, window) {
1616

@@ -408,4 +408,4 @@
408408
});
409409
});
410410

411-
})(jQuery, window);
411+
})(jQuery, window);

form-validator/file.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/html5.dev.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* - placeholders
1717
*
1818
* @website http://formvalidator.net/
19-
* @license Dual licensed under the MIT or GPL Version 2 licenses
20-
* @version 2.2.71
19+
* @license MIT
20+
* @version 2.2.8
2121
*/
2222
(function($, window) {
2323

@@ -160,4 +160,4 @@
160160
// Make this method available outside the module
161161
$.formUtils.setupValidationUsingHTML5Attr = setupValidationUsingHTML5Attr;
162162

163-
})(jQuery, window);
163+
})(jQuery, window);

form-validator/html5.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/jquery.form-validator.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* Created by Victor Jonsson <http://www.victorjonsson.se>
55
*
66
* @website http://formvalidator.net/
7-
* @license Dual licensed under the MIT or GPL Version 2 licenses
8-
* @version 2.2.71
7+
* @license MIT
8+
* @version 2.2.8
99
*/
1010
(function ($) {
1111

@@ -225,14 +225,17 @@
225225
$.fn.validate = function(cb, conf, lang) {
226226
var language = $.extend({}, $.formUtils.LANG, lang || {});
227227
this.each(function() {
228-
var $elem = $(this);
228+
var $elem = $(this),
229+
formDefaultConfig = $elem.closest('form').get(0).validationConfig || {};
230+
229231
$elem.one('validation', function(evt, isValid) {
230232
if( typeof cb == 'function' )
231233
cb(isValid, this, evt);
232234
});
235+
233236
$elem.validateInputOnBlur(
234237
language,
235-
$.extend({}, $elem.closest('form').get(0).validationConfig, conf || {}),
238+
$.extend({}, formDefaultConfig, conf || {}),
236239
true
237240
);
238241
});
@@ -285,14 +288,13 @@
285288

286289
language = $.extend({}, $.formUtils.LANG, language || {});
287290
_removeErrorStyle(this, conf);
288-
289291
var $elem = this,
290292
$form = $elem.closest("form"),
291293
validationRule = $elem.attr(conf.validationRuleAttribute),
292294
result = $.formUtils.validateInput(
293295
$elem,
294296
language,
295-
conf, //$.extend({}, conf, {errorMessagePosition: 'element'}),
297+
conf,
296298
$form,
297299
eventType
298300
);
@@ -733,7 +735,8 @@
733735
addValidClassOnAll: false, // whether or not to apply class="valid" even if the input wasn't validated
734736
decimalSeparator: '.',
735737
inputParentClassOnError: 'has-error', // twitter-bootstrap default class name
736-
inputParentClassOnSuccess: 'has-success' // twitter-bootstrap default class name
738+
inputParentClassOnSuccess: 'has-success', // twitter-bootstrap default class name
739+
validateHiddenInputs: false, // whether or not hidden inputs should be validated
737740
}
738741
},
739742

@@ -934,7 +937,7 @@
934937
// get value of this element's attribute "... if-checked"
935938
validateIfCheckedElementName = $elem.valAttr('if-checked');
936939

937-
if ($elem.attr('disabled') || !$elem.is(':visible')) {
940+
if ($elem.attr('disabled') || (!$elem.is(':visible') && !conf.validateHiddenInputs)) {
938941
result.shouldChangeDisplay = false;
939942
return result;
940943
}
@@ -1030,7 +1033,7 @@
10301033
}
10311034

10321035
// Run element validation callback
1033-
if (typeof conf.onElementValidate == 'function' && result !== null) {
1036+
if (typeof conf.onElementValidate == 'function' && validationErrorMsg !== null) {
10341037
conf.onElementValidate(result.isValid, $elem, $form, validationErrorMsg);
10351038
}
10361039

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

Lines changed: 3 additions & 3 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* This module makes it possible to configure form validation using javascript
77
*
88
* @website http://formvalidator.net/#location-validators
9-
* @license Dual licensed under the MIT or GPL Version 2 licenses
10-
* @version 2.2.71
9+
* @license MIT
10+
* @version 2.2.8
1111
*/
1212
(function($) {
1313

form-validator/jsconf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* jquery-form-validator %>
2+
* JQUERY-FORM-VALIDATOR
33
*
44
* @website by
55
* @license MIT
6-
* @version 2.2.71
6+
* @version 2.2.8
77
*/
88
!function(a){"use strict";a.setupValidation=function(b){var c=a(b.form||"form");a.each(b.validate||b.validation||{},function(b,d){var e;e="#"==b[0]?a(b):c.find("."==b[0]?b:'*[name="'+b+'"]'),e.attr("data-validation",d.validation),a.each(d,function(a,b){"validation"!=a&&b!==!1&&(b===!0&&(b="true"),e.valAttr(a,b))})}),a.validate(b)}}(jQuery);

form-validator/lang/de.dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* German language package
66
*
77
* @website http://formvalidator.net/
8-
* @license Dual licensed under the MIT or GPL Version 2 licenses
9-
* @version 2.2.71
8+
* @license MIT
9+
* @version 2.2.8
1010
*/
1111
(function($, window) {
1212

form-validator/lang/de.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/lang/es.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* @website http://formvalidator.net/
88
* @license Dual licensed under the MIT or GPL Version 2 licenses
9-
* @version 2.2.71
9+
* @version 2.2.8
1010
*/
1111
(function($, window) {
1212

0 commit comments

Comments
 (0)