Spaces:
Running
Running
Download script.js from Roas/cobol-perform-explorer: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/spaces/Roas/cobol-perform-explorer/resolve/main/script.js
- Command line
-
hf download hf://spaces/Roas/cobol-perform-explorer/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Roas/cobol-perform-explorer/resolve/main/script.js
1.2 kB
| 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.'); | |
| }); | |
| } | |
| }); |