forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsidebar_versions.html
More file actions
38 lines (38 loc) · 1.07 KB
/
sidebar_versions.html
File metadata and controls
38 lines (38 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<div class="sidebar-versions">
<script>
function getSnippet(id, url) {
var req = false;
// For Safari, Firefox, and other non-MS browsers
if (window.XMLHttpRequest) {
try {
req = new XMLHttpRequest();
} catch (e) {
req = false;
}
} else if (window.ActiveXObject) {
// For Internet Explorer on Windows
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
req = false;
}
}
}
var element = document.querySelector(".sidebar-versions");
if (req) {
// Synchronous request, wait till we have it all
req.open('GET', url, false);
req.send(null);
if (req.status == 200) {
element.innerHTML = req.responseText;
} else {
element.innerHTML = "<mark>Could not find Snippet to insert at " + url + "</mark>"
}
}
}
getSnippet('other_versions', '/versions.html');
</script>
</div>