MediaWiki:Common.js: Difference between revisions

From stencil.wiki
(Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: mw.loader.using(["mediawiki.util"], function () { $(document).ready(function () { $("h2").each(function () { if ($(this).text().trim() === "Steps") { $(this).css("color", "blue"); } }); }); });")
 
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. */
mw.loader.using(["mediawiki.util"], function () {
document.addEventListener("DOMContentLoaded", function () {
     $(document).ready(function () {
     document.querySelectorAll("h2").forEach(function (header) {
        $("h2").each(function () {
        if (header.textContent.trim() === "Steps") {
            if ($(this).text().trim() === "Steps") {
            header.style.color = "blue";
                $(this).css("color", "blue");
         }
            }
         });
     });
     });
});
});

Revision as of 01:26, 14 January 2025

/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener("DOMContentLoaded", function () {
    document.querySelectorAll("h2").forEach(function (header) {
        if (header.textContent.trim() === "Steps") {
            header.style.color = "blue";
        }
    });
});