MediaWiki:Common.js: Difference between revisions
MediaWiki interface page
More actions
TheMysterys (talk | contribs) m Testing with style instead of class |
TheMysterys (talk | contribs) m Randomizer test |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
const ads = [ | |||
"AD_hat.png", | |||
ad.src = mw.util.getUrl( | "AD_aura.png", | ||
] | |||
const adName = ads[Math.floor(Math.random() * array.length)]; | |||
const footer = document.getElementsByClassName('citizen-footer__content')[0]; | |||
const ad = document.createElement("img"); | |||
ad.src = mw.util.getUrl(`Special:Redirect/file/${adName}`); | |||
ad.style.marginLeft = "auto"; | ad.style.marginLeft = "auto"; | ||
ad.style.height = "10rem"; | ad.style.height = "10rem"; | ||
footer.append(ad); | footer.append(ad); |
Revision as of 09:14, 1 September 2023
/* Any JavaScript here will be loaded for all users on every page load. */ const ads = [ "AD_hat.png", "AD_aura.png", ] const adName = ads[Math.floor(Math.random() * array.length)]; const footer = document.getElementsByClassName('citizen-footer__content')[0]; const ad = document.createElement("img"); ad.src = mw.util.getUrl(`Special:Redirect/file/${adName}`); ad.style.marginLeft = "auto"; ad.style.height = "10rem"; footer.append(ad);