From b46e42280ca32aca178e56dc3f5caa275bad95af Mon Sep 17 00:00:00 2001 From: BigCoke233 Date: Sat, 7 Feb 2026 20:15:19 +0800 Subject: feat: add "Copy Toot Link" button fix the issue where webmention and fediverse input text are black in dark mode --- assets/js/fediform.js | 10 ++++++++++ layouts/_partials/posts/fediverse-form.html | 8 ++++++-- layouts/_partials/posts/webmention-form.html | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/assets/js/fediform.js b/assets/js/fediform.js index 4a407fea..f257d775 100644 --- a/assets/js/fediform.js +++ b/assets/js/fediform.js @@ -14,6 +14,7 @@ document.addEventListener("DOMContentLoaded", () => { actionArea.classList.add('hidden'); } }); + // open toot in fediverse const instanceInput = document.getElementById('fediverse-instance') const savedInstance = localStorage.getItem("geedeapro.fediInstance") @@ -32,4 +33,13 @@ document.addEventListener("DOMContentLoaded", () => { } document.getElementById("fediform-button").addEventListener("click", openInFediverse) + + // copy toot link: + const copyBtn = document.getElementById("fediform-copy-button") + function copyTootLink() { + navigator.clipboard.writeText(tootUrl) + copyBtn.innerText = '✅' + setTimeout(() => copyBtn.innerText = '📋', 3000) + } + copyBtn.addEventListener("click", copyTootLink) }) diff --git a/layouts/_partials/posts/fediverse-form.html b/layouts/_partials/posts/fediverse-form.html index 08ccaa69..585cb1ef 100644 --- a/layouts/_partials/posts/fediverse-form.html +++ b/layouts/_partials/posts/fediverse-form.html @@ -1,8 +1,12 @@ {{ if .Params.toot }}

{{ T "actionMenu.fediverse" }}

- - + +
+ + + +