Nightly Build
@@ -80,5 +119,44 @@
}
fetchReleases();
+
+ // Attempt autodetection of their operating system
+ var userAgent = navigator.userAgent.toLowerCase();
+
+ var allPlatforms = ["windows", "mac", "linux"];
+
+ var os = "Other";
+ if (userAgent.indexOf("windows") !== -1) {
+ os = "Windows";
+ } else if (userAgent.indexOf("mac") !== -1 && userAgent.indexOf("mobile") === -1 && userAgent.indexOf("phone") === -1) {
+ os = "Mac";
+ } else if (userAgent.indexOf("linux") !== -1 && userAgent.indexOf("android") === -1) {
+ os = "Linux";
+ }
+
+ // Configure the views for this platform
+ document.getElementById("no-js-view").style.display = "none";
+
+ var platformButton = document.getElementById("dl-button-" + os.toLowerCase());
+ if (platformButton !== null) {
+ platformButton.style.display = "block";
+ } else {
+ document.getElementById("platform-unsupported").style.display = "block";
+ }
+
+ // Installer is not available on all platforms
+ if (os === "Mac" || os === "Linux") {
+ document.getElementById("install-view").style.display = "none";
+ document.getElementById("manual-package-view").style.display = "flex";
+ } else {
+ document.getElementById("install-view").style.display = "block";
+ document.getElementById("manual-package-view").style.display = "none";
+ }
+
+ document.getElementById("view-package-listing-button").addEventListener("click", function() {
+ this.style.display = "none";
+ document.getElementById("manual-package-view").style.display = "flex";
+ });
+
{{ end }}
diff --git a/src/scss/yuzu/yuzu.scss b/src/scss/yuzu/yuzu.scss
index 9b9bdc25..d292941e 100644
--- a/src/scss/yuzu/yuzu.scss
+++ b/src/scss/yuzu/yuzu.scss
@@ -96,3 +96,12 @@ a:hover {
.content :not(pre) > code {
background: $dark;
}
+
+// Workaround for browsers without JavaScript for the downloads page
+#install-view, #manual-package-view {
+ display: none;
+}
+
+.dl-button, #platform-unsupported {
+ display: none;
+}