Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve browser detection and install instructions #936

Merged
merged 2 commits into from
Feb 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,38 @@
</div>

<div id="platform-instructions-unknown" class="instructions" style="display: none;">
<!-- unrecognized platform: ask for help -->
<p>I don't recognize your platform.</p>
<p>
rustup runs on Windows, Linux, Mac OS X, FreeBSD and NetBSD. If
you are on one of these platforms and are seeing this then please
<a href="https://github.com/rust-lang-nursery/rustup.rs/issues/new">report an issue</a>,
along with the following values:
<div>
<div>navigator.platform:</div>
<div id="nav-plat"></div>
<div>navigator.appVersion:</div>
<div id="nav-app"></div>
</div>
</p>

<div>
<div>navigator.platform:</div>
<div id="nav-plat"></div>
<div>navigator.appVersion:</div>
<div id="nav-app"></div>
</div>

<!-- duplicate the default cross-platform instructions -->
<div>
<p>If you are running Unix,<br/>run the following in your terminal, then follow the onscreen instructions.</p>
<pre>curl https://sh.rustup.rs -sSf | sh</pre>
</div>

<hr/>

<div>
<p>
If you are running Windows,<br/>download and run
<a href="https://win.rustup.rs">rustup&#x2011;init.exe</a>
then follow the onscreen instructions.
</p>
</div>

</div>

<div id="platform-instructions-default" class="instructions">
Expand Down
3 changes: 2 additions & 1 deletion www/rustup.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ hr {
letter-spacing: 0.1rem;
}

#platform-instructions-unknown div {
/* This is the box that prints navigator.platform, navigator.appVersion values */
#platform-instructions-unknown > div:first-of-type {
font-size: 16px;
line-height: 2rem;
}
Expand Down
2 changes: 2 additions & 0 deletions www/rustup.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ function detect_platform() {
if (os == "unknown") {
if (navigator.appVersion.indexOf("Win")!=-1) {os = "win";}
if (navigator.appVersion.indexOf("Mac")!=-1) {os = "unix";}
// rust-www/#692 - FreeBSD epiphany!
if (navigator.appVersion.indexOf("FreeBSD")!=-1) {os = "unix";}
}

return os;
Expand Down