From bc8dab8a34cb8b8bb189bec4fbceab9541767ab3 Mon Sep 17 00:00:00 2001 From: eltrac Date: Fri, 1 May 2026 13:29:09 +0800 Subject: refactor: remove old interaction area code --- assets/js/fediform.js | 42 ---------------------------- layouts/_partials/posts/action-area.html | 16 ----------- layouts/_partials/posts/fediverse-form.html | 14 ---------- layouts/_partials/posts/webmention-form.html | 6 ---- layouts/_partials/scripts.html | 1 - 5 files changed, 79 deletions(-) delete mode 100644 assets/js/fediform.js delete mode 100644 layouts/_partials/posts/action-area.html delete mode 100644 layouts/_partials/posts/fediverse-form.html delete mode 100644 layouts/_partials/posts/webmention-form.html 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) - } -}) diff --git a/layouts/_partials/posts/action-area.html b/layouts/_partials/posts/action-area.html deleted file mode 100644 index 06f0003..0000000 --- a/layouts/_partials/posts/action-area.html +++ /dev/null @@ -1,16 +0,0 @@ -
-
- {{ partial "posts/fediverse-form" . }} - {{ partial "posts/webmention-form" . }} -
-
-

📧 {{ T "actionMenu.email" }}

- {{ if eq .Site.Language.Lang "zh" }} -

这是什么?

- {{ end }} -
-
diff --git a/layouts/_partials/posts/fediverse-form.html b/layouts/_partials/posts/fediverse-form.html deleted file mode 100644 index faff355..0000000 --- a/layouts/_partials/posts/fediverse-form.html +++ /dev/null @@ -1,14 +0,0 @@ -{{ if .Params.toot }} -
-

{{ T "actionMenu.fediverse" }}

- -
- - - -
-
- -{{ end }} diff --git a/layouts/_partials/posts/webmention-form.html b/layouts/_partials/posts/webmention-form.html deleted file mode 100644 index 4499f89..0000000 --- a/layouts/_partials/posts/webmention-form.html +++ /dev/null @@ -1,6 +0,0 @@ -
-

{{ T "actionMenu.webmention" }}

- - - -
diff --git a/layouts/_partials/scripts.html b/layouts/_partials/scripts.html index 145076f..d2115c6 100644 --- a/layouts/_partials/scripts.html +++ b/layouts/_partials/scripts.html @@ -28,7 +28,6 @@ if (localStorage.getItem('geedeapro.closeInteractionNote')) { {{ $articleJS := slice (resources.Get "js/toc.js") (resources.Get "js/back2top.js") - (resources.Get "js/fediform.js") (resources.Get "js/iine.js") }} {{ $articleBundle := $articleJS | resources.Concat "js/article-bundle.js" | minify | fingerprint }} -- cgit v1.2.3