From 279159c688500d550b7c2ff20fb74b05a3c19801 Mon Sep 17 00:00:00 2001 From: YozoraXCII <96386153+YozoraXCII@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:47:29 +0100 Subject: [PATCH] [23] Version check (#2142) --- VERSION | 2 +- docs/stylesheets/branch.js | 18 ++++++------------ docs/stylesheets/extra.css | 2 -- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/VERSION b/VERSION index fa266374..bc66121a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.2-build22 +2.0.2-build23 diff --git a/docs/stylesheets/branch.js b/docs/stylesheets/branch.js index 4d4e235c..0ba935b3 100644 --- a/docs/stylesheets/branch.js +++ b/docs/stylesheets/branch.js @@ -1,18 +1,15 @@ -function checkURLForBranch() { +document.addEventListener("DOMContentLoaded", () => { const currentURL = window.location.href; const ellipsisSpan = document.querySelector(".md-ellipsis"); - const mdBanner = document.querySelector(".md-banner"); // Select the banner element + const mdBanner = document.querySelector(".md-banner"); - // Default text let ellipsisText = "Kometa Wiki"; - let bannerColor = "#252525"; // Default banner color - if (currentURL.includes("en/nightly") || currentURL.includes("en/develop") { + if (currentURL.includes("en/nightly") || currentURL.includes("en/develop")) { ellipsisText = currentURL.includes("en/nightly") ? "Kometa Nightly Wiki" : "Kometa Develop Wiki"; - bannerColor = "#611423"; // Updated banner color + bannerColor = "#611423"; } - // Create ellipsisSpan if it doesn't exist if (!ellipsisSpan) { ellipsisSpan = document.createElement("span"); ellipsisSpan.classList.add("md-ellipsis"); @@ -21,10 +18,7 @@ function checkURLForBranch() { ellipsisSpan.textContent = ellipsisText; - // Update banner color if (mdBanner) { - mdBanner.style.backgroundColor = bannerColor; + mdBanner.style.setProperty('background-color', bannerColor, 'important'); } -} - -window.addEventListener("load", checkURLForBranch); +}); diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index d5abf082..e4fa670b 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -35,8 +35,6 @@ table tr td code { } .md-banner { - background-color: #252525; - color: var(--md-footer-fg-color); overflow: auto; text-align: center; }