docs: update README.md with new content
This commit is contained in:
parent
c1fefcc766
commit
467092db1f
11 changed files with 133 additions and 60 deletions
24
sites/dossiers.ngi.hacktivism.ch/_cascade/bar.js
Normal file
24
sites/dossiers.ngi.hacktivism.ch/_cascade/bar.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
(function () {
|
||||
var nodes = document.querySelectorAll(".cascade-bar [data-tip]");
|
||||
if (!nodes.length) return;
|
||||
fetch("/branch-status.json", { cache: "no-store" })
|
||||
.then(function (res) {
|
||||
if (!res.ok) throw new Error("status");
|
||||
return res.json();
|
||||
})
|
||||
.then(function (data) {
|
||||
var tips = {};
|
||||
var list = (data && data.branches) || [];
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
var row = list[i];
|
||||
if (row && row.branch && row.tip) tips[row.branch] = row.tip;
|
||||
}
|
||||
for (var j = 0; j < nodes.length; j++) {
|
||||
var el = nodes[j];
|
||||
var name = el.getAttribute("data-tip");
|
||||
var tip = tips[name];
|
||||
if (tip) el.textContent = name + " @ " + tip;
|
||||
}
|
||||
})
|
||||
.catch(function () {});
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue