User:Penguin-Pal/common.js

/* force-save oasis/hydra skins, because for some reason fandom changes the layout more times an hour than an embarrassed chameleon */ $(function {	// if skin is fandom desktop (regex just in case they gonna use a different one)	if (/fandom/i.test(mw.config.get("skin"))) {		new mw.Api.get({ action: "query", meta: "tokens" }).done(function(a) { console.log("[skin fixer :: query token :: done]", a); var token = a.query.tokens.csrftoken, newSkin = mw.config.get("isGamepedia") ? "hydra" : "oasis"; new mw.Api.post({				action: "options",					change: "skin=" + newSkin,					token: token			}).done(function(a) {				console.log("[skin fixer :: save preferences :: done]", a);			}); });	} });