feat: exposer le radar business à la racine

This commit is contained in:
syoul
2025-12-02 21:06:59 +01:00
parent 5c29d2b5a4
commit 364adffd96
6 changed files with 26 additions and 20 deletions

View File

@@ -711,15 +711,21 @@ Interface de pilotage pour les responsables sécurité des PME.
handleRoute();
}
function normalizePath(pathname) {
if (!pathname) return '/';
const cleaned = pathname.replace(/\/+$/, '');
return cleaned === '' ? '/' : cleaned;
}
function handleRoute() {
const path = window.location.pathname;
const path = normalizePath(window.location.pathname);
const hash = window.location.hash;
// Détection simple
if (hash === '#strategie' || path.includes('/strategie')) showPage('strategie');
else if (hash === '#business' || path.includes('/business-strat')) showPage('business');
else if (hash === '#dataviz' || path.includes('/dataviz')) showPage('dataviz');
else if (hash === '#dataviz-details' || path.includes('/dataviz-details')) showPage('dataviz-details');
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');
}
function showPage(pageId) {
@@ -757,10 +763,10 @@ Interface de pilotage pour les responsables sécurité des PME.
e.preventDefault();
if (window.originalBodyContent) {
document.body.innerHTML = window.originalBodyContent;
window.history.pushState(null, null, window.location.pathname.replace(/\/business\/.*$/, '/business/'));
window.history.pushState(null, null, '/');
setTimeout(initStrategyLinks, 100);
} else {
window.location.href = '/business/';
window.location.href = '/';
}
});
@@ -772,7 +778,7 @@ Interface de pilotage pour les responsables sécurité des PME.
});
});
window.history.pushState({page: pageId}, pageTitles[pageId], `/business/${pageId}`);
window.history.pushState({page: pageId}, pageTitles[pageId], `/${pageId}`);
}
function styleContent() {