Skip to content

Commit a835916

Browse files
authored
Merge pull request #1370 from thibaultdelor/linkAllInstallers
Added a link to all installers to the homepage
2 parents 4e4ab1b + 1da9ed5 commit a835916

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

www/index.html

+7-4
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,25 @@
2626
<div id="platform-instructions-unix" class="instructions" style="display: none;">
2727
<p>Run the following in your terminal, then follow the onscreen instructions.</p>
2828
<pre>curl https://sh.rustup.rs -sSf | sh</pre>
29+
<p class="other-platforms-help">You appear to be running Unix. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
2930
</div>
3031

3132
<div id="platform-instructions-win32" class="instructions" style="display: none;">
3233
<p>
3334
Download and run
34-
<a href="https://win.rustup.rs/i686">rustup&#x2011;init.exe</a>
35+
<a class="windows-download" href="https://win.rustup.rs/i686">rustup&#x2011;init.exe</a>
3536
then follow the onscreen instructions.
3637
</p>
38+
<p class="other-platforms-help">You appear to be running Windows 32 bit. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
3739
</div>
3840

3941
<div id="platform-instructions-win64" class="instructions" style="display: none;">
4042
<p>
4143
Download and run
42-
<a href="https://win.rustup.rs/x86_64">rustup&#x2011;init.exe</a>
44+
<a class="windows-download" href="https://win.rustup.rs/x86_64">rustup&#x2011;init.exe</a>
4345
then follow the onscreen instructions.
4446
</p>
47+
<p class="other-platforms-help">You appear to be running Windows 64 bit. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
4548
</div>
4649

4750
<div id="platform-instructions-unknown" class="instructions" style="display: none;">
@@ -72,7 +75,7 @@
7275
<div>
7376
<p>
7477
If you are running Windows,<br/>download and run
75-
<a href="https://win.rustup.rs">rustup&#x2011;init.exe</a>
78+
<a class="windows-download" href="https://win.rustup.rs">rustup&#x2011;init.exe</a>
7679
then follow the onscreen instructions.
7780
</p>
7881
</div>
@@ -90,7 +93,7 @@
9093
<div>
9194
<p>
9295
If you are running Windows,<br/>download and run
93-
<a href="https://win.rustup.rs">rustup&#x2011;init.exe</a>
96+
<a class="windows-download" href="https://win.rustup.rs">rustup&#x2011;init.exe</a>
9497
then follow the onscreen instructions.
9598
</p>
9699
</div>

www/rustup.css

+9-3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ body#idx p {
8080
margin-bottom: 2em;
8181
}
8282

83+
body#idx p.other-platforms-help {
84+
font-size: 0.6em;
85+
}
86+
8387
.instructions {
8488
background-color: rgb(250, 250, 250);
8589
margin-left: auto;
@@ -103,7 +107,8 @@ hr {
103107
}
104108

105109
#platform-instructions-unix > pre,
106-
#platform-instructions-default > div > pre {
110+
#platform-instructions-default > div > pre,
111+
#platform-instructions-unknown > div > pre {
107112
background-color: #515151;
108113
color: white;
109114
margin-left: auto;
@@ -115,8 +120,9 @@ hr {
115120
box-shadow: inset 0px 0px 20px 0px #333333;
116121
}
117122

118-
#platform-instructions-win a,
119-
#platform-instructions-default a {
123+
#platform-instructions-win a.windows-download,
124+
#platform-instructions-default a.windows-download,
125+
#platform-instructions-unknown a.windows-download {
120126
display: block;
121127
padding-top: 0.4rem;
122128
padding-bottom: 0.6rem;

www/rustup.js

+13
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ function set_up_cycle_button() {
8888
};
8989
}
9090

91+
function go_to_default_platform() {
92+
platform_override = 0;
93+
adjust_for_platform();
94+
}
95+
96+
function set_up_default_platform_buttons() {
97+
var defaults_buttons = document.getElementsByClassName('default-platform-button');
98+
for (var i = 0; i < defaults_buttons.length; i++) {
99+
defaults_buttons[i].onclick = go_to_default_platform;
100+
}
101+
}
102+
91103
function fill_in_bug_report_values() {
92104
var nav_plat = document.getElementById("nav-plat");
93105
var nav_app = document.getElementById("nav-app");
@@ -98,5 +110,6 @@ function fill_in_bug_report_values() {
98110
(function () {
99111
adjust_for_platform();
100112
set_up_cycle_button();
113+
set_up_default_platform_buttons();
101114
fill_in_bug_report_values();
102115
}());

0 commit comments

Comments
 (0)