Spaces:
Running
Running
Download public/js/app.js from Tataaicoltd/api: direct link, hf CLI and curl.
- Browser
- Download file 702 Bytes
-
https://huggingface.co/spaces/Tataaicoltd/api/resolve/main/public/js/app.js
- Command line
-
hf download hf://spaces/Tataaicoltd/api/public/js/app.js
-
curl -L -o app.js https://huggingface.co/spaces/Tataaicoltd/api/resolve/main/public/js/app.js
702 Bytes
| // Simple hash router + sidebar highlighting. | |
| const App = { | |
| routes: { | |
| projects: ProjectsView, | |
| tickets: TicketsView | |
| }, | |
| start() { | |
| window.addEventListener('hashchange', () => this.route()); | |
| this.route(); | |
| }, | |
| currentView() { | |
| const hash = location.hash.replace(/^#\//, '') || 'projects'; | |
| return this.routes[hash] ? hash : 'projects'; | |
| }, | |
| route() { | |
| const view = this.currentView(); | |
| document.querySelectorAll('.side-item').forEach((a) => | |
| a.classList.toggle('active', a.dataset.view === view) | |
| ); | |
| const app = document.getElementById('app'); | |
| this.routes[view].render(app); | |
| } | |
| }; | |
| document.addEventListener('DOMContentLoaded', () => App.start()); | |