Download app/static/js/stats-view-script.js from paisaly/backend: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/spaces/paisaly/backend/resolve/main/app/static/js/stats-view-script.js
- Command line
-
hf download hf://spaces/paisaly/backend/app/static/js/stats-view-script.js
-
curl -L -o stats-view-script.js https://huggingface.co/spaces/paisaly/backend/resolve/main/app/static/js/stats-view-script.js
1.15 kB
| var qrcode = document.getElementById("qrcode"); | |
| qrcode.onload = function () { | |
| var qrcodeContainer = document.getElementById("qr-code-container"); | |
| qrcodeContainer.style.animation = "none"; | |
| qrcodeContainer.addEventListener("mouseenter", function () { | |
| qrcodeContainer.style.cursor = "pointer"; | |
| var qrcodeOverlay = document.getElementById("qrcode-overlay"); | |
| qrcodeOverlay.style.display = "flex"; | |
| }); | |
| qrcodeContainer.addEventListener("mouseleave", function () { | |
| const qrcodeOverlay = document.getElementById("qrcode-overlay"); | |
| qrcodeOverlay.style.display = "none"; | |
| }); | |
| qrcodeContainer.addEventListener("click", function () { | |
| downloadQRCode(); | |
| }); | |
| }; | |
| function downloadQRCode() { | |
| fetch(qrcode.src, { mode: "cors" }) | |
| .then(function (res) { return res.blob(); }) | |
| .then(function (blob) { | |
| var link = document.createElement("a"); | |
| link.href = URL.createObjectURL(blob); | |
| link.download = "qrcode.png"; | |
| link.click(); | |
| URL.revokeObjectURL(link.href); | |
| }); | |
| } | |