MediaWiki:Common.js: Difference between revisions

From Zyrkthraan Chronicles Wiki
Jump to navigationJump to search
(Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: document.addEventListener("DOMContentLoaded", function() { document.querySelectorAll(".categorytree li a").forEach(function(link) { let text = link.textContent; if (text.includes(":")) { link.textContent = text.split(":")[1]; // Removes the namespace before the colon } }); });")
 
No edit summary
 
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener("DOMContentLoaded", function() {
    document.querySelectorAll(".categorytree li a").forEach(function(link) {
        let text = link.textContent;
        if (text.includes(":")) {
            link.textContent = text.split(":")[1]; // Removes the namespace before the colon
        }
    });
});

Latest revision as of 05:39, 31 October 2024

/* Any JavaScript here will be loaded for all users on every page load. */