NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name AniDB Change background color of group in filelist // @namespace dexter86 // @description none // @include http://anidb.net/perl-bin/animedb.pl* // @grant none // @version 1.0 // ==/UserScript== function changecolor(aaa) { var colors = []; //These are for example to show how to create color declaration for group. You can read about css colors on https://developer.mozilla.org/en-US/docs/Web/CSS/color_value colors[0] = {groupid: "1412", color: "#0000FF"};//DB colors[1] = {groupid: "596", color: "#79FF00"};//SD colors[2] = {groupid: "9893", color: "rgb(255,246,0)"};//Elysium colors[3] = {groupid: "7407", color: "rgb(0,255,66)"};//Coalgirls colors[4] = {groupid: "11880", color: "rgb(255,188,128)"};//Vivid colors[5] = {groupid: "11111", color: "rgb(239,170,243)"};//Hi10 colors[6] = {groupid: "8482", color: "rgb(0,132,255)"};//Doki colors[7] = {groupid: "8993", color: "rgb(255,128,164)"};//FFF colors[8] = {groupid: "374", color: "rgb(170,215,245)"};//KAA for (var i = 0; i < colors.length; i++) { var bbb = aaa.querySelectorAll('a[href="animedb.pl?show=group&gid=' + colors[i].groupid + '"]'); if (bbb != null) { for (var j = 0; j < bbb.length; j++) { bbb[j].parentNode.parentNode.parentNode.style["backgroundColor"] = colors[i].color; } } } } function extractparameter(a) { for (var i = 0; i < parameters.length; i++) { if (a == parameters[i].split("=")[0]) { return parameters[i].split("=")[1]; } } } var parameters = window.location.search.substring(1).split("&"); if (extractparameter("show") == "anime") { var callback = function(recordqueue) { changecolor(recordqueue[0].addedNodes[0]); } var observer = new MutationObserver(callback); observer.observe(document.querySelector('table#eplist'), {childList: true, subtree: true}); }