Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions assets/js/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
79 changes: 29 additions & 50 deletions downloads.html
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ <h3 id="SRC_RELEASE_NAME">OpenSCAD</h3></a>
<h1>Release Candidates</h1>
<p>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.
<p>
</p>
<p>The Binaries are signed with <a href="#gnupg">GnuPG</a></p>
<ul>
<li>OpenSCAD &lt;dev@openscad.org&gt;</li>
Expand All @@ -320,26 +320,7 @@ <h3 id="MAC_RC_NAME">OpenSCAD</h3>
</div>
<div id="rc-windows" class="subsection">
<h2>Windows</h2>
<div class="left, download-button">
<a id="WIN32_INSTALLER_RC_URL" href="https://files.openscad.org">
<h3 id="WIN32_INSTALLER_RC_NAME">OpenSCAD</h3>
</a>
<small>x86 (32-bit) - exe installer - </small><small id="WIN32_INSTALLER_RC_SIZE">?? MB</small><br>
<small><a id="WIN32_INSTALLER_RC_ASC_URL" href="">asc</a></small> -
<small><a id="WIN32_INSTALLER_RC_SHA256_URL" href="">sha256</a></small> -
<small><a id="WIN32_INSTALLER_RC_SHA512_URL" href="">sha512</a></small>
</div>
<div class="download-button">
<a id="WIN32_ZIP_RC_URL" href="https://files.openscad.org">
<h3 id="WIN32_ZIP_RC_NAME">OpenSCAD</h3>
</a>
<small>x86 (32-bit) - zip package - </small><small id="WIN32_ZIP_RC_SIZE">?? MB</small><br>
<small><a id="WIN32_ZIP_RC_ASC_URL" href="">asc</a></small> -
<small><a id="WIN32_ZIP_RC_SHA256_URL" href="">sha256</a></small> -
<small><a id="WIN32_ZIP_RC_SHA512_URL" href="">sha512</a></small>
</div>
<br>
<div class="left, download-button">
<a id="WIN64_INSTALLER_RC_URL" href="https://files.openscad.org">
<h3 id="WIN64_INSTALLER_RC_NAME">OpenSCAD</h3>
</a>
Expand All @@ -360,7 +341,7 @@ <h3 id="WIN64_ZIP_RC_NAME">OpenSCAD</h3>
</div>
<div id="rc-linux" class="subsection">
<h2>Linux - AppImage</h2>
<div class="left, download-button">
<div class="download-button">
<a id="LIN64_RC_URL" href="https://files.openscad.org">
<h3 id="LIN64_RC_NAME">OpenSCAD</h3>
</a>
Expand All @@ -369,7 +350,7 @@ <h3 id="LIN64_RC_NAME">OpenSCAD</h3>
<small><a id="LIN64_RC_SHA256_URL" href="">sha256</a></small> -
<small><a id="LIN64_RC_SHA512_URL" href="">sha512</a></small>
</div>
<div class="download-button">
<div class="download-button" style="display:none">
<a id="LIN_AARCH64_RC_URL" href="https://files.openscad.org">
<h3 id="LIN_AARCH64_RC_NAME">OpenSCAD</h3>
</a>
Expand All @@ -381,34 +362,32 @@ <h3 id="LIN_AARCH64_RC_NAME">OpenSCAD</h3>
</div>
<div id="rc-wasm" class="subsection">
<h2 class="link-hover">WebAssembly<span> <a class="section-link" href="#rc-wasm">§</a></span></h2>
<div class="row">
<div class="card">
<a id="WASM_WEB_RC_URL" href="https://files.openscad.org">
<h3 id="WASM_WEB_RC_NAME">OpenSCAD</h3>
</a>
<small>WebAssembly - WEB package - </small><small id="WASM_WEB_RC_SIZE">?? MB</small><br />
<small><a id="WASM_WEB_RC_ASC_URL" href="">asc</a></small> -
<small><a id="WASM_WEB_RC_SHA256_URL" href="">sha256</a></small> -
<small><a id="WASM_WEB_RC_SHA512_URL" href="">sha512</a></small>
</div>
<div class="card">
<a id="WASM_NODE_RC_URL" href="https://files.openscad.org">
<h3 id="WASM_NODE_RC_NAME">OpenSCAD</h3>
</a>
<small>WebAssembly - NODE package - </small><small id="WASM_NODE_RC_SIZE">?? MB</small><br />
<small><a id="WASM_NODE_RC_ASC_URL" href="">asc</a></small> -
<small><a id="WASM_NODE_RC_SHA256_URL" href="">sha256</a></small> -
<small><a id="WASM_NODE_RC_SHA512_URL" href="">sha512</a></small>
</div>
<div class="card">
<a id="WASM_NODE_MODULE_RC_URL" href="https://files.openscad.org">
<h3 id="WASM_NODE_MODULE_RC_NAME">OpenSCAD</h3>
</a>
<small>WebAssembly - Node.js Library Module - </small><small id="WASM_NODE_MODULE_RC_SIZE">?? MB</small><br />
<small><a id="WASM_NODE_MODULE_RC_ASC_URL" href="">asc</a></small> -
<small><a id="WASM_NODE_MODULE_RC_SHA256_URL" href="">sha256</a></small> -
<small><a id="WASM_NODE_MODULE_RC_SHA512_URL" href="">sha512</a></small>
</div>
<div class="download-button">
<a id="WASM_WEB_RC_URL" href="https://files.openscad.org">
<h3 id="WASM_WEB_RC_NAME">OpenSCAD</h3>
</a>
<small>WebAssembly - WEB package - </small><small id="WASM_WEB_RC_SIZE">?? MB</small><br>
<small><a id="WASM_WEB_RC_ASC_URL" href="">asc</a></small> -
<small><a id="WASM_WEB_RC_SHA256_URL" href="">sha256</a></small> -
<small><a id="WASM_WEB_RC_SHA512_URL" href="">sha512</a></small>
</div>
<div class="download-button">
<a id="WASM_NODE_RC_URL" href="https://files.openscad.org">
<h3 id="WASM_NODE_RC_NAME">OpenSCAD</h3>
</a>
<small>WebAssembly - NODE package - </small><small id="WASM_NODE_RC_SIZE">?? MB</small><br>
<small><a id="WASM_NODE_RC_ASC_URL" href="">asc</a></small> -
<small><a id="WASM_NODE_RC_SHA256_URL" href="">sha256</a></small> -
<small><a id="WASM_NODE_RC_SHA512_URL" href="">sha512</a></small>
</div>
<div class="download-button">
<a id="WASM_NODE_MODULE_RC_URL" href="https://files.openscad.org">
<h3 id="WASM_NODE_MODULE_RC_NAME">OpenSCAD</h3>
</a>
<small>WebAssembly - Node.js Library Module - </small><small id="WASM_NODE_MODULE_RC_SIZE">?? MB</small><br>
<small><a id="WASM_NODE_MODULE_RC_ASC_URL" href="">asc</a></small> -
<small><a id="WASM_NODE_MODULE_RC_SHA256_URL" href="">sha256</a></small> -
<small><a id="WASM_NODE_MODULE_RC_SHA512_URL" href="">sha512</a></small>
</div>
</div>
<div id="rc-source" class="subsection">
Expand Down
Loading