summaryrefslogtreecommitdiff
path: root/assets/js/fediform.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/fediform.js')
-rw-r--r--assets/js/fediform.js42
1 files changed, 0 insertions, 42 deletions
diff --git a/assets/js/fediform.js b/assets/js/fediform.js
deleted file mode 100644
index 30c2815..0000000
--- a/assets/js/fediform.js
+++ /dev/null
@@ -1,42 +0,0 @@
-document.addEventListener("DOMContentLoaded", () => {
- // open toot in fediverse
- const instanceInput = document.getElementById('fediverse-instance')
- if (instanceInput) {
- const savedInstance = localStorage.getItem("geedeapro.fediInstance")
- if (savedInstance) instanceInput.value = savedInstance
-
- function openInFediverse() {
- const instance = instanceInput.value.trim();
-
- let url = tootUrl
- if (instance) {
- url = 'https://' + instance + '/authorize_interaction?uri=' + encodeURIComponent(tootUrl);
- // save instance url to localStorage
- localStorage.setItem("geedeapro.fediInstance", instance)
- }
- window.open(url, '_blank');
- }
-
- const fediformButton = document.getElementById('fediform-button');
- fediformButton.addEventListener("click", openInFediverse)
-
- instanceInput.addEventListener('keypress', function(event) {
- if (event.key === 'Enter') {
- event.preventDefault();
- openInFediverse();
- }
- });
- }
-
-
- // copy toot link:
- const copyBtn = document.getElementById("fediform-copy-button")
- if (copyBtn) {
- function copyTootLink() {
- navigator.clipboard.writeText(tootUrl)
- copyBtn.innerText = '✅'
- setTimeout(() => copyBtn.innerText = '📋', 3000)
- }
- copyBtn.addEventListener("click", copyTootLink)
- }
-})