MediaWiki:Gadget-LogoVariants.js

//

(function {	const namespaceId = mw.config.get("wgNamespaceNumber");	if (namespaceId != 0) {		return;	}	const pageId = mw.config.get('wgArticleId');	new mw.Api.get({ action: 'cargoquery', format: 'json', limit: '1', tables: 'Appearances', fields: 'main', where: "_pageId = '"+ pageId +"'" }).done(function(data) { const row = data.cargoquery[0]; if (!row) { return; }		const mainAppearances = row.title.main.split(/\s*,\s*/); if (mainAppearances.length == 1) { const game = mainAppearances[0].toLowerCase; $("body").addClass("game-page--"+game); }	}); });