MCPcopy Create free account
hub / github.com/Cosmian/kms / initPage

Function initPage

documentation/docs/javascripts/log_filter.js:344–370  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

342// ── Main ──────────────────────────────────────────────────────────────────
343
344function initPage() {
345 if (!window.location.pathname.includes(LOG_REFERENCE_PATH)) return;
346
347 // Support both Material MkDocs (.md-content) and mdBook (#content)
348 const content = document.querySelector(".md-content, #content");
349 if (!content) return;
350
351 // 1. Version banner
352 injectVersionBanner(content);
353
354 // 2. Color inline level badges everywhere on the page
355 colorLevelBadges(content);
356
357 // 3. Inject GitHub links into File column cells
358 linkifyFileCells(content);
359
360 // 4. Insert one control block per domain section
361 getDomainSections(content).forEach(({ heading, tables }) => {
362 if (!tables.length) return;
363 if (heading.dataset.logFilter === "true") return;
364 heading.dataset.logFilter = "true";
365
366 const controls = buildDomainControls(tables);
367 // Insert after the h2 element
368 heading.insertAdjacentElement("afterend", controls);
369 });
370}
371
372// Material instant navigation hook
373if (typeof document$ !== "undefined") {

Callers

nothing calls this directly

Calls 7

injectVersionBannerFunction · 0.85
colorLevelBadgesFunction · 0.85
linkifyFileCellsFunction · 0.85
getDomainSectionsFunction · 0.85
buildDomainControlsFunction · 0.85
includesMethod · 0.45
forEachMethod · 0.45

Tested by

no test coverage detected