From bce9fda51d334a547ec5a48f0b7699ed3b5d7944 Mon Sep 17 00:00:00 2001 From: polo Date: Wed, 29 Oct 2025 21:42:39 +0100 Subject: =?UTF-8?q?classe=20Fetcher,=20gestion=20r=C3=A9seaux=20sociaux=20?= =?UTF-8?q?pr=C3=A9sents/absents,=20partie=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/main.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'public/js/main.js') diff --git a/public/js/main.js b/public/js/main.js index 59a9331..3cc144a 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -199,6 +199,27 @@ function findParentByTagName(element, tag_name){ return null; } +function checkSocialNetwork(id){ + const checkbox = document.getElementById(id).querySelector('input[type="checkbox"]'); + + new Fetcher({ + endpoint: 'index.php?head_foot_social_check=' + id, + method: 'POST', + onSuccess: (data) => { + console.log(data); + + checkbox.checked = data.checked; + + /*const color = checkbox.checked ? "#ff1d04" : "grey"; + clicked_menu_entry.querySelector("button").style.color = color;*/ + }, + onFailure: (data) => { + console.log(data); + } + }) + .send({checked: checkbox.checked}); +} + /* -- fonctions spécifiques à la gestion des dates -- */ -- cgit v1.2.3