godoc/static: replace version strings with actual versions
This will allow the source installation instructions to always show the current version, but only when that version is a release version. Fixes golang/go#14371 Change-Id: Ibfad8054f3c75d9320ca94ba5149ab9bf052157e Reviewed-on: https://go-review.googlesource.com/22056 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
5da1e91fb2
commit
3868f57059
|
@ -100,6 +100,7 @@ and code is licensed under a <a href="/LICENSE">BSD license</a>.<br>
|
||||||
{{if .Playground}}
|
{{if .Playground}}
|
||||||
<script type="text/javascript" src="/lib/godoc/playground.js"></script>
|
<script type="text/javascript" src="/lib/godoc/playground.js"></script>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{with .Version}}<script>var goVersion = {{printf "%q" .}};</script>{{end}}
|
||||||
<script type="text/javascript" src="/lib/godoc/godocs.js"></script>
|
<script type="text/javascript" src="/lib/godoc/godocs.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -297,6 +297,14 @@ function personalizeInstallInstructions() {
|
||||||
window.location = download;
|
window.location = download;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateVersionTags() {
|
||||||
|
var v = window.goVersion;
|
||||||
|
if (/^go[0-9.]+$/.test(v)) {
|
||||||
|
$(".versionTag").empty().text(v);
|
||||||
|
$(".whereTag").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
bindSearchEvents();
|
bindSearchEvents();
|
||||||
generateTOC();
|
generateTOC();
|
||||||
|
@ -313,6 +321,7 @@ $(document).ready(function() {
|
||||||
setupCallgraphs();
|
setupCallgraphs();
|
||||||
toggleHash();
|
toggleHash();
|
||||||
personalizeInstallInstructions();
|
personalizeInstallInstructions();
|
||||||
|
updateVersionTags();
|
||||||
|
|
||||||
// godoc.html defines window.initFuncs in the <head> tag, and root.html and
|
// godoc.html defines window.initFuncs in the <head> tag, and root.html and
|
||||||
// codewalk.js push their on-page-ready functions to the list.
|
// codewalk.js push their on-page-ready functions to the list.
|
||||||
|
|
|
@ -560,6 +560,7 @@ and code is licensed under a <a href="/LICENSE">BSD license</a>.<br>
|
||||||
{{if .Playground}}
|
{{if .Playground}}
|
||||||
<script type="text/javascript" src="/lib/godoc/playground.js"></script>
|
<script type="text/javascript" src="/lib/godoc/playground.js"></script>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{with .Version}}<script>var goVersion = {{printf "%q" .}};</script>{{end}}
|
||||||
<script type="text/javascript" src="/lib/godoc/godocs.js"></script>
|
<script type="text/javascript" src="/lib/godoc/godocs.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@ -866,6 +867,14 @@ function personalizeInstallInstructions() {
|
||||||
window.location = download;
|
window.location = download;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateVersionTags() {
|
||||||
|
var v = window.goVersion;
|
||||||
|
if (/^go[0-9.]+$/.test(v)) {
|
||||||
|
$(".versionTag").empty().text(v);
|
||||||
|
$(".whereTag").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
bindSearchEvents();
|
bindSearchEvents();
|
||||||
generateTOC();
|
generateTOC();
|
||||||
|
@ -882,6 +891,7 @@ $(document).ready(function() {
|
||||||
setupCallgraphs();
|
setupCallgraphs();
|
||||||
toggleHash();
|
toggleHash();
|
||||||
personalizeInstallInstructions();
|
personalizeInstallInstructions();
|
||||||
|
updateVersionTags();
|
||||||
|
|
||||||
// godoc.html defines window.initFuncs in the <head> tag, and root.html and
|
// godoc.html defines window.initFuncs in the <head> tag, and root.html and
|
||||||
// codewalk.js push their on-page-ready functions to the list.
|
// codewalk.js push their on-page-ready functions to the list.
|
||||||
|
|
Loading…
Reference in New Issue