- Création de docs/app/ pour la documentation de l'application - Création de docs/data/ pour les données utilisées par l'application - Déplacement de la documentation technique vers docs/app/ - Déplacement des données métier vers docs/data/ - Mise à jour de tous les liens et références dans les fichiers - Mise à jour des scripts (extract-technologies.js, analyze-business-metrics.js) - Mise à jour des fichiers JavaScript (custom.js, strategie-link.js) - Création de README.md dans docs/, docs/app/ et docs/data/ - Mise à jour du Readme.md principal avec les nouveaux chemins
113 lines
4.4 KiB
JavaScript
113 lines
4.4 KiB
JavaScript
// Script personnalisé pour ajouter le lien stratégie - injecté directement
|
|
(function() {
|
|
function initStrategyLinks() {
|
|
addStrategyLinkToFooter();
|
|
interceptStrategyLinks();
|
|
handleStrategyRoute();
|
|
}
|
|
|
|
function handleStrategyRoute() {
|
|
// Vérifier si on est sur la route stratégie au chargement initial
|
|
if (window.location.pathname === '/strategie' || window.location.pathname === '/strategie.html' || window.location.hash === '#strategie') {
|
|
createStrategyPage();
|
|
}
|
|
}
|
|
|
|
// Intercepter tous les clics sur les liens vers la stratégie
|
|
function interceptStrategyLinks() {
|
|
document.addEventListener('click', function(e) {
|
|
const link = e.target.closest('a');
|
|
if (link && (link.href.includes('/strategie') || link.getAttribute('href') === '/strategie' || link.id === 'strategie-link')) {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
createStrategyPage();
|
|
return false;
|
|
}
|
|
}, true);
|
|
}
|
|
|
|
function createStrategyPage() {
|
|
// Sauvegarder le contenu original
|
|
if (!window.originalBodyContent) {
|
|
window.originalBodyContent = document.body.innerHTML;
|
|
}
|
|
|
|
// Créer la page stratégie
|
|
document.body.innerHTML = `
|
|
<div style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 1200px; margin: 0 auto; padding: 20px; background: #f5f5f5; min-height: 100vh;">
|
|
<div style="background: white; padding: 40px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
|
<a href="#" id="back-to-radar" style="display: inline-block; margin-bottom: 20px; color: #2ecc71; text-decoration: none; font-weight: bold; cursor: pointer;">← Retour au Radar</a>
|
|
<h1 style="color: #1a4d3a; border-bottom: 3px solid #2ecc71; padding-bottom: 10px;">Stratégie d'Évolution Technique - Laplank</h1>
|
|
<p><strong>Date de mise à jour</strong> : 02/12/2025</p>
|
|
<p>La stratégie complète est disponible dans le dépôt Git :</p>
|
|
<p><a href="https://git.open.us.org/AJR/TechradarDev/-/blob/dev-biz/docs/data/strategie-evolution-technique.md" target="_blank" style="color: #2ecc71; font-weight: bold;">📋 Voir la stratégie sur GitLab</a></p>
|
|
</div>
|
|
</div>
|
|
`;
|
|
|
|
// Ajouter le gestionnaire de retour
|
|
const backLink = document.getElementById('back-to-radar');
|
|
if (backLink) {
|
|
backLink.addEventListener('click', function(e) {
|
|
e.preventDefault();
|
|
if (window.originalBodyContent) {
|
|
document.body.innerHTML = window.originalBodyContent;
|
|
// Réinitialiser les liens après restauration
|
|
setTimeout(initStrategyLinks, 100);
|
|
} else {
|
|
window.location.href = '/';
|
|
}
|
|
});
|
|
}
|
|
|
|
// Mettre à jour l'URL sans recharger la page
|
|
window.history.pushState({page: 'strategie'}, 'Stratégie', '/strategie');
|
|
}
|
|
|
|
function addStrategyLinkToFooter() {
|
|
const footer = document.querySelector('footer') || document.querySelector('.footer') || document.querySelector('[class*="footer"]');
|
|
|
|
if (footer) {
|
|
// Vérifier si le lien n'existe pas déjà
|
|
if (footer.querySelector('#strategie-link') || footer.querySelector('a[href*="strategie"]')) {
|
|
return;
|
|
}
|
|
|
|
const strategyLink = document.createElement('a');
|
|
strategyLink.id = 'strategie-link';
|
|
strategyLink.href = '#strategie';
|
|
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';
|
|
strategyLink.style.cursor = 'pointer';
|
|
|
|
// Intercepter le clic
|
|
strategyLink.addEventListener('click', function(e) {
|
|
e.preventDefault();
|
|
createStrategyPage();
|
|
});
|
|
|
|
footer.appendChild(strategyLink);
|
|
} else {
|
|
setTimeout(addStrategyLinkToFooter, 1000);
|
|
}
|
|
}
|
|
|
|
// Gérer le bouton retour du navigateur
|
|
window.addEventListener('popstate', function(event) {
|
|
if (window.originalBodyContent && !event.state) {
|
|
document.body.innerHTML = window.originalBodyContent;
|
|
setTimeout(initStrategyLinks, 100);
|
|
}
|
|
});
|
|
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', initStrategyLinks);
|
|
} else {
|
|
initStrategyLinks();
|
|
}
|
|
})();
|