From 8c05cb04366b9b5d3c6867e432dd4a18714796cd Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 12 Nov 2025 15:22:05 -0500 Subject: Make RSS subscribe link inline with copy-to-clipboard Subscribe link now appears inline next to label. Click copies URL to clipboard and shows 'Copied!' feedback for 2 seconds. Link truncates if too long to fit in bounding box. --- Biz/PodcastItLater/Web.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'Biz/PodcastItLater/Web.py') diff --git a/Biz/PodcastItLater/Web.py b/Biz/PodcastItLater/Web.py index 6c4d250..c4df33d 100644 --- a/Biz/PodcastItLater/Web.py +++ b/Biz/PodcastItLater/Web.py @@ -611,19 +611,31 @@ class EpisodeList(Component[AnyChildren, EpisodeListAttrs]): "Recent Episodes", classes=["mb-3"], ), - # RSS feed link + # RSS feed link with copy-to-clipboard html.div( html.div( html.i(classes=["bi", "bi-rss-fill", "me-2"]), - html.strong("Subscribe in your podcast app:"), - classes=["mb-2"], - ), - html.div( - html.code( + html.strong("Subscribe in your podcast app: "), + html.a( rss_url or "", - classes=["text-break", "user-select-all"], + href="#", + id="rss-link", + on_click=f"navigator.clipboard.writeText('{rss_url}'); " + "document.getElementById('copy-feedback').classList.remove('d-none'); " # noqa: E501 + "setTimeout(() => document.getElementById('copy-feedback').classList.add('d-none'), 2000); " # noqa: E501 + "return false;", + classes=[ + "text-decoration-none", + "text-truncate", + "d-inline-block", + ], ), - classes=["mb-3", "p-2", "bg-light", "rounded"], + html.span( + " ✓ Copied!", + id="copy-feedback", + classes=["text-success", "small", "d-none"], + ), + classes=["mb-3"], ), ) if rss_url -- cgit v1.2.3