blob: 6a3412f16d503cd3c4faf7296bb35f049500ec3f (
plain)
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
39
40
41
42
43
|
$(function() {
var releases_url = DOCUMENTATION_OPTIONS.URL_ROOT + 'releases.json';
function show_edit(branch, data) {
if (branch) {
if (branch === "master") {
$("#dev-warning").show();
return true;
}
if (data && data.releases && branch in data.releases) {
var eol = ("actual_eol" in data.releases[branch]);
if (eol) {
$("#eol-warning").show();
}
return !eol;
}
}
$("#dev-warning").show();
return false;
}
function get_branch() {
var url = window.location.href;
var res = url.match(/docs.ceph.com\/docs\/([a-z]+)\/?/i)
if (res) {
return res[1]
}
return null;
}
$.getJSON(releases_url, function(data) {
var branch = get_branch();
if (show_edit(branch, data)) {
// patch the edit-on-github URL for correct branch
var url = $("#edit-on-github").attr("href");
if (url) {
url = url.replace("master", branch);
$("#edit-on-github").attr("href", url);
}
$("#docubetter").show();
}
});
});
|