1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:54:40 -07:00

godoc/static: redirect to download from installation instructions page

Change-Id: If29d04ced7404d6ba8761f734b4a16fe96959635
Reviewed-on: https://go-review.googlesource.com/13200
Reviewed-by: Chris Broadfoot <cbro@golang.org>
This commit is contained in:
Andrew Gerrand 2015-08-05 15:31:48 +10:00
parent 46829bf9ce
commit a29e96e3bf
3 changed files with 36 additions and 2 deletions

View File

@ -254,7 +254,7 @@ function personalizeInstallInstructions() {
}
var filename = s.substr(prefix.length);
var filenameRE = /^go1\.\d+(\.\d+)?([a-z0-9]+)?\.([a-z0-9]+)-([a-z0-9]+)\.(.+)$/
var filenameRE = /^go1\.\d+(\.\d+)?([a-z0-9]+)?\.([a-z0-9]+)(-[a-z0-9-.]+)?\.([a-z.]+)$/;
$('.downloadFilename').text(filename);
$('.hideFromDownload').hide();
var m = filenameRE.exec(filename);
@ -281,6 +281,16 @@ function personalizeInstallInstructions() {
$('#windowsZipInstructions').hide();
}
}
var download = "https://storage.googleapis.com/golang/" + filename;
var message = $('<p class="downloading">'+
'Your download should begin shortly. '+
'If it does not, click <a>this link</a>.</p>');
message.find('a').attr('href', download);
message.insertAfter('#nav');
window.location = download;
}
$(document).ready(function() {

View File

@ -819,7 +819,7 @@ function personalizeInstallInstructions() {
}
var filename = s.substr(prefix.length);
var filenameRE = /^go1\.\d+(\.\d+)?([a-z0-9]+)?\.([a-z0-9]+)-([a-z0-9]+)\.(.+)$/
var filenameRE = /^go1\.\d+(\.\d+)?([a-z0-9]+)?\.([a-z0-9]+)(-[a-z0-9-.]+)?\.([a-z.]+)$/;
$('.downloadFilename').text(filename);
$('.hideFromDownload').hide();
var m = filenameRE.exec(filename);
@ -846,6 +846,16 @@ function personalizeInstallInstructions() {
$('#windowsZipInstructions').hide();
}
}
var download = "https://storage.googleapis.com/golang/" + filename;
var message = $('<p class="downloading">'+
'Your download should begin shortly. '+
'If it does not, click <a>this link</a>.</p>');
message.find('a').attr('href', download);
message.insertAfter('#nav');
window.location = download;
}
$(document).ready(function() {
@ -3399,6 +3409,13 @@ a.error {
display: none;
}
.downloading {
background: #F9F9BE;
padding: 10px;
text-align: center;
border-radius: 5px;
}
@media (max-width: 930px) {
#heading-wide {
display: none;

View File

@ -643,6 +643,13 @@ a.error {
display: none;
}
.downloading {
background: #F9F9BE;
padding: 10px;
text-align: center;
border-radius: 5px;
}
@media (max-width: 930px) {
#heading-wide {
display: none;