diff --git a/public/strategie-script.js b/public/strategie-script.js index af0f340..736f6d6 100644 --- a/public/strategie-script.js +++ b/public/strategie-script.js @@ -1,32 +1,10 @@ // Script pour la gestion des pages de stratégie (function() { - // VÉRIFICATION IMMÉDIATE DE /team AVANT TOUT (s'exécute en premier) - (function checkTeamRouteFirst() { - if (typeof window === 'undefined') return; - function normalizePath(pathname) { - if (!pathname) return '/'; - const cleaned = pathname.replace(/\/+$/, ''); - return cleaned === '' ? '/' : cleaned; - } - const path = normalizePath(window.location.pathname); - if (path === '/team' || path === '/team/') { - console.log('🔍 Route /team détectée IMMÉDIATEMENT, redirection vers /team.html...'); - // Rediriger immédiatement vers /team.html - if (document.body) { - document.body.innerHTML = '
'; - window.history.pushState({page: 'team'}, 'Équipe & Technologies', '/team'); - } else { - const checkBody = setInterval(() => { - if (document.body) { - clearInterval(checkBody); - document.body.innerHTML = '
'; - window.history.pushState({page: 'team'}, 'Équipe & Technologies', '/team'); - } - }, 10); - setTimeout(() => clearInterval(checkBody), 5000); - } - } - })(); + // PROTECTION : Ne pas s'exécuter sur les pages Next.js (qui ont déjà leur propre gestion) + if (document.querySelector('[data-reactroot]') || window.__NEXT_DATA__) { + console.log('🚫 Script stratégie désactivé sur page Next.js'); + return; + } // Protection contre Fast Refresh : ignorer les tentatives de hot-reload // Intercepter et ignorer les requêtes webpack hot-update pour éviter les rechargements en boucle @@ -832,13 +810,13 @@ Interface de pilotage pour les responsables sécurité des PME. function handleRoute() { const path = normalizePath(window.location.pathname); const hash = window.location.hash; - - // Détection simple + + // Détection simple - SANS /team car Next.js gère cette route if (hash === '#strategie' || path === '/strategie') showPage('strategie'); else if (hash === '#business' || path === '/business') showPage('business'); else if (hash === '#dataviz' || path === '/dataviz') showPage('dataviz'); else if (hash === '#dataviz-details' || path === '/dataviz-details') showPage('dataviz-details'); - else if (path === '/team' || path === '/team/') showTeamPage(); + // /team est maintenant géré par Next.js, pas par ce script } // Vérifier la route /team IMMÉDIATEMENT au chargement du script (avant Next.js) @@ -855,26 +833,10 @@ Interface de pilotage pour les responsables sécurité des PME. } })(); - function showTeamPage() { - // Sauvegarder le contenu original - if (!window.originalBodyContent) { - window.originalBodyContent = document.body.innerHTML; - } - - // Remplacer complètement le body par l'iframe team.html - document.body.innerHTML = ` -
-