Download static/app.js from lvwerra/tracebin: direct link, hf CLI and curl.
- Browser
- Download file 795 Bytes
-
https://huggingface.co/spaces/lvwerra/tracebin/resolve/main/static/app.js
- Command line
-
hf download hf://spaces/lvwerra/tracebin/static/app.js
-
curl -L -o app.js https://huggingface.co/spaces/lvwerra/tracebin/resolve/main/static/app.js
795 Bytes
| document.addEventListener("click", function (event) { | |
| var button = event.target.closest("[data-copy]"); | |
| if (!button) return; | |
| var field = document.getElementById(button.dataset.copy); | |
| if (!field) return; | |
| function done() { | |
| var original = button.textContent; | |
| button.textContent = "Copied"; | |
| setTimeout(function () { | |
| button.textContent = original; | |
| }, 1500); | |
| } | |
| field.select(); | |
| field.setSelectionRange(0, field.value.length); // iOS needs the explicit range | |
| if (navigator.clipboard) { | |
| navigator.clipboard.writeText(field.value).then(done, function () { | |
| if (document.execCommand("copy")) done(); | |
| }); | |
| } else if (document.execCommand("copy")) { | |
| // Older browsers, and any context the async clipboard API is unavailable in. | |
| done(); | |
| } | |
| }); | |