// The one thing the directory's pages script (#215): Copy puts a feed's address on the clipboard. // Without it, the address is in a field of its own to select by hand. // // The source: the directory serves site.js, made from this by `node web/build.mts --directory-script` // (#392), since its build has no Node to make it; tests/directory-script.ts checks the two agree. document.addEventListener('click', (ev) => { const b = (ev.target as Element | null)?.closest('[data-copy]'); // Only in a secure context; plain HTTP has no clipboard. if (!b || !navigator.clipboard) return; void navigator.clipboard.writeText(b.dataset.copy ?? '').then(() => { b.textContent = 'Copied'; setTimeout(() => { b.textContent = 'Copy'; }, 1500); }); });