summaryrefslogtreecommitdiff
path: root/Static/Js/rgpd.js
blob: a134717af54ab0ad4379ea3a47669757e0bc21d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

// ############################################################################
// #                                                                          #
// # Description: JS uniquement utile dans l'index                            #
// #                                                                          #
// ############################################################################

// Bind du boutton Accepter et Supprimer pour les cookies de google analytics
// L'option secure oblige le cookie à être transmis uniquement en https
// Le max-age corrspond ici à un an, 60 sec x 60 min x 24H x 364 jours
document.getElementById("rgpdAccept").addEventListener("click", () => {
    document.cookie = "RGPD_ACCEPT=1; max-age=" + 60*60*24*364 + "; path=/; Secure;";
    window.location.reload()
});

document.getElementById("rgpdDecline").addEventListener("click", () => {
    document.cookie = "RGPD_ACCEPT=0; max-age=" + 60*60*24*364 + "; path=/; Secure;";
    window.location.reload()
});