Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit 1e130f6

Browse files
authored
Merge pull request #621 from brson/rustup
Update website for rustup installation
2 parents 51fb92a + 8bf3c21 commit 1e130f6

35 files changed

+3773
-1416
lines changed

Diff for: _config.yml

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ name: The Rust Programming Language
22
stable: "1.13.0"
33
stable_date: "2016-11-10"
44
stable_blog: "/2016/11/10/Rust-1.13.html"
5+
stable_full_version: "rustc 1.13.0 (2c6933acc 2016-11-07)"
56
beta: "1.14"
67
beta_date: "2016-12-22"
78
nightly: "1.15"
9+
channels:
10+
- name: "stable"
11+
vers: "1.13.0"
12+
package: "1.13.0"
13+
- name: "beta"
14+
vers: "1.14"
15+
package: "beta"
16+
- name: "nightly"
17+
vers: "1.15"
18+
package: "nightly"

Diff for: _includes/rustup.js

+147
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
var platform_override = null;
2+
3+
function detect_platform() {
4+
"use strict";
5+
6+
if (platform_override) {
7+
return platform_override;
8+
}
9+
10+
var os = "unknown";
11+
12+
if (navigator.platform == "Linux x86_64") {os = "unix";}
13+
if (navigator.platform == "Linux i686") {os = "unix";}
14+
if (navigator.platform == "Linux i686 on x86_64") {os = "unix";}
15+
if (navigator.platform == "Linux aarch64") {os = "unix";}
16+
if (navigator.platform == "Linux armv6l") {os = "unix";}
17+
if (navigator.platform == "Linux armv7l") {os = "unix";}
18+
if (navigator.platform == "Mac") {os = "unix";}
19+
if (navigator.platform == "Win32") {os = "win";}
20+
if (navigator.platform == "FreeBSD x86_64") {os = "unix";}
21+
if (navigator.platform == "FreeBSD amd64") {os = "unix";}
22+
23+
if (navigator.platform == "Linux armv7l"
24+
&& navigator.appVersion.indexOf("Android") != -1 ) {
25+
os = "android";
26+
}
27+
28+
// I wish I knew by now, but I don't. Try harder.
29+
if (os == "unknown") {
30+
if (navigator.appVersion.indexOf("Win")!=-1) {os = "win";}
31+
if (navigator.appVersion.indexOf("Mac")!=-1) {os = "unix";}
32+
}
33+
34+
return os;
35+
}
36+
37+
function adjust_for_platform() {
38+
"use strict";
39+
40+
var platform = detect_platform();
41+
42+
var unix_div = document.getElementById("platform-instructions-unix");
43+
var win_div = document.getElementById("platform-instructions-win");
44+
var android_div = document.getElementById("platform-instructions-android");
45+
var unknown_div = document.getElementById("platform-instructions-unknown");
46+
var default_div = document.getElementById("platform-instructions-default");
47+
48+
unix_div.style.display = "none";
49+
win_div.style.display = "none";
50+
android_div.style.display = "none";
51+
unknown_div.style.display = "none";
52+
default_div.style.display = "none";
53+
54+
if (platform == "unix") {
55+
unix_div.style.display = "block";
56+
} else if (platform == "win") {
57+
win_div.style.display = "block";
58+
} else if (platform == "android") {
59+
android_div.style.display = "block";
60+
} else if (platform == "unknown") {
61+
unknown_div.style.display = "block";
62+
} else {
63+
default_div.style.display = "block";
64+
}
65+
66+
var platform_specific = document.getElementsByClassName("platform-specific");
67+
for (var el of platform_specific) {
68+
var el_is_not_win = el.className.indexOf("not-win") !== -1;
69+
var el_is_inline = el.tagName.toLowerCase() == "span";
70+
var el_visible_style = "block";
71+
if (el_is_inline) {
72+
el_visible_style = "inline";
73+
}
74+
if (platform == "win") {
75+
if (el_is_not_win) {
76+
el.style.display = "none";
77+
} else {
78+
el.style.display = el_visible_style;
79+
}
80+
} else {
81+
if (el_is_not_win) {
82+
el.style.display = el_visible_style;
83+
} else {
84+
el.style.display = "none";
85+
}
86+
}
87+
}
88+
}
89+
90+
function cycle_platform() {
91+
if (platform_override == null) {
92+
platform_override = "default";
93+
} else if (platform_override == "default") {
94+
platform_override = "unknown";
95+
} else if (platform_override == "unknown") {
96+
platform_override = "win";
97+
} else if (platform_override == "win") {
98+
platform_override = "unix";
99+
} else if (platform_override == "unix") {
100+
platform_override = "android";
101+
} else if (platform_override == "android") {
102+
platform_override = "default";
103+
}
104+
adjust_for_platform();
105+
}
106+
107+
function set_up_cycle_button() {
108+
var cycle_button = document.getElementById("platform-button");
109+
cycle_button.onclick = cycle_platform;
110+
111+
var key="test";
112+
var idx=0;
113+
var unlocked=false;
114+
115+
document.onkeypress = function(event) {
116+
if (event.key == "n" && unlocked) {
117+
cycle_platform();
118+
}
119+
120+
if (event.key == key[idx]) {
121+
idx += 1;
122+
123+
if (idx == key.length) {
124+
cycle_button.style.display = "block";
125+
unlocked = true;
126+
cycle_platform();
127+
}
128+
} else if (event.key == key[0]) {
129+
idx = 1;
130+
} else {
131+
idx = 0;
132+
}
133+
};
134+
}
135+
136+
function fill_in_bug_report_values() {
137+
var nav_plat = document.getElementById("nav-plat");
138+
var nav_app = document.getElementById("nav-app");
139+
nav_plat.textContent = navigator.platform;
140+
nav_app.textContent = navigator.appVersion;
141+
}
142+
143+
(function () {
144+
adjust_for_platform();
145+
set_up_cycle_button();
146+
fill_in_bug_report_values();
147+
}());

Diff for: _layouts/basic.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
</li>
2828
<li class="col-xs-12 col-md-10 menu">
2929
<h2><a href="/en-US/documentation.html">Documentation</a></h2>
30+
<h2><a href="/en-US/install.html">Install</a></h2>
3031
<h2><a href="/en-US/community.html">Community</a></h2>
31-
<h2><a href="/en-US/downloads.html">Downloads</a></h2>
3232
<h2><a href="/en-US/contribute.html">Contribute</a></h2>
3333
</li>
3434
</ul>

Diff for: _layouts/fr/basic.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
</li>
2828
<li class="col-xs-12 col-md-10 menu">
2929
<h2><a href="/fr/documentation.html">Documentation</a></h2>
30+
<h2><a href="/fr/install.html">Install</a></h2>
3031
<h2><a href="/fr/community.html">Communauté</a></h2>
31-
<h2><a href="/fr/downloads.html">Télécharger</a></h2>
3232
<h2><a href="/fr/contribute.html">Contribuer</a></h2>
3333
</li>
3434
</ul>

Diff for: _layouts/ko-KR/basic.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
</li>
2828
<li class="col-xs-12 col-md-10 menu">
2929
<h2><a href="/ko-KR/documentation.html">문서</a></h2>
30+
<h2><a href="/ko-KR/install.html">Install</a></h2>
3031
<h2><a href="/ko-KR/community.html">커뮤니티</a></h2>
31-
<h2><a href="/ko-KR/downloads.html">다운로드</a></h2>
3232
<h2><a href="/ko-KR/contribute.html">기여하기</a></h2>
3333
</li>
3434
</ul>

Diff for: _layouts/pt-BR/basic.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
</li>
2828
<li class="col-xs-12 col-md-10 menu">
2929
<h2><a href="/pt-BR/documentation.html">Documentação</a></h2>
30+
<h2><a href="/pt-BR/install.html">Install</a></h2>
3031
<h2><a href="/pt-BR/community.html">Comunidade</a></h2>
31-
<h2><a href="/pt-BR/downloads.html">Downloads</a></h2>
3232
<h2><a href="/pt-BR/contribute.html">Contribua</a></h2>
3333
</li>
3434
</ul>

Diff for: _layouts/ru-RU/basic.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
</li>
2828
<li class="col-xs-12 col-md-10 menu">
2929
<h2><a href="/ru-RU/documentation.html">Документация</a></h2>
30+
<h2><a href="/ru-RU/install.html">Install</a></h2>
3031
<h2><a href="/ru-RU/community.html">Сообщество</a></h2>
31-
<h2><a href="/ru-RU/downloads.html">Загрузки</a></h2>
3232
<h2><a href="/ru-RU/contribute.html">Участие</a></h2>
3333
</li>
3434
</ul>

Diff for: _layouts/zh-CN/basic.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
</li>
2828
<li class="col-xs-12 col-md-10 menu">
2929
<h2><a href="/zh-CN/documentation.html">文档</a></h2>
30+
<h2><a href="/zh-CN/install.html">Install</a></h2>
3031
<h2><a href="/zh-CN/community.html">社区</a></h2>
31-
<h2><a href="/zh-CN/downloads.html">下载</a></h2>
3232
<h2><a href="/zh-CN/contribute.html">贡献</a></h2>
3333
</li>
3434
</ul>

0 commit comments

Comments
 (0)