modification du cookie de consentement

This commit is contained in:
Fred Tempez 2024-09-15 19:00:53 +02:00
parent 095e317f3b
commit 7da12be242
2 changed files with 5 additions and 4 deletions

View File

@ -216,12 +216,14 @@ core.start = function () {
// Variables des cookies // Variables des cookies
var getUrl = window.location; var getUrl = window.location;
var domain = "domain=" + getUrl.hostname + ";"; var domain = "domain=" + getUrl.hostname + ";";
var basePath = getUrl.pathname.substring(0, getUrl.pathname.lastIndexOf('/') + 1);
var path = "path=" + basePath + ";";
var e = new Date(); var e = new Date();
e.setFullYear(e.getFullYear() + 1); e.setFullYear(e.getFullYear() + 1);
var expires = "expires=" + e.toUTCString(); var expires = "expires=" + e.toUTCString() + ";";
// Stocke le cookie d'acceptation // Stocke le cookie d'acceptation
document.cookie = "ZWII_COOKIE_CONSENT=true;samesite=strict;" + domain + expires; document.cookie = "ZWII_COOKIE_CONSENT=true; samesite=lax; " + domain + path + expires;
}); });

View File

@ -265,7 +265,6 @@ $(document).ready(function () {
$('span#screenWeight').each(function(index){ $('span#screenWeight').each(function(index){
var weight = parseFloat($(this).text()); var weight = parseFloat($(this).text());
var fileType = $('span#screenType').eq(index).text(); var fileType = $('span#screenType').eq(index).text();
console.log(weight);
if ((fileType === "jpg" || fileType === "jpeg") && weight < 5000000) { if ((fileType === "jpg" || fileType === "jpeg") && weight < 5000000) {
$(this).css("color", "green"); $(this).css("color", "green");
} else { } else {