summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-10-28 06:59:54 (GMT)
committerGeorg Brandl <georg@python.org>2012-10-28 06:59:54 (GMT)
commitab5da6a80ed46cc63f8f239f613b2ce3d044c88f (patch)
treea72694c648258993dc16aae710f3fb89a7beb98e /Doc
parent74076cb85ecd0580fdced994fbfb053f6f39f59c (diff)
parentfffc25da8388b4bcea4c81e1b3dff4e4f4e85b0a (diff)
downloadcpython-ab5da6a80ed46cc63f8f239f613b2ce3d044c88f.zip
cpython-ab5da6a80ed46cc63f8f239f613b2ce3d044c88f.tar.gz
cpython-ab5da6a80ed46cc63f8f239f613b2ce3d044c88f.tar.bz2
merge with 3.2
Diffstat (limited to 'Doc')
-rw-r--r--Doc/tools/sphinxext/static/version_switch.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/Doc/tools/sphinxext/static/version_switch.js b/Doc/tools/sphinxext/static/version_switch.js
index 363bebf..cc7be1c 100644
--- a/Doc/tools/sphinxext/static/version_switch.js
+++ b/Doc/tools/sphinxext/static/version_switch.js
@@ -43,19 +43,21 @@
if (new_url != url) {
// check beforehand if url exists, else redirect to version's start page
- $.get(new_url, function() {
- window.location.href = new_url;
- }).error(function() {
- window.location.href = 'http://docs.python.org/' + selected;
+ $.ajax({
+ url: new_url,
+ success: function() {
+ window.location.href = new_url;
+ },
+ error: function() {
+ window.location.href = 'http://docs.python.org/' + selected;
+ }
});
}
}
$(document).ready(function() {
- var version = DOCUMENTATION_OPTIONS.VERSION.split('.'),
- release = DOCUMENTATION_OPTIONS.RELEASE || DOCUMENTATION_OPTIONS.VERSION;
-
- version = version[0] + '.' + version[1];
+ var release = DOCUMENTATION_OPTIONS.VERSION;
+ var version = release.substr(0, 3);
var select = build_select(version, release);
$('.version_switcher_placeholder').html(select);