Skip to content

Commit 3e0026a

Browse files
committed
Fixed issue victorjonsson#148
1 parent 6c739cc commit 3e0026a

13 files changed

+34
-21
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.1.67
13+
* @version 2.1.71
1414
*/
1515
(function($) {
1616

form-validator/file.dev.js

Lines changed: 16 additions & 2 deletions
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.1.67
13+
* @version 2.1.71
1414
*/
1515
(function($, window) {
1616

@@ -27,6 +27,15 @@
2727
else if( $.inArray('jpeg', allowedTypes) > -1 && $.inArray('jpg', allowedTypes) == -1)
2828
allowedTypes.push('jpg');
2929
return allowedTypes;
30+
},
31+
32+
/**
33+
* @param {String} msg
34+
*/
35+
_log = function(msg) {
36+
if( window.console && window.console.log ) {
37+
window.console.log(msg);
38+
}
3039
};
3140

3241
/*
@@ -53,9 +62,14 @@
5362
});
5463
return valid;
5564
});
56-
return valid;
5765

66+
if( !valid ) {
67+
_log('Trying to upload a file with mime type '+mime+' which is not allowed');
68+
}
69+
return valid;
70+
5871
} else {
72+
_log('FileReader not supported by browser, will check file extension');
5973
return $.formUtils.validators.validate_extension.validatorFunction(str, $input);
6074
}
6175
},

form-validator/file.js

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

form-validator/form-test.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@
172172
<label class="control-label">File validation</label>
173173
<input type="file" name="some-file1" class="form-control"
174174
data-validation="size mime required"
175-
data-validation-size-error-msg="The file cant be larger than 100kb"
176-
data-validation-error-msg="You must upload an image file"
175+
data-validation-size-error-msg="The file cant be larger than 400kb"
176+
data-validation-error-msg="You must upload an image file (max 400 kb)"
177177
data-validation-allowing="jpg, png, ico"
178-
data-validation-max-size="100kb" />
178+
data-validation-max-size="400kb" />
179179
</div>
180180
<div class="form-group">
181181
<label class="control-label">

form-validator/html5.dev.js

Lines changed: 1 addition & 3 deletions
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.1.67
20+
* @version 2.1.71
2121
*/
2222
(function($, window) {
2323

@@ -92,9 +92,7 @@
9292
attrs['data-validation-length'] = 'max'+$input.attr('maxlength');
9393
}
9494

95-
console.log($input.html());
9695
if( !SUPPORTS_DATALIST && $input.attr('list') ) {
97-
console.log($input.attr('list'));
9896
var suggestions = [];
9997
$('#'+$input.attr('list')+' option').each(function() {
10098
var $opt = $(this);

form-validator/html5.js

Lines changed: 1 addition & 1 deletion
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: 2 additions & 3 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.1.67
8+
* @version 2.1.71
99
*/
1010
(function($) {
1111

@@ -1396,7 +1396,7 @@
13961396
if (!hasTopDomain) {
13971397
return false;
13981398
} else if (dot < 2 || dot > 57) {
1399-
return false;
1399+
return $.inArray(val, ['i.net', 'q.com', 'q.net', 'x.com', 'x.org', 'z.com', 'w.org']) > -1;
14001400
} else {
14011401
var firstChar = domain.substring(0, 1),
14021402
lastChar = domain.substring(domain.length - 1, domain.length);
@@ -1412,7 +1412,6 @@
14121412
}
14131413
}
14141414

1415-
// It's valid, lets update input with trimmed value perhaps??
14161415
if(typeof $input !== 'undefined') {
14171416
$input.val(val);
14181417
}

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/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.1.67
13+
* @version 2.1.71
1414
*/
1515
(function($) {
1616

form-validator/qunit.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@
163163
{val:'domain.xxx', isValid:true},
164164
{val:'domain.com', isValid:true},
165165
{val:'www.domain.com', isValid:true},
166+
{val:'q.com', isValid:true},
167+
{val:'v.com', isValid:false},
166168
{val:'amazone.website.tippit.de', isValid:true},
167169
{val:'amazone.website.co.uk', isValid:true},
168170
{val:'http://domain.se', isValid:false},

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.1.67
16+
* @version 2.1.71
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.1.67
16+
* @version 2.1.71
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.1.67
12+
* @version 2.1.71
1313
*/
1414
$.formUtils.addValidator({
1515
name : 'ukvatnumber',

0 commit comments

Comments
 (0)