// ==UserScript== // @name AO3: highlight author fandoms // @namespace https://greasyfork.org/en/users/757649-certifieddiplodocus // @version 1.1 // @description Highlight favourite fandoms in user page // @author CertifiedDiplodocus // @require http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js // @match http*://archiveofourown.org/users/* // @exclude http*://archiveofourown.org/users/*/works* // @exclude http*://archiveofourown.org/users/*/pseuds/*/works* // @grant none // @downloadURL none // ==/UserScript== //cannibalised from fangirlishness's ao3 Highlight tags V1, with thanks /* eslint-env jquery */ // allows jQuery /* jshint esversion:6 */ // allows "let" (function($) { 'use strict'; // select the list of fandoms $('.fandom.listbox.group li').each(function() { // check that config extension is loaded, throw error if not if (!window.fandomHighlighterConfig) {throw new Error("AO3 Fandom Highlighter CONFIG not loaded")}; // HALT! // pass variables from config script let config = window.fandomHighlighterConfig; let fandomsToHighlight = config.fandomsToHighlight, fandomsInColour = config.fandomsInColour, highlightIsOn = config.highlightIsOn, boldIsOn = config.boldIsOn, customHighlightIsOn = config.customHighlightIsOn, highlightDefaultCol = config.highlightDefaultCol; // get fandoms let $list = $(this); $list.find('a').each(function() { let $fandom = $(this); let text = $fandom.text(); // let $fandomLine = $(this).closest("li"); //whole list item (i.e. to also highlight the number of fics) // iterate through fandoms, check against list, then highlight and/or bold for (var i = 0; i