summaryrefslogtreecommitdiff
path: root/Static/Js/rgpd.js
diff options
context:
space:
mode:
Diffstat (limited to 'Static/Js/rgpd.js')
-rw-r--r--Static/Js/rgpd.js19
1 files changed, 19 insertions, 0 deletions
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