Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.js: Difference between revisions

MediaWiki interface page
m Add all billboard ads
m Switch back to class name
Line 22: Line 22:
var ad = document.createElement("img");
var ad = document.createElement("img");
ad.src = mw.util.getUrl("Special:Redirect/file/" + adName);
ad.src = mw.util.getUrl("Special:Redirect/file/" + adName);
ad.style.marginLeft = "auto";
ad.className = "citizen-footer__ad";
ad.style.height = "10rem";
footer.append(ad);
footer.append(ad);

Revision as of 00:32, 2 September 2023

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

var ads = [
	"AD_Hat.png",
	"AD_Aura.png",
	"AD_Pass_BB.png",
	"AD_Pass_HITW.png",
	"AD_Pass_PKW.png",
	"AD_Pass_SB.png",
	"AD_Pass_TGTTOS.png",
	"AD_Boosts_1.png",
	"AD_Boosts_2.png",
	"AD_Cactus_Ranger.png",
	"AD_Candlewick.png",
	"AD_Construction_Chaos.png",
	"AD_Looter_Extraordinaire.png",
	"AD_Masco_Head.png"
];

var adName = ads[Math.floor(Math.random() * ads.length)];
var footer = document.getElementsByClassName('citizen-footer__content')[0];
var ad = document.createElement("img");
ad.src = mw.util.getUrl("Special:Redirect/file/" + adName);
ad.className = "citizen-footer__ad";
footer.append(ad);