static: detect platform to hide/show unix/windows instructions
Currently both "testUnix" and "testWindows" elements are shown simultaneously. This change detects the correct platform to hide/show the appropriate elements based on the viewer's browser. Change-Id: I3afee7507d61b2d756127166caede85adcd531b8 Reviewed-on: https://go-review.googlesource.com/35103 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
116266f628
commit
5d76f8ce4f
|
@ -263,7 +263,14 @@ function personalizeInstallInstructions() {
|
|||
var prefix = '?download=';
|
||||
var s = window.location.search;
|
||||
if (s.indexOf(prefix) != 0) {
|
||||
// No 'download' query string; bail.
|
||||
// No 'download' query string; detect "test" instructions from User Agent.
|
||||
if (navigator.platform.indexOf('Win') != -1) {
|
||||
$('.testUnix').hide();
|
||||
$('.testWindows').show();
|
||||
} else {
|
||||
$('.testUnix').show();
|
||||
$('.testWindows').hide();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -833,7 +833,14 @@ function personalizeInstallInstructions() {
|
|||
var prefix = '?download=';
|
||||
var s = window.location.search;
|
||||
if (s.indexOf(prefix) != 0) {
|
||||
// No 'download' query string; bail.
|
||||
// No 'download' query string; detect "test" instructions from User Agent.
|
||||
if (navigator.platform.indexOf('Win') != -1) {
|
||||
$('.testUnix').hide();
|
||||
$('.testWindows').show();
|
||||
} else {
|
||||
$('.testUnix').show();
|
||||
$('.testWindows').hide();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue