(function () { var GAP = 8; var tracked = []; function layer(el) { return el && typeof el.showPopover === "function"; } function openLayer(el) { if (!el) { return; } if (layer(el)) { if (!el.hasAttribute("popover")) { el.setAttribute("popover", "manual"); } if (!el.matches(":popover-open")) { el.showPopover(); } return; } if (el.parentNode !== document.body) { el._home = el.parentNode; document.body.appendChild(el); } el.hidden = false; } function closeLayer(el) { if (!el) { return; } if (layer(el) && el.hasAttribute("popover")) { if (el.matches(":popover-open")) { el.hidePopover(); } return; } el.hidden = true; } function isOpen(el) { if (!el) { return false; } if (el.hasAttribute("popover")) { return el.matches(":popover-open"); } return !el.hidden; } function place(el, anchor, mode) { var rect = anchor.getBoundingClientRect(); el.style.left = "0px"; el.style.top = "0px"; var w = el.offsetWidth; var h = el.offsetHeight; var vw = document.documentElement.clientWidth; var vh = document.documentElement.clientHeight; var left; var top; if (mode === "above-center") { left = rect.left + (rect.width - w) / 2; top = rect.top - GAP - h; if (top < GAP) { top = rect.bottom + GAP; } } else if (mode === "below-end") { left = rect.right - w; top = rect.bottom + GAP; if (top + h > vh - GAP && rect.top - GAP - h >= GAP) { top = rect.top - GAP - h; } } else { left = rect.left; top = rect.bottom + GAP; if (top + h > vh - GAP && rect.top - GAP - h >= GAP) { top = rect.top - GAP - h; } } if (left + w > vw - GAP) { left = vw - GAP - w; } if (left < GAP) { left = GAP; } if (top + h > vh - GAP) { top = Math.max(GAP, vh - GAP - h); } if (top < GAP) { top = GAP; } el.style.left = Math.round(left) + "px"; el.style.top = Math.round(top) + "px"; } function track(el, anchor, mode) { tracked = tracked.filter(function (item) { return item.el !== el; }); tracked.push({ el: el, anchor: anchor, mode: mode }); place(el, anchor, mode); } function untrack(el) { tracked = tracked.filter(function (item) { return item.el !== el; }); } function reposition() { tracked.forEach(function (item) { if (isOpen(item.el)) { place(item.el, item.anchor, item.mode); } }); } window.addEventListener("scroll", reposition, true); window.addEventListener("resize", reposition); var tip = document.createElement("div"); tip.className = "float-tip"; tip.setAttribute("role", "tooltip"); tip.setAttribute("popover", "manual"); document.body.appendChild(tip); var tipAnchor = null; function restoreTitle(el) { if (el && el.hasAttribute("data-native-title")) { el.setAttribute("title", el.getAttribute("data-native-title")); el.removeAttribute("data-native-title"); } } function hideTip() { restoreTitle(tipAnchor); tipAnchor = null; closeLayer(tip); untrack(tip); } function showTip(el) { if (!el || el.closest(".stage-pop, .float-tip")) { return; } var stage = el.closest(".stage"); if (stage && stage.classList.contains("open") && el.matches(".stage-dot")) { return; } var text = el.getAttribute("data-tip") || ""; if (!text && (el.hasAttribute("title") || el.hasAttribute("data-native-title"))) { text = el.getAttribute("data-native-title") || el.getAttribute("title") || ""; if (el.hasAttribute("title")) { el.setAttribute("data-native-title", text); el.removeAttribute("title"); } } if (!text) { return; } if (tipAnchor && tipAnchor !== el) { restoreTitle(tipAnchor); } tipAnchor = el; tip.textContent = text; tip.classList.toggle("heat", el.classList.contains("sq")); openLayer(tip); track(tip, el, "above-center"); } document.addEventListener("pointerover", function (ev) { var el = ev.target.closest("[data-tip], .sq[title], .sq[data-native-title]"); if (el) { showTip(el); } }); document.addEventListener("pointerout", function (ev) { if (!tipAnchor) { return; } if (ev.target === tipAnchor || tipAnchor.contains(ev.target)) { if (!tipAnchor.contains(ev.relatedTarget)) { hideTip(); } } }); document.addEventListener("focusin", function (ev) { var el = ev.target.closest("[data-tip], .sq[title], .sq[data-native-title]"); if (el) { showTip(el); } }); document.addEventListener("focusout", function (ev) { if (tipAnchor && (ev.target === tipAnchor || tipAnchor.contains(ev.target))) { hideTip(); } }); function popOf(stage) { return stage.querySelector(".stage-pop") || stage._pop || null; } function closeStages() { document.querySelectorAll(".stage.open").forEach(function (stage) { stage.classList.remove("open"); var pop = popOf(stage); closeLayer(pop); untrack(pop); }); } document.addEventListener("click", function (ev) { var btn = ev.target.closest("button.stage-dot[data-tip]"); if (btn) { ev.stopPropagation(); var stage = btn.parentElement; var pop = popOf(stage); if (pop) { stage._pop = pop; } var was = stage.classList.contains("open"); hideTip(); closeStages(); if (!was && pop) { stage.classList.add("open"); openLayer(pop); track(pop, btn, "below-start"); } return; } if (ev.target.closest(".stage-pop")) { return; } closeStages(); }); document.addEventListener("keydown", function (ev) { if (ev.key === "Escape") { hideTip(); closeStages(); } }); document.querySelectorAll("details").forEach(function (det) { var panel = det.querySelector(":scope > .menu-panel, :scope > form"); if (!panel) { return; } if (!panel.classList.contains("menu-panel") && !det.classList.contains("showid")) { return; } panel.setAttribute("popover", "manual"); det.addEventListener("toggle", function () { var summary = det.querySelector("summary"); if (det.open && summary) { // A popover nested in
stays display:none in the top layer // until it leaves the details element. Park the panel on body first. if (panel.classList.contains("menu-panel") && panel.parentNode !== document.body) { panel._home = panel.parentNode; document.body.appendChild(panel); } openLayer(panel); track(panel, summary, "below-end"); } else { closeLayer(panel); untrack(panel); } }); }); })(); (function () { function copyNow(value) { var area = document.createElement("textarea"); area.value = value; area.setAttribute("readonly", ""); area.style.position = "fixed"; area.style.top = "0"; area.style.left = "0"; area.style.opacity = "0"; document.body.appendChild(area); area.focus(); area.select(); var ok = false; try { ok = document.execCommand("copy"); } catch (e) { ok = false; } document.body.removeChild(area); return ok; } document.querySelectorAll("[data-copy]").forEach(function (btn) { btn.addEventListener("click", function () { var value = btn.getAttribute("data-copy") || ""; var shown = false; function mark() { if (shown) { return; } shown = true; var old = btn.textContent; btn.textContent = document.body.getAttribute("data-copied") || "Copied"; setTimeout(function () { btn.textContent = old; }, 2500); } if (copyNow(value)) { mark(); } if (navigator.clipboard && window.isSecureContext) { navigator.clipboard.writeText(value).then(mark).catch(function () {}); } }); }); })(); // Obsolete-statussen krijgen hun uitleg als tooltip (data-tip) en // aria-label, ook als pipeline.js de klasse live wijzigt. (function () { var tip = document.body.getAttribute("data-obsolete-tip") || "canceled because a newer pipeline started for the same ref"; function tag(root) { var list = (root || document).querySelectorAll(".status.obsolete"); Array.prototype.forEach.call(list, function (el) { if (el.getAttribute("data-tip") !== tip) { el.setAttribute("data-tip", tip); var label = (el.textContent || "").trim(); el.setAttribute("aria-label", label ? label + ": " + tip : tip); } }); } function untag(el) { if (el.classList && el.classList.contains("status") && !el.classList.contains("obsolete") && el.getAttribute("data-tip") === tip) { el.removeAttribute("data-tip"); el.removeAttribute("aria-label"); } } tag(); new MutationObserver(function (muts) { muts.forEach(function (m) { if (m.type === "attributes") { untag(m.target); } }); tag(); }).observe(document.body, { subtree: true, childList: true, attributes: true, attributeFilter: ["class"] }); })();