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

Don't show the full short url

This commit is contained in:
Sayantan Santra 2022-11-12 23:01:21 -06:00
parent 5c8307c57a
commit 94aece0d1d
2 changed files with 3 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View file

@ -26,9 +26,6 @@ const refreshData = async () => {
const displayData = async (data) => { const displayData = async (data) => {
let site = await getSiteUrl(); let site = await getSiteUrl();
if (window.isSecureContext) {
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";
@ -37,7 +34,7 @@ const displayData = async (data) => {
const table = document.querySelector("#url-table"); const table = document.querySelector("#url-table");
if (!window.isSecureContext) { if (!window.isSecureContext) {
const shortUrlHeader = document.getElementById("short-url-header"); const shortUrlHeader = document.getElementById("short-url-header");
shortUrlHeader.innerHTML = "Short URL (click to open)"; shortUrlHeader.innerHTML = "Short URL (right click and copy)";
} }
table_box.style.visibility = "visible"; table_box.style.visibility = "visible";
table.innerHTML = ''; // Clear table.innerHTML = ''; // Clear
@ -98,8 +95,8 @@ const addProtocol = (input) => {
} }
const A_LONG = (s) => `<a href='${s}'>${s}</a>`; const A_LONG = (s) => `<a href='${s}'>${s}</a>`;
const A_SHORT = (s, t) => `<a href="javascript:copyShortUrl('${s}');">${t}/${s}</a>`; const A_SHORT = (s, t) => `<a href="javascript:copyShortUrl('${s}');">${s}</a>`;
const A_SHORT_INSECURE = (s, t) => `<a href="${t}/${s}">${t}/${s}</a>`; const A_SHORT_INSECURE = (s, t) => `<a href="${t}/${s}">${s}</a>`;
const deleteButton = (shortUrl) => { const deleteButton = (shortUrl) => {
const td = document.createElement("td"); const td = document.createElement("td");