From 818c096bece8aa3285b81c4e25f6090da33f0379 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Mon, 2 Dec 2024 21:29:43 -0800 Subject: [PATCH] Use alias hostname --- static/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/index.html b/static/index.html index f815165..bbd53ab 100644 --- a/static/index.html +++ b/static/index.html @@ -151,7 +151,7 @@ async function set(short, long) { // Only set the clipboard if the user didn't change the inputs if (document.getElementById('short').value == oldShort && document.getElementById('long').value == oldLong) { try { - await navigator.clipboard.writeText(`${window.location.origin}/${newShort}`); + await navigator.clipboard.writeText(`{{ .host }}/${newShort}`); } catch (err) { console.log(err); } @@ -188,7 +188,7 @@ function setShortItem(short, icon) { item.appendChild(document.createElement('sl-icon')).setAttribute('name', icon); item.appendChild(document.createTextNode(short)); item.addEventListener('click', () => { - navigator.clipboard.writeText(`${window.location.origin}/${short}`); + navigator.clipboard.writeText(`{{ .host }}/${short}`); }); tree.insertBefore(item, tree.firstChild);