diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /doc/_static | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/_static')
-rw-r--r-- | doc/_static/js/ceph.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/_static/js/ceph.js b/doc/_static/js/ceph.js new file mode 100644 index 00000000..61f95fb6 --- /dev/null +++ b/doc/_static/js/ceph.js @@ -0,0 +1,41 @@ +$(function() { + var releases_url = "http://docs.ceph.com/docs/master/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"); + url = url.replace("master", branch); + $("#edit-on-github").attr("href", url); + $("#docubetter").show(); + } + }); +}); |