summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorBigCoke233 <hi@guhub.cn>2026-02-07 20:15:19 +0800
committerBigCoke233 <hi@guhub.cn>2026-02-07 20:15:19 +0800
commitb46e42280ca32aca178e56dc3f5caa275bad95af (patch)
treeb0efd7515f04fe1769b2a2ea5870302af0572e15 /assets
parentb305c6cec902ef9cee2a57b0ed28606d5736340f (diff)
feat: add "Copy Toot Link" button
fix the issue where webmention and fediverse input text are black in dark mode
Diffstat (limited to 'assets')
-rw-r--r--assets/js/fediform.js10
1 files changed, 10 insertions, 0 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)
})