1
0
Fork 0
mirror of https://github.com/SinTan1729/chhoto-url synced 2024-12-26 23:58:35 -06:00

Do not show url scheme for short url

This commit is contained in:
Sayantan Santra 2022-11-10 20:31:25 -06:00
parent deeba64e74
commit 53ba9eb129

View file

@ -23,7 +23,8 @@ const refreshData = async () => {
}; };
const displayData = async (data) => { const displayData = async (data) => {
site = await siteName(); let site = await siteName();
site = site.replace(/(^\w+:|^)\/\//, '');
table_box = document.querySelector(".pure-table"); table_box = document.querySelector(".pure-table");
if (data.length == 0) { if (data.length == 0) {
table_box.style.visibility = "hidden"; table_box.style.visibility = "hidden";
@ -62,7 +63,7 @@ const TR = (row, site) => {
}; };
const copyShortUrl = async (s) => { const copyShortUrl = async (s) => {
site = await siteName(); const site = await siteName();
navigator.clipboard.writeText(`${site}/${s}`); navigator.clipboard.writeText(`${site}/${s}`);
addAlertBox(`Short URL ${s} copied to clipboard!`, "green"); addAlertBox(`Short URL ${s} copied to clipboard!`, "green");
}; };