Skip to content

Commit

Permalink
More descriptive view configuration (#326)
Browse files Browse the repository at this point in the history
Changelog updates, more descriptive view configuration
  • Loading branch information
Anton Komarev authored May 17, 2018
1 parent 61be202 commit 3711e2e
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 40 deletions.
97 changes: 71 additions & 26 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,96 @@
# Changelog

All notable changes to `laravel-jsvalidation` will be documented in this file.

## [2.2.3] - 2018-05-17

### Added

- (#325) Added Bootstrap 4 support

## [2.2.2] - 2018-04-18

### Fixed

- (#316, #317) Array rule validation

## [2.2.1] - 2018-02-27

### Fixed

- (#307) Fix images, mimetypes & files rules in Laravel 5.6

## [2.2.0] - 2018-02-09

### Added

- (#302) Laravel 5.6 support

## [2.1.0] - 2017-08-31

### Added

- (#277) Laravel 5.5 support

## [2.0.0] - 2017-07-10

### Added

- Laravel 5.4 support (#224)
- (#224) Laravel 5.4 support

### Changed

- Typo in `resources/assets/js/helpers.js` method `gess` fixed. Method renamed to `guess` (#250)
- (#250) Typo in `resources/assets/js/helpers.js` method `gess` fixed. Method renamed to `guess`

### Fixed

- JPEG mime-type check in `image` rule (#239)
- (#239) JPEG mime-type check in `image` rule

### Removed

- Laravel <= 5.3 support. Will be maintained in 1.x releases (#258)
- (#258) Laravel <= 5.3 support. Will be maintained in 1.x releases
- PHP < 5.6.4 support (Laravel 5.4 minimum requirement)

## [1.5.0] - 2017-01-22

Features:
- Javascript validation for [File](https://laravel.com/docs/5.3/validation#rule-file) rule
- Javascript validation for [Mimetypes](https://laravel.com/docs/5.3/validation#rule-mimetypes) rule
- Javascript validation for [Nullable](https://laravel.com/docs/5.3/validation#rule-nullable) rule
- Javascript validation for [Filled](https://laravel.com/docs/5.3/validation#rule-filled) rule
- Javascript validation for [Dimensions](https://laravel.com/docs/5.3/validation#rule-dimensions) rule
- Javascript validation for [InArray](https://laravel.com/docs/5.3/validation#rule-inarray) rule
- Javascript validation for [Distinct](https://laravel.com/docs/5.3/validation#rule-distinct) rule

Issues resolved:
- Fix issue with HttpResponseException (#130)
- Fix Undefined index: _jsvalidation_validate_all (#201)
### Added

- Javascript validation for [File](https://laravel.com/docs/5.3/validation#rule-file) rule
- Javascript validation for [Mimetypes](https://laravel.com/docs/5.3/validation#rule-mimetypes) rule
- Javascript validation for [Nullable](https://laravel.com/docs/5.3/validation#rule-nullable) rule
- Javascript validation for [Filled](https://laravel.com/docs/5.3/validation#rule-filled) rule
- Javascript validation for [Dimensions](https://laravel.com/docs/5.3/validation#rule-dimensions) rule
- Javascript validation for [InArray](https://laravel.com/docs/5.3/validation#rule-inarray) rule
- Javascript validation for [Distinct](https://laravel.com/docs/5.3/validation#rule-distinct) rule

### Fixed

- (#130) Fix issue with HttpResponseException
- (#201) Fix Undefined index: _jsvalidation_validate_all

## [1.4.3] - 2017-01-07

Features:
- Add support for the "bail" keyword (#179)
- Add support to validate array fields using non array rules (#180, #158)
### Added

Issues resolved:
- Fix remote custom validation (#175)
- File Size doesn't work with JavaScript Validator (#156)
- (#179) Add support for the "bail" keyword
- (#180, #158) Add support to validate array fields using non array rules

### Fixed

- (#175) Fix remote custom validation
- (#156) File Size doesn't work with JavaScript Validator

## [1.4.2] - 2016-12-28

Bugfixes:
- Fix javascript build files
### Fixed

- Fix javascript build files

## [1.4.1] - 2016-12-28

Bugfixes:
- Fix javascript build files
### Fixed

- Fix javascript build files

## [1.4.0] - 2016-12-28

Expand Down Expand Up @@ -204,6 +244,11 @@ Features:
- Uses Laravel Localization to translate messages
- Can be configured in controllers or views.

[2.2.3]: https://github.com/proengsoft/laravel-jsvalidation/compare/2.2.2...2.2.3
[2.2.2]: https://github.com/proengsoft/laravel-jsvalidation/compare/2.2.1...2.2.2
[2.2.1]: https://github.com/proengsoft/laravel-jsvalidation/compare/2.2.0...2.2.1
[2.2.0]: https://github.com/proengsoft/laravel-jsvalidation/compare/v2.1.0...2.2.0
[2.1.0]: https://github.com/proengsoft/laravel-jsvalidation/compare/v2.0.0...v2.1.0
[2.0.0]: https://github.com/proengsoft/laravel-jsvalidation/compare/v1.5.0...v2.0.0
[1.5.0]: https://github.com/proengsoft/laravel-jsvalidation/compare/v1.4.3...v1.5.0
[1.4.3]: https://github.com/proengsoft/laravel-jsvalidation/compare/v1.4.2...v1.4.3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can validate forms automatically referencing it to your defined validations.
| `5.5` | `2.x (>2.1.0)` |
| `5.4` | `2.x` |
| `5.3` | `1.x` |
| `5.2` | `1.x` |
| `5.2` | `1.x` |
| `5.1` | `1.x` |
| `5.0` | `1.x` |

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"illuminate/view": "5.4.*|5.5.*|5.6.*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.3",
"mockery/mockery": "~0.9.4",
"phpunit/phpunit": "~5.7"
"friendsofphp/php-cs-fixer": "^2.10",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "~5.7|^7.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 2 additions & 0 deletions config/jsvalidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/*
* Default view used to render Javascript validation code
*
* Supported: 'jsvalidation::bootstrap', 'jsvalidation::bootstrap4'
*/
'view' => 'jsvalidation::bootstrap',

Expand Down
10 changes: 5 additions & 5 deletions resources/views/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script>
jQuery(document).ready(function(){

$("<?php echo $validator['selector']; ?>").validate({
$("<?= $validator['selector']; ?>").validate({
errorElement: 'span',
errorClass: 'help-block error-help-block',

errorPlacement: function(error, element) {
if (element.parent('.input-group').length ||
element.prop('type') === 'checkbox' || element.prop('type') === 'radio') {
error.insertAfter(element.parent());
// else just place the validation message immediatly after the input
// else just place the validation message immediately after the input
} else {
error.insertAfter(element);
}
Expand All @@ -20,7 +20,7 @@

<?php if (isset($validator['ignore']) && is_string($validator['ignore'])): ?>

ignore: "<?php echo $validator['ignore']; ?>",
ignore: "<?= $validator['ignore']; ?>",
<?php endif; ?>

/*
Expand All @@ -42,13 +42,13 @@

$('html, body').animate({
scrollTop: $(validator.errorList[0].element).offset().top
}, <?php echo Config::get('jsvalidation.duration_animate') ?>);
}, <?= Config::get('jsvalidation.duration_animate') ?>);
$(validator.errorList[0].element).focus();

},
<?php endif; ?>

rules: <?php echo json_encode($validator['rules']); ?>
rules: <?= json_encode($validator['rules']); ?>
})
})
</script>
10 changes: 5 additions & 5 deletions resources/views/bootstrap4.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script>
jQuery(document).ready(function(){

$("<?php echo $validator['selector']; ?>").validate({
$("<?= $validator['selector']; ?>").validate({
errorElement: 'span',
errorClass: 'invalid-feedback',

errorPlacement: function(error, element) {
if (element.parent('.input-group').length ||
element.prop('type') === 'checkbox' || element.prop('type') === 'radio') {
error.insertAfter(element.parent());
// else just place the validation message immediatly after the input
// else just place the validation message immediately after the input
} else {
error.insertAfter(element);
}
Expand All @@ -20,7 +20,7 @@

<?php if (isset($validator['ignore']) && is_string($validator['ignore'])): ?>

ignore: "<?php echo $validator['ignore']; ?>",
ignore: "<?= $validator['ignore']; ?>",
<?php endif; ?>

/*
Expand All @@ -42,13 +42,13 @@

$('html, body').animate({
scrollTop: $(validator.errorList[0].element).offset().top
}, <?php echo Config::get('jsvalidation.duration_animate') ?>);
}, <?= Config::get('jsvalidation.duration_animate') ?>);
$(validator.errorList[0].element).focus();

},
<?php endif; ?>

rules: <?php echo json_encode($validator['rules']); ?>
rules: <?= json_encode($validator['rules']); ?>
})
})
</script>

0 comments on commit 3711e2e

Please sign in to comment.