- Les fichiers dans public/ sont servis à la racine, pas sous /business/ - Correction du lien pour pointer vers /strategie.html
56 lines
1.9 KiB
JavaScript
56 lines
1.9 KiB
JavaScript
// Script pour ajouter un lien vers la stratégie dans le footer et le header
|
|
(function() {
|
|
// Attendre que le DOM soit chargé
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', initStrategyLinks);
|
|
} else {
|
|
initStrategyLinks();
|
|
}
|
|
|
|
function initStrategyLinks() {
|
|
addStrategyLinkToFooter();
|
|
addStrategyLinkToHeader();
|
|
}
|
|
|
|
function addStrategyLinkToFooter() {
|
|
// Chercher le footer
|
|
const footer = document.querySelector('footer') || document.querySelector('.footer') || document.querySelector('[class*="footer"]');
|
|
|
|
if (footer) {
|
|
// Créer le lien vers la stratégie
|
|
const strategyLink = document.createElement('a');
|
|
strategyLink.href = '/strategie.html';
|
|
strategyLink.textContent = '📋 Voir la Stratégie';
|
|
strategyLink.style.marginLeft = '10px';
|
|
strategyLink.style.color = '#2ecc71';
|
|
strategyLink.style.textDecoration = 'none';
|
|
strategyLink.style.fontWeight = 'bold';
|
|
strategyLink.style.display = 'inline-block';
|
|
|
|
// Ajouter le lien au footer
|
|
footer.appendChild(strategyLink);
|
|
} else {
|
|
// Si le footer n'est pas trouvé, réessayer
|
|
setTimeout(addStrategyLinkToFooter, 1000);
|
|
}
|
|
}
|
|
|
|
function addStrategyLinkToHeader() {
|
|
// Chercher le header ou la navigation
|
|
const header = document.querySelector('header') || document.querySelector('nav') || document.querySelector('[class*="header"]') || document.querySelector('[class*="nav"]');
|
|
|
|
if (header) {
|
|
const strategyLink = document.createElement('a');
|
|
strategyLink.href = '/strategie.html';
|
|
strategyLink.textContent = 'Stratégie';
|
|
strategyLink.style.marginLeft = '15px';
|
|
strategyLink.style.color = '#2ecc71';
|
|
strategyLink.style.textDecoration = 'none';
|
|
strategyLink.style.fontWeight = 'bold';
|
|
|
|
header.appendChild(strategyLink);
|
|
}
|
|
}
|
|
})();
|
|
|