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: 'Categories', fields: 'canon', where: "_pageId = '"+ pageId +"'" }).done(function(data) { const row = data.cargoquery[0]; if (!row) { return; }		const canonAppearances = row.title.canon.split(/\s*,\s*/); if (canonAppearances.length == 1) { const game = canonAppearances[0].toLowerCase; $("body").addClass("game-page--"+game); }	}); });