Implement "Copy URL to Clipboard"

This commit is contained in:
arne 2025-11-18 19:46:44 +01:00
commit f41af48bb0
2 changed files with 11 additions and 2 deletions

View file

@ -126,10 +126,15 @@
margin-bottom: 0
}
.post ul.controls {
.post .controls {
margin: 18px 0 0;
padding: 0;
list-style-type: none;
display: flex;
}
.post .controls .control-element {
margin: .24rem;
}
code {

View file

@ -330,7 +330,11 @@
[:nav
[:ul.controls
[:li.control-element.url
[:a {:href (:url post) :target "_blank"} "↗ Open original post"]]]]
[:a {:href (:url post) :target "_blank"} "↗ Open original post"]]
[:li.control-element.clipboard
[:a {:href "#" :on-click (fn [e]
(.preventDefault e)
(js/navigator.clipboard.writeText (:url post)))} "◎ Copy URL to clipboard"]]]]
#_[debug post]])
(defn- refresh-displayed-posts!