feat(dossiers-ngi): inject-editions-bar.sh for freeze HTML missing include
This commit is contained in:
parent
27c7f4e37e
commit
52e5c1d328
9 changed files with 218 additions and 46 deletions
|
|
@ -1,20 +1,25 @@
|
|||
html {
|
||||
padding-top: var(--cascade-pad, 0px);
|
||||
}
|
||||
.cascade-bar {
|
||||
position: sticky;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
width: 100vw;
|
||||
max-width: 100vw;
|
||||
margin: -1.25rem calc(50% - 50vw) 1rem;
|
||||
padding: 0.55rem 0.75rem 0.65rem;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
padding: 0.2rem 0.5rem 0.25rem;
|
||||
background: #10141a;
|
||||
border-bottom: 1px solid #243040;
|
||||
color: #c8d0d8;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
font-size: 12px;
|
||||
line-height: 1.45;
|
||||
font-size: 11px;
|
||||
line-height: 1.25;
|
||||
}
|
||||
.cascade-tree {
|
||||
width: 100%;
|
||||
|
|
@ -31,7 +36,7 @@ a.cascade-tree-row {
|
|||
display: block;
|
||||
color: #7ec8ff;
|
||||
text-decoration: none;
|
||||
padding: 0.05rem 0.15rem;
|
||||
padding: 0;
|
||||
border-radius: 2px;
|
||||
}
|
||||
a.cascade-tree-row:hover {
|
||||
|
|
@ -52,29 +57,23 @@ a.cascade-tree-row.is-active:hover {
|
|||
}
|
||||
.cascade-bar .tip {
|
||||
color: #8a96a3;
|
||||
white-space: pre-wrap;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.cascade-bar .cascade-default {
|
||||
color: #6a9080;
|
||||
}
|
||||
.cascade-timing {
|
||||
margin-top: 0.35rem;
|
||||
color: #6a7888;
|
||||
font-size: 11px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (max-width: 40em) {
|
||||
.cascade-bar {
|
||||
margin-top: -1rem;
|
||||
padding: 0.45rem 0.5rem 0.55rem;
|
||||
font-size: 11px;
|
||||
padding: 0.15rem 0.35rem 0.2rem;
|
||||
font-size: 10px;
|
||||
}
|
||||
.cascade-tree {
|
||||
max-width: 100%;
|
||||
}
|
||||
.cascade-timing {
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.cascade-bar .diff-plus {
|
||||
|
|
|
|||
|
|
@ -44,10 +44,10 @@
|
|||
var buildSec = row.build_seconds;
|
||||
var parts = [];
|
||||
if (tip) parts.push(esc("@" + tip));
|
||||
if (tipTime) parts.push(esc("tip " + shortTime(tipTime)));
|
||||
if (tipTime) parts.push(esc(shortTime(tipTime)));
|
||||
if (buildSec != null && buildSec !== "")
|
||||
parts.push(esc("build " + fmtBuildSec(buildSec)));
|
||||
if (builtAt) parts.push(esc("at " + shortTime(builtAt)));
|
||||
parts.push(esc(fmtBuildSec(buildSec)));
|
||||
if (builtAt) parts.push(esc(shortTime(builtAt)));
|
||||
// vs parent: +grün / −rot (omit when no parent)
|
||||
var plus = row.vs_parent_plus;
|
||||
var minus = row.vs_parent_minus;
|
||||
|
|
@ -111,6 +111,17 @@
|
|||
return parts.join("\n");
|
||||
}
|
||||
|
||||
function pinBar(timingMsg) {
|
||||
var bar = document.getElementById("cascade-bar");
|
||||
if (!bar) return;
|
||||
if (timingMsg) {
|
||||
bar.setAttribute("data-timing", timingMsg);
|
||||
bar.setAttribute("title", timingMsg);
|
||||
}
|
||||
var h = bar.offsetHeight || 0;
|
||||
document.documentElement.style.setProperty("--cascade-pad", h + "px");
|
||||
}
|
||||
|
||||
function markActive(root, edition) {
|
||||
var links = root.querySelectorAll("a[data-edition]");
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
|
|
@ -190,6 +201,7 @@
|
|||
timingEl.parentNode.removeChild(timingEl);
|
||||
}
|
||||
markActive(mount, cookieEdition());
|
||||
pinBar(t);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -199,6 +211,7 @@
|
|||
var list = (data && data.branches) || [];
|
||||
if (!list.length) {
|
||||
mount.textContent = "No branches in branch-status.json";
|
||||
pinBar();
|
||||
return;
|
||||
}
|
||||
if (soft && mount.getAttribute("data-structure") === structureKey(list)) {
|
||||
|
|
@ -251,6 +264,7 @@
|
|||
mount.innerHTML = html.join("");
|
||||
mount.setAttribute("data-structure", structureKey(list));
|
||||
markActive(mount, cookieEdition());
|
||||
pinBar(t);
|
||||
}
|
||||
|
||||
function loadStatus(soft) {
|
||||
|
|
@ -269,6 +283,7 @@
|
|||
'<a class="cascade-tree-row" href="/_cascade/use/flask" data-edition="flask" data-branch="flask"><code>flask</code></a>' +
|
||||
'<span class="tip"> (branch-status unavailable)</span>';
|
||||
markActive(mount, cookieEdition());
|
||||
pinBar();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -277,4 +292,7 @@
|
|||
setInterval(function () {
|
||||
loadStatus(true);
|
||||
}, POLL_MS);
|
||||
window.addEventListener("resize", function () {
|
||||
pinBar();
|
||||
});
|
||||
})();
|
||||
|
|
|
|||
16
sites/dossiers.ngi.hacktivism.ch/_cascade/index.html
Normal file
16
sites/dossiers.ngi.hacktivism.ch/_cascade/index.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>cascade editions</title>
|
||||
<link rel="stylesheet" href="/_cascade/bar.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="cascade-bar" aria-label="cascade builds" id="cascade-bar">
|
||||
<div class="cascade-tree" id="cascade-tree" role="tree">Loading builds…</div>
|
||||
</nav>
|
||||
<p>Stuck on an edition without a bar? Pick a build above, or <a href="/_cascade/use/flask">reset to flask</a>.</p>
|
||||
<script src="/_cascade/bar.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,20 +1,25 @@
|
|||
html {
|
||||
padding-top: var(--cascade-pad, 0px);
|
||||
}
|
||||
.cascade-bar {
|
||||
position: sticky;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
width: 100vw;
|
||||
max-width: 100vw;
|
||||
margin: -1.25rem calc(50% - 50vw) 1rem;
|
||||
padding: 0.55rem 0.75rem 0.65rem;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
padding: 0.2rem 0.5rem 0.25rem;
|
||||
background: #10141a;
|
||||
border-bottom: 1px solid #243040;
|
||||
color: #c8d0d8;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
font-size: 12px;
|
||||
line-height: 1.45;
|
||||
font-size: 11px;
|
||||
line-height: 1.25;
|
||||
}
|
||||
.cascade-tree {
|
||||
width: 100%;
|
||||
|
|
@ -31,7 +36,7 @@ a.cascade-tree-row {
|
|||
display: block;
|
||||
color: #7ec8ff;
|
||||
text-decoration: none;
|
||||
padding: 0.05rem 0.15rem;
|
||||
padding: 0;
|
||||
border-radius: 2px;
|
||||
}
|
||||
a.cascade-tree-row:hover {
|
||||
|
|
@ -52,29 +57,23 @@ a.cascade-tree-row.is-active:hover {
|
|||
}
|
||||
.cascade-bar .tip {
|
||||
color: #8a96a3;
|
||||
white-space: pre-wrap;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.cascade-bar .cascade-default {
|
||||
color: #6a9080;
|
||||
}
|
||||
.cascade-timing {
|
||||
margin-top: 0.35rem;
|
||||
color: #6a7888;
|
||||
font-size: 11px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (max-width: 40em) {
|
||||
.cascade-bar {
|
||||
margin-top: -1rem;
|
||||
padding: 0.45rem 0.5rem 0.55rem;
|
||||
font-size: 11px;
|
||||
padding: 0.15rem 0.35rem 0.2rem;
|
||||
font-size: 10px;
|
||||
}
|
||||
.cascade-tree {
|
||||
max-width: 100%;
|
||||
}
|
||||
.cascade-timing {
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.cascade-bar .diff-plus {
|
||||
|
|
|
|||
|
|
@ -44,10 +44,10 @@
|
|||
var buildSec = row.build_seconds;
|
||||
var parts = [];
|
||||
if (tip) parts.push(esc("@" + tip));
|
||||
if (tipTime) parts.push(esc("tip " + shortTime(tipTime)));
|
||||
if (tipTime) parts.push(esc(shortTime(tipTime)));
|
||||
if (buildSec != null && buildSec !== "")
|
||||
parts.push(esc("build " + fmtBuildSec(buildSec)));
|
||||
if (builtAt) parts.push(esc("at " + shortTime(builtAt)));
|
||||
parts.push(esc(fmtBuildSec(buildSec)));
|
||||
if (builtAt) parts.push(esc(shortTime(builtAt)));
|
||||
// vs parent: +grün / −rot (omit when no parent)
|
||||
var plus = row.vs_parent_plus;
|
||||
var minus = row.vs_parent_minus;
|
||||
|
|
@ -111,6 +111,17 @@
|
|||
return parts.join("\n");
|
||||
}
|
||||
|
||||
function pinBar(timingMsg) {
|
||||
var bar = document.getElementById("cascade-bar");
|
||||
if (!bar) return;
|
||||
if (timingMsg) {
|
||||
bar.setAttribute("data-timing", timingMsg);
|
||||
bar.setAttribute("title", timingMsg);
|
||||
}
|
||||
var h = bar.offsetHeight || 0;
|
||||
document.documentElement.style.setProperty("--cascade-pad", h + "px");
|
||||
}
|
||||
|
||||
function markActive(root, edition) {
|
||||
var links = root.querySelectorAll("a[data-edition]");
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
|
|
@ -190,6 +201,7 @@
|
|||
timingEl.parentNode.removeChild(timingEl);
|
||||
}
|
||||
markActive(mount, cookieEdition());
|
||||
pinBar(t);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -199,6 +211,7 @@
|
|||
var list = (data && data.branches) || [];
|
||||
if (!list.length) {
|
||||
mount.textContent = "No branches in branch-status.json";
|
||||
pinBar();
|
||||
return;
|
||||
}
|
||||
if (soft && mount.getAttribute("data-structure") === structureKey(list)) {
|
||||
|
|
@ -251,6 +264,7 @@
|
|||
mount.innerHTML = html.join("");
|
||||
mount.setAttribute("data-structure", structureKey(list));
|
||||
markActive(mount, cookieEdition());
|
||||
pinBar(t);
|
||||
}
|
||||
|
||||
function loadStatus(soft) {
|
||||
|
|
@ -269,6 +283,7 @@
|
|||
'<a class="cascade-tree-row" href="/_cascade/use/flask" data-edition="flask" data-branch="flask"><code>flask</code></a>' +
|
||||
'<span class="tip"> (branch-status unavailable)</span>';
|
||||
markActive(mount, cookieEdition());
|
||||
pinBar();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -277,4 +292,7 @@
|
|||
setInterval(function () {
|
||||
loadStatus(true);
|
||||
}, POLL_MS);
|
||||
window.addEventListener("resize", function () {
|
||||
pinBar();
|
||||
});
|
||||
})();
|
||||
|
|
|
|||
16
sites/dossiers.ngi.hacktivism.ch/cascade/_cascade/index.html
Normal file
16
sites/dossiers.ngi.hacktivism.ch/cascade/_cascade/index.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>cascade editions</title>
|
||||
<link rel="stylesheet" href="/_cascade/bar.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="cascade-bar" aria-label="cascade builds" id="cascade-bar">
|
||||
<div class="cascade-tree" id="cascade-tree" role="tree">Loading builds…</div>
|
||||
</nav>
|
||||
<p>Stuck on an edition without a bar? Pick a build above, or <a href="/_cascade/use/flask">reset to flask</a>.</p>
|
||||
<script src="/_cascade/bar.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue