|
|
@ -1,18 +1,15 @@
|
|
|
|
function checkURLForBranch() {
|
|
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
|
|
const currentURL = window.location.href;
|
|
|
|
const currentURL = window.location.href;
|
|
|
|
const ellipsisSpan = document.querySelector(".md-ellipsis");
|
|
|
|
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 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";
|
|
|
|
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) {
|
|
|
|
if (!ellipsisSpan) {
|
|
|
|
ellipsisSpan = document.createElement("span");
|
|
|
|
ellipsisSpan = document.createElement("span");
|
|
|
|
ellipsisSpan.classList.add("md-ellipsis");
|
|
|
|
ellipsisSpan.classList.add("md-ellipsis");
|
|
|
@ -21,10 +18,7 @@ function checkURLForBranch() {
|
|
|
|
|
|
|
|
|
|
|
|
ellipsisSpan.textContent = ellipsisText;
|
|
|
|
ellipsisSpan.textContent = ellipsisText;
|
|
|
|
|
|
|
|
|
|
|
|
// Update banner color
|
|
|
|
|
|
|
|
if (mdBanner) {
|
|
|
|
if (mdBanner) {
|
|
|
|
mdBanner.style.backgroundColor = bannerColor;
|
|
|
|
mdBanner.style.setProperty('background-color', bannerColor, 'important');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
window.addEventListener("load", checkURLForBranch);
|
|
|
|
|
|
|
|