A public, read-only web view of the directory (#215)
The directory renders its own pages from the store: the most subscribed, categories, A to Z, search, and a page per feed with its address and a Copy button. No token, nothing that writes; /v1 keeps its token check. The publisher's HTML is shown as text, item links only when http(s), with a strict Content-Security-Policy; covers load from their publishers with no referrer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
10
crates/directory/src/site.js
Normal file
10
crates/directory/src/site.js
Normal file
@@ -0,0 +1,10 @@
|
||||
// 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.
|
||||
document.addEventListener('click', ev => {
|
||||
const b = ev.target.closest('[data-copy]');
|
||||
if (!b || !navigator.clipboard) return;
|
||||
navigator.clipboard.writeText(b.dataset.copy).then(() => {
|
||||
b.textContent = 'Copied';
|
||||
setTimeout(() => { b.textContent = 'Copy'; }, 1500);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user