From 53ba9eb1295c9e42ecaa2e401b9a3fb6508eeeca Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Thu, 10 Nov 2022 20:31:25 -0600 Subject: [PATCH] Do not show url scheme for short url --- src/main/resources/public/js/main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/resources/public/js/main.js b/src/main/resources/public/js/main.js index 4871067..c4633b4 100644 --- a/src/main/resources/public/js/main.js +++ b/src/main/resources/public/js/main.js @@ -23,7 +23,8 @@ const refreshData = async () => { }; const displayData = async (data) => { - site = await siteName(); + let site = await siteName(); + site = site.replace(/(^\w+:|^)\/\//, ''); table_box = document.querySelector(".pure-table"); if (data.length == 0) { table_box.style.visibility = "hidden"; @@ -62,7 +63,7 @@ const TR = (row, site) => { }; const copyShortUrl = async (s) => { - site = await siteName(); + const site = await siteName(); navigator.clipboard.writeText(`${site}/${s}`); addAlertBox(`Short URL ${s} copied to clipboard!`, "green"); };