From 105b825923ce03fc43eacb0575212fe52336ce34 Mon Sep 17 00:00:00 2001 From: Debulois Date: Mon, 9 May 2022 20:03:42 +0200 Subject: Mis en place du RGPD --- Static/Js/rgpd.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Static/Js/rgpd.js (limited to 'Static/Js/rgpd.js') diff --git a/Static/Js/rgpd.js b/Static/Js/rgpd.js new file mode 100644 index 0000000..a134717 --- /dev/null +++ b/Static/Js/rgpd.js @@ -0,0 +1,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() +}); \ No newline at end of file -- cgit v1.2.3