From 018f47449f8678ce44e26dff8cea94612fdd42cb Mon Sep 17 00:00:00 2001 From: primal Date: Fri, 30 Jan 2026 16:17:59 -0500 Subject: [PATCH] v43: Add TLD footer with collapse button --- static/dashboard.js | 22 +++++++++++++++++++++- templates.go | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/static/dashboard.js b/static/dashboard.js index d19a193..328ca51 100644 --- a/static/dashboard.js +++ b/static/dashboard.js @@ -1054,15 +1054,35 @@ function initDashboard() { isExpanded = !collapsedTLDs.has(tldText); } - // Find all domain blocks until next TLD header + // Find all domain blocks until next TLD header, track last domain block let nextEl = header.nextElementSibling; + let lastDomainBlock = null; while (nextEl && !nextEl.classList.contains('tld-header')) { if (nextEl.classList.contains('domain-block')) { nextEl.style.display = isExpanded ? 'block' : 'none'; + lastDomainBlock = nextEl; + } + if (nextEl.classList.contains('tld-footer')) { + nextEl.style.display = isExpanded ? 'block' : 'none'; } nextEl = nextEl.nextElementSibling; } + // Insert footer if it doesn't exist and we have domain blocks + if (lastDomainBlock) { + let footer = lastDomainBlock.nextElementSibling; + if (!footer || !footer.classList.contains('tld-footer')) { + const footerHtml = ``; + lastDomainBlock.insertAdjacentHTML('afterend', footerHtml); + // Add click handler to new footer + footer = lastDomainBlock.nextElementSibling; + footer.addEventListener('click', () => { + collapsedTLDs.add(tldText); + applyTLDVisibility(); + }); + } + } + // Style header based on expanded state header.style.color = isExpanded ? '#888' : '#555'; diff --git a/templates.go b/templates.go index 49348be..86bad98 100644 --- a/templates.go +++ b/templates.go @@ -534,7 +534,7 @@ const dashboardHTML = `
-
v42
+
v43
Last updated: {{.UpdatedAt.Format "2006-01-02 15:04:05"}}