MediaWiki:Vector.js: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 22: Line 22:
if (headerAd) {
if (headerAd) {
var p = headerAd.querySelector("p");
var p = headerAd.querySelector("p");
p.innerText = "Ad block user?\nNo problem.\n\n"
p.innerText = "Ad block user?\nNo problem.\n\n" +
+ "You can log in to hide this placeholder.";
"You can log in to hide this placeholder.";
}
}
}
}

Revision as of 18:29, 9 August 2024

/* All JavaScript here will be loaded for users of the Vector skin */

if (document.readyState === 'complete') {
	bg3wikiCheckAdBlock();
} else {
	window.addEventListener('load', bg3wikiCheckAdBlock);
}

function bg3wikiCheckAdBlock() {
	if (window.fusetag === undefined) {
		bg3wikiAdBlockProbable();
	}
}

function bg3wikiAdBlockProbable() {
	var sidebarAd = document.getElementById("bg3wiki-sidebar-ad");
	if (sidebarAd) {
		sidebarAd.parentNode.removeChild(sidebarAd);
	}
	
	var headerAd = document.getElementById("bg3wiki-header-ad");
	if (headerAd) {
		var p = headerAd.querySelector("p");
		p.innerText = "Ad block user?\nNo problem.\n\n" +
			"You can log in to hide this placeholder.";
	}
}