User:Ruxax/global.js

//from Flenagan isCSSClass = function(e, c) { if (typeof e == "string") e = document.getElementById(e); var classes = e.className; if (!classes) return false; if (classes == c) return true; return e.className.search("\\b" + c + "\\b") != -1; };

var preferred = "manga"; var unpreferred = (preferred=="manga") ? "anime" : "manga";

function initialChoiceBetweenMangaAndAnime { var divs = document.getElementsByTagName("div"); for(var i=0; i<divs.length; i++) { var el = divs[i]; if(isCSSClass(el,preferred)) {el.style.display="block";} if(isCSSClass(el,unpreferred)) {el.style.display="none";} } }

addOnloadHook(initialChoiceBetweenMangaAndAnime);