Spaces:
Running
Running
Download script.js from enzinol/deepsite-project: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/enzinol/deepsite-project/resolve/main/script.js
- Command line
-
hf download hf://spaces/enzinol/deepsite-project/script.js
-
curl -L -o script.js https://huggingface.co/spaces/enzinol/deepsite-project/resolve/main/script.js
1.18 kB
| ```javascript | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Handle tab switching | |
| document.querySelectorAll('.nav-link').forEach(tab => { | |
| tab.addEventListener('click', function(e) { | |
| e.preventDefault(); | |
| document.querySelectorAll('.nav-link').forEach(t => t.classList.remove('active')); | |
| this.classList.add('active'); | |
| // Here you would load the sections for the selected tab | |
| }); | |
| }); | |
| // Handle section selection | |
| document.querySelectorAll('.list-group-item').forEach(item => { | |
| item.addEventListener('click', function() { | |
| document.querySelectorAll('.list-group-item').forEach(i => i.classList.remove('active')); | |
| this.classList.add('active'); | |
| // Here you would load the notes for the selected section | |
| }); | |
| }); | |
| // Simulate loading notes when clicking sections | |
| document.querySelectorAll('.list-group-item').forEach(section => { | |
| section.addEventListener('click', function() { | |
| const editorFrame = document.querySelector('iframe'); | |
| editorFrame.src = 'editor.html'; | |
| }); | |
| }); | |
| }); | |
| ``` |