summaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js')
-rw-r--r--static/js/releases.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/static/js/releases.js b/static/js/releases.js
index b99b7d3d..d0a2f83f 100644
--- a/static/js/releases.js
+++ b/static/js/releases.js
@@ -6,6 +6,11 @@ const devices = ["raven", "oriole", "barbet", "redfin", "bramble", "sunfish", "c
const channels = ["stable", "beta"];
const delayMs = 1000 * 60 * 5;
+function updateLink(link, text, url) {
+ link.innerText = text;
+ link.setAttribute("href", url);
+}
+
async function updateReleases() {
const requests = [];
@@ -30,17 +35,10 @@ async function updateReleases() {
const release = document.getElementById(device + "-" + channel);
const links = release.getElementsByTagName("a");
- links[1].innerText = tag;
- links[1].setAttribute("href", versionBaseUrl + tag);
-
- links[2].innerText = factoryFilename;
- links[2].setAttribute("href", factoryUrl);
-
- links[3].innerText = factoryFilename + ".sig";
- links[3].setAttribute("href", factoryUrl + ".sig");
-
- links[4].innerText = updateFilename;
- links[4].setAttribute("href", updateUrl);
+ updateLink(links[1], tag, versionBaseUrl + tag);
+ updateLink(links[2], factoryFilename, factoryUrl);
+ updateLink(links[3], factoryFilename + ".sig", factoryUrl + ".sig");
+ updateLink(links[4], updateFilename, updateUrl);
}));
}
}