MediaWiki:Common.js: Difference between revisions

From XMethod Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 16: Line 16:
     });
     });
});
});
/* Load SocialFeed gadget on the Social page */
 
if (mw.config.get("wgPageName") === "User:Docmoates/Social") {
/* Load SocialFeed on the Social page */
    mw.loader.load("/index.php?title=MediaWiki:Gadget-SocialFeed.css&action=raw&ctype=text/css", "text/css");
mw.hook("wikipage.content").add(function() {
    mw.loader.load("/index.php?title=MediaWiki:Gadget-SocialFeed.js&action=raw&ctype=text/javascript");
    if (mw.config.get("wgPageName") === "User:Docmoates/Social") {
}
        mw.loader.load("/index.php?title=MediaWiki:Gadget-SocialFeed.css&action=raw&ctype=text/css", "text/css");
        $.getScript("/index.php?title=MediaWiki:Gadget-SocialFeed.js&action=raw&ctype=text/javascript");
    }
});

Revision as of 11:51, 3 February 2026

/* Make Admin Tools sidebar header clickable - links to Newsletter Dashboard */
$(function() {
    // Find the Admin Tools section header
    var sections = document.querySelectorAll(".vector-menu-heading-label");
    sections.forEach(function(header) {
        if (header.textContent.trim() === "Admin Tools") {
            var link = document.createElement("a");
            link.href = "/Special:NewsletterDashboard";
            link.style.color = "inherit";
            link.style.textDecoration = "none";
            link.style.cursor = "pointer";
            link.textContent = header.textContent;
            header.textContent = "";
            header.appendChild(link);
        }
    });
});

/* Load SocialFeed on the Social page */
mw.hook("wikipage.content").add(function() {
    if (mw.config.get("wgPageName") === "User:Docmoates/Social") {
        mw.loader.load("/index.php?title=MediaWiki:Gadget-SocialFeed.css&action=raw&ctype=text/css", "text/css");
        $.getScript("/index.php?title=MediaWiki:Gadget-SocialFeed.js&action=raw&ctype=text/javascript");
    }
});