Spaces:
Running
Running
Download static/loading.js from KrishMalik/delta-v: direct link, hf CLI and curl.
- Browser
- Download file 787 Bytes
-
https://huggingface.co/spaces/KrishMalik/delta-v/resolve/main/static/loading.js
- Command line
-
hf download hf://spaces/KrishMalik/delta-v/static/loading.js
-
curl -L -o loading.js https://huggingface.co/spaces/KrishMalik/delta-v/resolve/main/static/loading.js
787 Bytes
| // Track visible work by page so unrelated preloads cannot hold the bar open. | |
| const DeltaLoading = (() => { | |
| const bar = document.getElementById("site-loading"); | |
| const pending = new Set(); | |
| function refresh() { | |
| const page = document.body.dataset.page; | |
| bar.hidden = !Array.from(pending).some(pages => !pages.length || pages.includes(page)); | |
| } | |
| function start(...pages) { | |
| pending.add(pages); | |
| refresh(); | |
| return () => { | |
| pending.delete(pages); | |
| refresh(); | |
| }; | |
| } | |
| function track(promise, ...pages) { | |
| const finish = start(...pages); | |
| return Promise.resolve(promise).finally(finish); | |
| } | |
| if (document.readyState !== "complete") { | |
| window.addEventListener("load", start(), { once: true }); | |
| } | |
| return { refresh, start, track }; | |
| })(); | |