Jump to content

MediaWiki:Common.js

From Once Human Guide
Revision as of 20:03, 8 April 2026 by Bones (talk | contribs)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
mw.loader.using('mediawiki.util').then(function () {
    $(function () {

        // 🔹 Replace "Discussion" with Discord
        const talkLink = document.querySelector('#ca-talk a');

        if (talkLink) {
            talkLink.textContent = 'Discord';
            talkLink.href = 'https://discord.gg/FZtkXeGeUA';
            talkLink.target = '_blank';
            talkLink.rel = 'noopener noreferrer';

            talkLink.addEventListener('click', function (e) {
                e.preventDefault();
                window.open('https://discord.gg/FZtkXeGeUA', '_blank');
            });
        }

        // 🔥 ADD NEW TAB → Road Map
        mw.util.addPortletLink(
            'p-views', // THIS puts it in the top tab bar
            'https://ohwikiguide.com/index.php/Road_Map',
            'Road Map',
            'ca-roadmap',
            'View the Road Map'
        );

    });
});