|
|
|
@ -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);
|
|
|
|
|
});
|
|
|
|
|