File size: 1,203 Bytes
c06b3f3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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.');
        });
    }
});