MediaWiki:Common.js: Difference between revisions
MediaWiki interface page
More actions
TheMysterys (talk | contribs) m Add all billboard ads |
TheMysterys (talk | contribs) 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. | ad.className = "citizen-footer__ad"; | ||
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);