From aefd78d35442b5f5c67dd71765a8f3a3003527ea Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sat, 31 Oct 2026 23:41:33 -0400 Subject: [PATCH] Tweak RC download page --- assets/js/download.js | 27 +++++++++++---- downloads.html | 79 ++++++++++++++++--------------------------- 2 files changed, 50 insertions(+), 56 deletions(-) diff --git a/assets/js/download.js b/assets/js/download.js index 672d8883..f93cb39c 100644 --- a/assets/js/download.js +++ b/assets/js/download.js @@ -9,12 +9,19 @@ function setSnapshotFileInfo(key, name, size, url) { fileinfo[`${key}_ASC_URL`] = `${url}.asc`; fileinfo[`${key}_SHA256_URL`] = `${url}.sha256`; fileinfo[`${key}_SHA512_URL`] = `${url}.sha512`; + if (document.readyState !== "loading") { + updateDownloadLinks(); + } } -const doCreateNews = () => { +const updateDownloadLinks = () => { for (const [fileid, value] of Object.entries(fileinfo)) { if(fileid.endsWith('_URL')) { - document.querySelector(`a[id="${fileid}"]`)?.setAttribute('href', value); + const link = document.querySelector(`a[id="${fileid}"]`); + if(link) { + link.setAttribute('href', value); + link.closest('.download-button')?.style.removeProperty('display'); + } } else { const el = document.getElementById(fileid); if(el) el.textContent = value; @@ -23,13 +30,21 @@ const doCreateNews = () => { }; const showReleaseCandidate = () => { - document.querySelector('#rc')?.style.removeProperty('display'); - document.querySelector('#nav-rc')?.style.removeProperty('display'); + const show = () => { + document.querySelector('#rc')?.style.removeProperty('display'); + document.querySelector('#nav-rc')?.style.removeProperty('display'); + updateDownloadLinks(); + }; + if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", show); + } else { + show(); + } }; // Failsafe loading pattern. if(document.readyState === "loading") { - document.addEventListener("DOMContentLoaded", doCreateNews); + document.addEventListener("DOMContentLoaded", updateDownloadLinks); } else { - doCreateNews(); + updateDownloadLinks(); } diff --git a/downloads.html b/downloads.html index 33148320..4daa98a0 100644 --- a/downloads.html +++ b/downloads.html @@ -299,7 +299,7 @@

OpenSCAD

Release Candidates

Release Candidates are builds that contain all features that will be included in the next release and are intended to reach a wider audience for testing before the final release. -

+

The Binaries are signed with GnuPG