From 288595e2f870104cd89348f3920558aaa421b40c Mon Sep 17 00:00:00 2001 From: void-57 Date: Sat, 30 Aug 2025 21:44:56 +0530 Subject: [PATCH] fix: improve transaction address and hash link functionality --- css/style.css | 12 ++++++------ index.html | 3 +-- scripts/transactionHistory.js | 27 ++++++++++++++------------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/css/style.css b/css/style.css index b70501a..12760c9 100644 --- a/css/style.css +++ b/css/style.css @@ -1378,6 +1378,7 @@ body { font-family: "Courier New", monospace; font-size: 0.8rem; flex: 1; + cursor: pointer; } .tx-hash { @@ -4403,7 +4404,6 @@ sm-popup::part(popup) { color: var(--primary-color); } - @media (max-width: 768px) { .tx-detail-row { flex-direction: column; @@ -4709,7 +4709,6 @@ sm-popup::part(popup) { color: var(--text-primary); } - @media (max-width: 768px) { .transaction-details-header { flex-direction: row; @@ -5005,7 +5004,6 @@ sm-popup::part(popup) { } } - @media (max-width: 600px) { .balance-header { display: flex; @@ -5032,6 +5030,8 @@ sm-popup::part(popup) { } } -.detail-link{ - text-decoration: none; color:white; cursor: pointer; -} \ No newline at end of file +.detail-link { + text-decoration: none; + color: white; + cursor: pointer; +} diff --git a/index.html b/index.html index 7765503..5a3914a 100644 --- a/index.html +++ b/index.html @@ -1106,7 +1106,7 @@ const txCard = document.querySelector("#txOutput").closest(".card"); if (txCard) txCard.style.display = "none"; }); - + document.addEventListener("DOMContentLoaded", () => { const params = new URLSearchParams(window.location.search); const page = params.get("page"); @@ -1141,7 +1141,6 @@ transactionHistory(url, __historyAddress); }); } -
diff --git a/scripts/transactionHistory.js b/scripts/transactionHistory.js index 1e49038..c89c6e9 100644 --- a/scripts/transactionHistory.js +++ b/scripts/transactionHistory.js @@ -21,7 +21,7 @@ async function transactionHistory(url, address) { let from = ""; let to = ""; let amount = ""; - let extraContractLine = ""; + let extraContractLine = ""; if (type === "TransferContract") { const v = tx.raw_data.contract[0].parameter.value; @@ -33,14 +33,12 @@ async function transactionHistory(url, address) { from = tronWeb.address.fromHex(v.owner_address); - const contractBase58 = tronWeb.address.fromHex(v.contract_address); extraContractLine = `

Contract: ${contractBase58}

`; - const input = (v.data || "").startsWith("0x") ? v.data.slice(2) : v.data || ""; @@ -118,7 +116,6 @@ function copyToClipboard(text) { }); } - // State for filtering and pagination let __nextUrl = null; let __prevUrls = []; @@ -163,13 +160,13 @@ transactionHistory = async function (url, address) { } __updatePagination(); } - return data; + return data; } catch (e) { console.error(e); if (typeof __origTransactionHistory === "function") { __origTransactionHistory(url, address); } - throw e; + throw e; } }; @@ -225,7 +222,7 @@ function __renderTransactions() { let to = ""; let amountText = ""; let directionClass = ""; - let icon = "fa-arrow-up"; + let icon = "fa-arrow-up"; if (type === "TransferContract") { const v = tx.raw_data.contract[0].parameter.value; @@ -291,11 +288,15 @@ function __renderTransactions() {
-
From${from}
-
To${ - to || "—" - }
-
Hash${hash}
+
From${from}
+
To${to}
+
Hash${hash}
`; @@ -359,7 +360,7 @@ function __renderPageNumbers() { for (let n = start; n <= end; n++) { parts.push(push(n, n === __currentPage)); } - + if (__nextUrl) parts.push('
'); return parts.join(""); }