Skip to content

Commit

Permalink
Fixed issue victorjonsson#148
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjonsson committed Jul 23, 2014
1 parent 6c739cc commit 3e0026a
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 21 deletions.
2 changes: 1 addition & 1 deletion form-validator/date.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @website http://formvalidator.net/#location-validators
* @license Dual licensed under the MIT or GPL Version 2 licenses
* @version 2.1.67
* @version 2.1.71
*/
(function($) {

Expand Down
18 changes: 16 additions & 2 deletions form-validator/file.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @website http://formvalidator.net/
* @license Dual licensed under the MIT or GPL Version 2 licenses
* @version 2.1.67
* @version 2.1.71
*/
(function($, window) {

Expand All @@ -27,6 +27,15 @@
else if( $.inArray('jpeg', allowedTypes) > -1 && $.inArray('jpg', allowedTypes) == -1)
allowedTypes.push('jpg');
return allowedTypes;
},

/**
* @param {String} msg
*/
_log = function(msg) {
if( window.console && window.console.log ) {
window.console.log(msg);
}
};

/*
Expand All @@ -53,9 +62,14 @@
});
return valid;
});
return valid;

if( !valid ) {
_log('Trying to upload a file with mime type '+mime+' which is not allowed');
}
return valid;

} else {
_log('FileReader not supported by browser, will check file extension');
return $.formUtils.validators.validate_extension.validatorFunction(str, $input);
}
},
Expand Down
2 changes: 1 addition & 1 deletion form-validator/file.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions form-validator/form-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@
<label class="control-label">File validation</label>
<input type="file" name="some-file1" class="form-control"
data-validation="size mime required"
data-validation-size-error-msg="The file cant be larger than 100kb"
data-validation-error-msg="You must upload an image file"
data-validation-size-error-msg="The file cant be larger than 400kb"
data-validation-error-msg="You must upload an image file (max 400 kb)"
data-validation-allowing="jpg, png, ico"
data-validation-max-size="100kb" />
data-validation-max-size="400kb" />
</div>
<div class="form-group">
<label class="control-label">
Expand Down
4 changes: 1 addition & 3 deletions form-validator/html5.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @website http://formvalidator.net/
* @license Dual licensed under the MIT or GPL Version 2 licenses
* @version 2.1.67
* @version 2.1.71
*/
(function($, window) {

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

console.log($input.html());
if( !SUPPORTS_DATALIST && $input.attr('list') ) {
console.log($input.attr('list'));
var suggestions = [];
$('#'+$input.attr('list')+' option').each(function() {
var $opt = $(this);
Expand Down
2 changes: 1 addition & 1 deletion form-validator/html5.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions form-validator/jquery.form-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @website http://formvalidator.net/
* @license Dual licensed under the MIT or GPL Version 2 licenses
* @version 2.1.67
* @version 2.1.71
*/
(function($) {

Expand Down Expand Up @@ -1396,7 +1396,7 @@
if (!hasTopDomain) {
return false;
} else if (dot < 2 || dot > 57) {
return false;
return $.inArray(val, ['i.net', 'q.com', 'q.net', 'x.com', 'x.org', 'z.com', 'w.org']) > -1;
} else {
var firstChar = domain.substring(0, 1),
lastChar = domain.substring(domain.length - 1, domain.length);
Expand All @@ -1412,7 +1412,6 @@
}
}

// It's valid, lets update input with trimmed value perhaps??
if(typeof $input !== 'undefined') {
$input.val(val);
}
Expand Down
6 changes: 3 additions & 3 deletions form-validator/jquery.form-validator.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion form-validator/location.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @website http://formvalidator.net/#location-validators
* @license Dual licensed under the MIT or GPL Version 2 licenses
* @version 2.1.67
* @version 2.1.71
*/
(function($) {

Expand Down
2 changes: 2 additions & 0 deletions form-validator/qunit.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@
{val:'domain.xxx', isValid:true},
{val:'domain.com', isValid:true},
{val:'www.domain.com', isValid:true},
{val:'q.com', isValid:true},
{val:'v.com', isValid:false},
{val:'amazone.website.tippit.de', isValid:true},
{val:'amazone.website.co.uk', isValid:true},
{val:'http://domain.se', isValid:false},
Expand Down
2 changes: 1 addition & 1 deletion form-validator/security.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* - cvv
*
* @website http://formvalidator.net/#security-validators
* @version 2.1.67
* @version 2.1.71
*/
(function($, window) {

Expand Down
2 changes: 1 addition & 1 deletion form-validator/sweden.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @website http://formvalidator.net/#swedish-validators
* @license Dual licensed under the MIT or GPL Version 2 licenses
* @version 2.1.67
* @version 2.1.71
*/
(function($, window) {

Expand Down
2 changes: 1 addition & 1 deletion form-validator/uk.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* @website http://formvalidator.net/#uk-validators
* @license Dual licensed under the MIT or GPL Version 2 licenses
* @version 2.1.67
* @version 2.1.71
*/
$.formUtils.addValidator({
name : 'ukvatnumber',
Expand Down

0 comments on commit 3e0026a

Please sign in to comment.