Fixed CSP
This commit is contained in:
parent
48a2303e1c
commit
37c2e53be9
3 changed files with 28 additions and 5 deletions
|
|
@ -80,9 +80,9 @@ class SecureHeaders
|
|||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
"script-src 'self' {$jsDev} " . \implode(' ', [
|
||||
'https: blob:',
|
||||
'https://unpkg.com',
|
||||
'https://www.googletagmanager.com',
|
||||
'https://cdnjs.cloudflare.com',
|
||||
"$scheme://www.google-analytics.com",
|
||||
]) . ';'
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@
|
|||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"
|
||||
<script nonce="{{ $nonce }}" src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"
|
||||
integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM="
|
||||
crossorigin=""></script>
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<form id="recipes-filters" class="row position-relative d-md-flex justify-content-between recipes-search" action="{{ route('recipes.index', request()->query()) }}" name="recipes-search" enctype="multipart/form-data" method="get">
|
||||
<div class="d-md-flex align-items-center col-md-4">
|
||||
<label for="inputPassword6" class="col-form-label me-3">{{ __('Difficulté') }}</label>
|
||||
<select id="difficulty" class="form-select" name="filtered_infos[]" aria-label="Default select example" onchange="this.form.submit()">
|
||||
<select id="difficulty" class="form-select" name="filtered_infos[]" aria-label="Default select example">
|
||||
@if (isset($filters_activated))
|
||||
<option value="-1">{{ __('Tous') }}</option>
|
||||
@foreach(App\Enums\DifficultyEnum::toArray() as $key => $difficulty)
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
<div class="d-md-flex align-items-center col-md-4">
|
||||
<label for="inputPassword6" class="col-form-label me-3">{{ __('Rapidité') }}</label>
|
||||
<select id="speed" class="form-select" name="filtered_infos[]" aria-label="Default select example" onchange="this.form.submit()">
|
||||
<select id="speed" class="form-select" name="filtered_infos[]" aria-label="Default select example">
|
||||
@if (isset($filters_activated))
|
||||
<option value="-1">{{ __('Tous') }}</option>
|
||||
@foreach(App\Enums\PreparationTimeEnum::toArray() as $key => $preparation)
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
<div class="d-md-flex align-items-center col-md-4">
|
||||
<label for="inputPassword6" class="col-form-label me-3">{{ __('Mode de cuisson') }}</label>
|
||||
<select id="cooking" class="form-select" name="filtered_infos[]" aria-label="Default select example" onchange="this.form.submit()">
|
||||
<select id="cooking" class="form-select" name="filtered_infos[]" aria-label="Default select example">
|
||||
@if (isset($filters_activated))
|
||||
<option value="-1">{{ __('Tous') }}</option>
|
||||
@foreach(App\Enums\CookingModeEnum::toArray() as $key => $cookingMode)
|
||||
|
|
@ -112,3 +112,26 @@
|
|||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
// Submit button clone.
|
||||
const form = document.getElementById('recipes-filters');
|
||||
const selectDifficulty = document.getElementById('difficulty');
|
||||
const selectSpeed = document.getElementById('speed');
|
||||
const selectCooking = document.getElementById('cooking');
|
||||
selectDifficulty.addEventListener('change', (event) => {
|
||||
form.submit();
|
||||
});
|
||||
selectSpeed.addEventListener('change', (event) => {
|
||||
form.submit();
|
||||
});
|
||||
selectCooking.addEventListener('change', (event) => {
|
||||
form.submit();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue