document.addEventListener('DOMContentLoaded', function() { // Toggle code comments document.querySelectorAll('.comment-toggle').forEach(toggle => { toggle.addEventListener('click', function() { const comment = this.parentElement.nextElementSibling; comment.classList.toggle('hidden'); const icon = this.querySelector('svg'); if (comment.classList.contains('hidden')) { feather.icons['chevron-down'].replace(icon); } else { feather.icons['chevron-up'].replace(icon); } }); }); // Interactive editor functionality const editorLines = document.querySelectorAll('.editor-body .line'); editorLines.forEach((line, index) => { line.setAttribute('data-line', (index + 1).toString().padStart(4, '0')); }); // Run button functionality const runButton = document.querySelector('.editor-header button'); if (runButton) { runButton.addEventListener('click', function() { alert('Fonctionnalité d\'exécution simulée. En production, cela enverrait le code à un compilateur COBOL.'); }); } });