MediaWiki:Mobile.js: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
No edit summary
No edit summary
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', bg3wikiCheckAds);
addEventListener('load', bg3wikiEnableAds);
}


function bg3wikiEnableAds() {
function bg3wikiCheckAds() {
if (window.fusetag === undefined) {
if (window.fusetag === undefined || window.innerHeight < 720) {
bg3wikiDisableAds();
bg3wikiHideAdSlots();
return;
}
if (window.innerHeight < 720) {
bg3wikiDisableAds();
return;
}
}
}
}


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

Revision as of 16:27, 9 August 2024

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

addEventListener('load', bg3wikiCheckAds);

function bg3wikiCheckAds() {
	if (window.fusetag === undefined || window.innerHeight < 720) {
		bg3wikiHideAdSlots();
	}
}

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