MediaWiki:Mobile.js: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
if (window.fusetag === undefined) {
if (window.fusetag === undefined) {
console.log("Fuse not found");
console.log("Fuse not found");
bg3wikiDisableAds();
return;
return;
}
}
Line 15: Line 16:
// fusetag.registerZone("bg3wiki-footer-ad-fuse");
// fusetag.registerZone("bg3wiki-footer-ad-fuse");
//}
//}
}
function bg3wikiDisableAds() {
document.body.classList.replace("mw-ads-enabled", "mw-ads-disabled");
}
}

Revision as of 15:51, 9 August 2024

/* All JavaScript here will be loaded for users of the mobile site */

if (mw.config.get("wgUserId") == null) {
	addEventListener('load', bg3wikiEnableAds);
}

function bg3wikiEnableAds() {
	console.log("Enabling mobile ads");
	if (window.fusetag === undefined) {
		console.log("Fuse not found");
		bg3wikiDisableAds();
		return;
	}
	//if (window.innerHeight >= 720) {
	//	console.log("Registering footer ad");
	//	fusetag.registerZone("bg3wiki-footer-ad-fuse");
	//}
}

function bg3wikiDisableAds() {
	document.body.classList.replace("mw-ads-enabled", "mw-ads-disabled");
}