diff options
| -rw-r--r-- | assets/js/fediform.js | 10 | ||||
| -rw-r--r-- | layouts/_partials/posts/fediverse-form.html | 8 | ||||
| -rw-r--r-- | 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 }} <div class="flex flex-col gap-2"> <h4 class="text-sm font-semibold m-0">{{ T "actionMenu.fediverse" }}</h4> - <input type="text" id="fediverse-instance" placeholder="{{ T "actionMenu.fediversePlaceholder" }}" class="text-sm px-2 py-1 border border-neutral-300 dark:border-neutral-600 rounded bg-transparent"> - <button id="fediform-button" class="text-xs px-2 py-1 bg-neutral-200 dark:bg-neutral-600 rounded hover:bg-neutral-300 dark:hover:bg-neutral-500 transition-colors">{{ T "actionMenu.openToot" }}</button> + <input type="text" id="fediverse-instance" placeholder="{{ T "actionMenu.fediversePlaceholder" }}" class="text-sm px-2 py-1 border border-neutral-300 dark:border-neutral-600 rounded bg-transparent dark:text-white"> + <div class="flex gap-2"> + <button id="fediform-copy-button" class="text-xs px-2 py-1 bg-neutral-100 dark:bg-neutral-700 rounded hover:bg-neutral-200 dark:hover:bg-neutral-700 transition-colors">📋</button> + + <button id="fediform-button" class="w-full text-xs px-2 py-1 bg-neutral-200 dark:bg-neutral-600 rounded hover:bg-neutral-300 dark:hover:bg-neutral-500 transition-colors">{{ T "actionMenu.openToot" }}</button> + </div> </div> <script> const tootUrl = '{{ .Params.toot }}' diff --git a/layouts/_partials/posts/webmention-form.html b/layouts/_partials/posts/webmention-form.html index 65062592..4430961b 100644 --- a/layouts/_partials/posts/webmention-form.html +++ b/layouts/_partials/posts/webmention-form.html @@ -1,6 +1,6 @@ <form action="https://webmention.io/www.geedea.pro/webmention" method="POST" class="flex flex-col gap-2"> <h4 class="text-sm font-semibold m-0">{{ T "actionMenu.webmention" }}</h4> - <input type="url" name="source" placeholder="{{ T "actionMenu.webmentionPlaceholder" }}" class="text-sm px-2 py-1 border border-neutral-300 dark:border-neutral-600 rounded bg-transparent"> + <input type="url" name="source" placeholder="{{ T "actionMenu.webmentionPlaceholder" }}" class="text-sm px-2 py-1 border border-neutral-300 dark:border-neutral-600 rounded bg-transparent dark:text-white"> <input type="hidden" name="target" value="{{ .Permalink }}"> <button type="submit" class="text-xs px-2 py-1 bg-neutral-200 dark:bg-neutral-600 rounded hover:bg-neutral-300 dark:hover:bg-neutral-500 transition-colors">{{ T "actionMenu.send" }}</button> </form> |
