Download citations.js from chaewanC/chun: direct link, hf CLI and curl.
- Browser
- Download file 750 Bytes
-
https://huggingface.co/spaces/chaewanC/chun/resolve/main/citations.js
- Command line
-
hf download hf://spaces/chaewanC/chun/citations.js
-
curl -L -o citations.js https://huggingface.co/spaces/chaewanC/chun/resolve/main/citations.js
750 Bytes
| document.querySelectorAll('.copy-bibtex').forEach((button) => { | |
| button.hidden = false; | |
| button.addEventListener('click', async () => { | |
| const code = document.getElementById(button.dataset.copy); | |
| const status = button.closest('.citation-box').querySelector('.copy-status'); | |
| if (!code) return; | |
| try { | |
| await navigator.clipboard.writeText(code.textContent); | |
| status.textContent = 'Copied.'; | |
| } catch { | |
| const selection = window.getSelection(); | |
| if (selection) { | |
| const range = document.createRange(); | |
| range.selectNodeContents(code); | |
| selection.removeAllRanges(); | |
| selection.addRange(range); | |
| } | |
| status.textContent = 'Select and copy the citation manually.'; | |
| } | |
| }); | |
| }); | |