MediaWiki:Vector.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(34 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
/* All JavaScript here will be loaded for users of the Vector skin */ | /* All JavaScript here will be loaded for users of the Vector skin */ | ||
if (document.readyState === 'complete') { | |||
bg3wikiVectorJsMain(); | |||
} else { | |||
window.addEventListener('load', bg3wikiVectorJsMain); | |||
} | |||
function bg3wikiVectorJsMain() { | |||
var reportAdsLink = document.querySelector('#n-Please-report-bad-ads a'); | |||
if (reportAdsLink) { | |||
reportAdsLink.setAttribute("target", "_blank"); | |||
} | |||
} | |||
/* | /* | ||
function bg3wikiCheckAdBlock() { | |||
var adsEnabled = document.body.classList.contains("mw-ads-enabled"); | |||
if (adsEnabled && !window.fusetag && !window.ramp) { | |||
bg3wikiAdBlockProbable(); | |||
} | |||
if ( | |||
} | } | ||
function | function bg3wikiAdBlockProbable() { | ||
bg3wikiCleanupHeaderAd(); | |||
bg3wikiCleanupSidebarAd(); | |||
} | } | ||
function | function bg3wikiCleanupHeaderAd() { | ||
var | var headerAd = document.getElementById("bg3wiki-header-ad"); | ||
if ( | if (!headerAd) { | ||
return; | return; | ||
} | } | ||
var p = headerAd.querySelector("p"); | |||
p.style.fontSize = '1em'; | |||
p.innerText = "Ad block user? No problem.\n" + | |||
var | "You can log in to clean up the UI of placeholders like this."; | ||
} | } | ||
function | function bg3wikiCleanupSidebarAd() { | ||
var | var headerAd = document.getElementById("bg3wiki-sidebar-ad"); | ||
if ( | if (!headerAd) { | ||
return; | return; | ||
} | } | ||
var p = headerAd.querySelector("p"); | |||
p.style.fontSize = '0.7em'; | |||
p.innerText = "Ad block user? No problem.\n" + | |||
"You can log in to clean up the UI of placeholders like this."; | |||
var | |||
} | } | ||
*/ |
Latest revision as of 20:27, 18 September 2024
/* All JavaScript here will be loaded for users of the Vector skin */
if (document.readyState === 'complete') {
bg3wikiVectorJsMain();
} else {
window.addEventListener('load', bg3wikiVectorJsMain);
}
function bg3wikiVectorJsMain() {
var reportAdsLink = document.querySelector('#n-Please-report-bad-ads a');
if (reportAdsLink) {
reportAdsLink.setAttribute("target", "_blank");
}
}
/*
function bg3wikiCheckAdBlock() {
var adsEnabled = document.body.classList.contains("mw-ads-enabled");
if (adsEnabled && !window.fusetag && !window.ramp) {
bg3wikiAdBlockProbable();
}
}
function bg3wikiAdBlockProbable() {
bg3wikiCleanupHeaderAd();
bg3wikiCleanupSidebarAd();
}
function bg3wikiCleanupHeaderAd() {
var headerAd = document.getElementById("bg3wiki-header-ad");
if (!headerAd) {
return;
}
var p = headerAd.querySelector("p");
p.style.fontSize = '1em';
p.innerText = "Ad block user? No problem.\n" +
"You can log in to clean up the UI of placeholders like this.";
}
function bg3wikiCleanupSidebarAd() {
var headerAd = document.getElementById("bg3wiki-sidebar-ad");
if (!headerAd) {
return;
}
var p = headerAd.querySelector("p");
p.style.fontSize = '0.7em';
p.innerText = "Ad block user? No problem.\n" +
"You can log in to clean up the UI of placeholders like this.";
}
*/