MediaWiki:Mobile.js: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* All JavaScript here will be loaded for users of the mobile site */
/* All JavaScript here will be loaded for users of the mobile site */


if (mw.config.get("wgUserId") == null) {
/*
addEventListener('load', bg3wikiEnableAds);
if (document.readyState === 'complete') {
bg3wikiCheckAdBlock();
} else {
window.addEventListener('load', bg3wikiCheckAdBlock);
}
}


function bg3wikiEnableAds() {
function bg3wikiCheckAdBlock() {
console.log("Enabling mobile ads");
var adsEnabled = document.body.classList.contains("mw-ads-enabled");
if (window.fusetag === undefined) {
if (adsEnabled && window.fusetag === undefined) {
console.log("Fuse not found");
bg3wikiHideAdSlots();
bg3wikiDisableAds();
return;
}
}
//if (window.innerHeight >= 720) {
// console.log("Registering footer ad");
// fusetag.registerZone("bg3wiki-footer-ad-fuse");
//}
}
}


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

Latest revision as of 20:13, 14 August 2024

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

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

function bg3wikiCheckAdBlock() {
	var adsEnabled = document.body.classList.contains("mw-ads-enabled");
	if (adsEnabled && window.fusetag === undefined) {
		bg3wikiHideAdSlots();
	}
}

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