From 7b35cf9edd7275136a62e0225e45a963d226abc8 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 16 Oct 2018 21:49:17 +1100 Subject: [PATCH 1/4] Add Windows/no-script specific download views --- site/layouts/page/downloads.html | 80 +++++++++++++++++++++++++++++++- src/scss/yuzu/yuzu.scss | 9 ++++ 2 files changed, 88 insertions(+), 1 deletion(-) diff --git a/site/layouts/page/downloads.html b/site/layouts/page/downloads.html index 4f6aa4e0..e53f72f0 100644 --- a/site/layouts/page/downloads.html +++ b/site/layouts/page/downloads.html @@ -29,7 +29,46 @@
-
+
+ Hi! We see that you have JavaScript disabled. We can't show you an + updated listing of the available packages for yuzu, nor alternative + installation methods, but here are a few links to get you started:
+ Windows x64 Installer
+ Nightly releases on GitHub
+ Canary releases on GitHub +
+
+
+
+ yuzu doesn't support your platform. If you are running Windows x64, Mac x64 or Linux x64 however, + choose one of the options below. +
+
+ +
+
+ The yuzu installer automates the management of a yuzu installation, and is + recommended on supported platforms. It provides automated updating as well as shortcuts + in your start menu. +
+
+ + + + +
+

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 = undefined; + 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..729b470c 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 pagge +#install-view, #manual-package-view { + display: none; +} + +.dl-button, #platform-unsupported { + display: none; +} From fec99710cb698a0ed0707622ee2906f63f80ab12 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 16 Oct 2018 21:55:09 +1100 Subject: [PATCH 2/4] Fix detection of Android --- site/layouts/page/downloads.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/site/layouts/page/downloads.html b/site/layouts/page/downloads.html index e53f72f0..46e08ce3 100644 --- a/site/layouts/page/downloads.html +++ b/site/layouts/page/downloads.html @@ -119,13 +119,12 @@ } fetchReleases(); - // Attempt autodetection of their operating system var userAgent = navigator.userAgent.toLowerCase(); var allPlatforms = ["windows", "mac", "linux"]; - var os = undefined; + var os = "Other"; if (userAgent.indexOf("windows") !== -1) { os = "Windows"; } else if (userAgent.indexOf("mac") !== -1 && userAgent.indexOf("mobile") === -1 && userAgent.indexOf("phone") === -1) { From 2264d6fd9262605b03916940d9ead5999d8c66e4 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 16 Oct 2018 21:59:45 +1100 Subject: [PATCH 3/4] Fix typo --- site/layouts/page/downloads.html | 1 + src/scss/yuzu/yuzu.scss | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/site/layouts/page/downloads.html b/site/layouts/page/downloads.html index 46e08ce3..f41d02cd 100644 --- a/site/layouts/page/downloads.html +++ b/site/layouts/page/downloads.html @@ -119,6 +119,7 @@ } fetchReleases(); + // Attempt autodetection of their operating system var userAgent = navigator.userAgent.toLowerCase(); diff --git a/src/scss/yuzu/yuzu.scss b/src/scss/yuzu/yuzu.scss index 729b470c..d292941e 100644 --- a/src/scss/yuzu/yuzu.scss +++ b/src/scss/yuzu/yuzu.scss @@ -97,7 +97,7 @@ a:hover { background: $dark; } -// Workaround for browsers without JavaScript for the downloads pagge +// Workaround for browsers without JavaScript for the downloads page #install-view, #manual-package-view { display: none; } From e21b1aef313a2572118e0b802a810cd214c3c43e Mon Sep 17 00:00:00 2001 From: James Date: Tue, 16 Oct 2018 22:00:33 +1100 Subject: [PATCH 4/4] Fix spacing --- site/layouts/page/downloads.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/site/layouts/page/downloads.html b/site/layouts/page/downloads.html index f41d02cd..3499bb85 100644 --- a/site/layouts/page/downloads.html +++ b/site/layouts/page/downloads.html @@ -46,12 +46,12 @@
-
- The yuzu installer automates the management of a yuzu installation, and is - recommended on supported platforms. It provides automated updating as well as shortcuts - in your start menu. -
-
+
+ The yuzu installer automates the management of a yuzu installation, and is + recommended on supported platforms. It provides automated updating as well as shortcuts + in your start menu. +
+