Skip to content

Commit

Permalink
Merge pull request #936 from brson/www
Browse files Browse the repository at this point in the history
Improve browser detection and install instructions
  • Loading branch information
brson authored Feb 2, 2017
2 parents cef6271 + ef52525 commit 2585408
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
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

0 comments on commit 2585408

Please sign in to comment.