Download app/static/js/result-script.js from paisaly/backend: direct link, hf CLI and curl.
- Browser
- Download file 1.75 kB
-
https://huggingface.co/spaces/paisaly/backend/resolve/main/app/static/js/result-script.js
- Command line
-
hf download hf://spaces/paisaly/backend/app/static/js/result-script.js
-
curl -L -o result-script.js https://huggingface.co/spaces/paisaly/backend/resolve/main/app/static/js/result-script.js
1.75 kB
| function copyShortUrl() { | |
| const shortUrl = document.getElementById('short-url'); | |
| navigator.clipboard.writeText(shortUrl.textContent) | |
| .then(() => { | |
| alert('Short URL copied to clipboard!'); | |
| }) | |
| .catch((error) => { | |
| console.error('Error copying short URL:', error); | |
| }); | |
| } | |
| function downloadQRCode() { | |
| var qrcode = document.getElementById("qrcode"); | |
| 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); | |
| }); | |
| } | |
| function shortenAnotherLink() { | |
| window.location.href = "/"; | |
| } | |
| 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(); | |
| }); | |
| }; | |
| var copyButton = document.querySelector(".copy-button"); | |
| copyButton.addEventListener("click", function () { | |
| copyShortUrl(); | |
| }); |