set permanent cookie
parent
74ae8a67b5
commit
f41c897085
|
@ -295,23 +295,6 @@
|
||||||
@include('template.'.config('settings.template').'.content.includes.footer')
|
@include('template.'.config('settings.template').'.content.includes.footer')
|
||||||
@include('template.'.config('settings.template').'.content.includes.scripts')
|
@include('template.'.config('settings.template').'.content.includes.scripts')
|
||||||
<script src="https://cdn.jsdelivr.net/npm/js-cookie@3.0.1/dist/js.cookie.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/js-cookie@3.0.1/dist/js.cookie.min.js"></script>
|
||||||
<script>
|
<script src="{{storage('js/cookies-consent.js')}}"></script>
|
||||||
$(window).on('load', function(){
|
|
||||||
if(Cookies.get('cookies-consent') == undefined){
|
|
||||||
$("#cookie-settings").animate({bottom: '0%'}, 1000);
|
|
||||||
$('.btn-cookies-consent').click(function(event){
|
|
||||||
event.preventDefault();
|
|
||||||
let cookiesConsent = $(this).attr('data-cookies');
|
|
||||||
if(cookiesConsent != undefined) Cookies.set('cookies-consent', cookiesConsent);
|
|
||||||
else{
|
|
||||||
if($('#functional-cookies').prop('checked') && $('#analytics-cookies').prop('checked') && $('#profile-cookies').prop('checked')) Cookies.set('cookies-consent', 1);
|
|
||||||
else Cookies.set('cookies-consent', 0);
|
|
||||||
}
|
|
||||||
$('#modal-cookie-settings').modal('hide');
|
|
||||||
$("#cookie-settings").animate({bottom: '-100%'}, 1000);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
$(window).on('load', function () {
|
||||||
|
if (Cookies.get('cookies-consent') == undefined) {
|
||||||
|
$("#cookie-settings").animate({ bottom: '0%' }, 1000);
|
||||||
|
$('.btn-cookies-consent').click(function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
let cookiesConsent = $(this).attr('data-cookies');
|
||||||
|
if (cookiesConsent != undefined) Cookies.set('cookies-consent', cookiesConsent, { expires: 365 });
|
||||||
|
else {
|
||||||
|
if ($('#functional-cookies').prop('checked') && $('#analytics-cookies').prop('checked') && $('#profile-cookies').prop('checked')) Cookies.set('cookies-consent', 1, { expires: 365 });
|
||||||
|
else Cookies.set('cookies-consent', 0, { expires: 365 });
|
||||||
|
}
|
||||||
|
$('#modal-cookie-settings').modal('hide');
|
||||||
|
$("#cookie-settings").animate({ bottom: '-100%' }, 1000);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
Loading…
Reference in New Issue