From a1a5849dd4d84b440ec44849d77a46ccf0af6ee6 Mon Sep 17 00:00:00 2001 From: syoul Date: Tue, 9 Dec 2025 12:10:59 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20correction=20popstate=20pour=20/team=20e?= =?UTF-8?q?t=20am=C3=A9lioration=20regex=20d=C3=A9tection=20liens?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Gestion du popstate pour la route /team - Amélioration du script Python avec regex pour détecter tous les formats de liens team - La fonction showTeamPage() est maintenant appelée correctement lors de la navigation --- Dockerfile.business | 5 +++-- public/strategie-script.js | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile.business b/Dockerfile.business index 4bc1e24..bcb8d55 100644 --- a/Dockerfile.business +++ b/Dockerfile.business @@ -253,8 +253,9 @@ try: line = lines[i] # Détecter le début d'un lien Équipe (inclut /team, /team/, /team.html) - # Vérifier aussi si c'est dans un commentaire ou sur plusieurs lignes - if ('href="/team' in line or "href='/team" in line or 'href={"/team' in line or "href={'/team" in line) and not skip_team_link: + # Utiliser une regex pour détecter tous les formats possibles + team_link_match = re.search(r'href=["\']/?team(/|\.html)?["\']|href=\{["\']/?team', line) + if team_link_match and not skip_team_link: skip_team_link = True team_links_removed += 1 # Ignorer cette ligne et les lignes suivantes jusqu'à diff --git a/public/strategie-script.js b/public/strategie-script.js index e9a22b5..d306242 100644 --- a/public/strategie-script.js +++ b/public/strategie-script.js @@ -917,7 +917,11 @@ Interface de pilotage pour les responsables sécurité des PME. window.addEventListener('popstate', function(event) { if (event.state && event.state.page) { - showPage(event.state.page); + if (event.state.page === 'team') { + showTeamPage(); + } else { + showPage(event.state.page); + } } else if (window.originalBodyContent) { document.body.innerHTML = window.originalBodyContent; // Réinitialiser le flag pour permettre la réinitialisation