Jump to content

MediaWiki:Common.js

From Megabonk Wiki
Revision as of 12:31, 24 November 2025 by MegaAdmin (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.
// ===== TOP BANNER (Vector 2022 - megabonk_top_banner) =====
mw.loader.using(['mediawiki.util'], function () {
    $(function () {

        if (!window.nitroAds || !window.nitroAds.createAd) {
            return;
        }

        var $title = $('#firstHeading');
        if (!$title.length) {
            return;
        }

        if ($('#megabonk_top_banner').length) {
            return;
        }

        var adId = 'megabonk_top_banner';
        var $adDiv = $('<div>', {
            id: adId,
            'class': 'nitro-top-banner'
        }).css({
            'margin': '12px 0 24px 0',
            'text-align': 'center'
        });

        $title.after($adDiv);

        window.nitroAds.createAd(adId, {
            sizes: [
                [728, 90],
                [970, 90],
                [970, 250],
                [320, 100],
                [320, 50]
            ],
            geoDeny: ['RU']
        });
    });
});