// ==UserScript== // @name SB/SV/QQ Thread-Starter Highlighter // @namespace http://userscripts.org:8080/users/196962 // @description This is a userscript which highlights subsequent posts by the thread-starter in the SpaceBattles, Sufficient Velocity and Questionable Questing forums. It also displays a short information at the top of each page if a post by the thread-starter can be found on the current page. // @author ElDani // @contributor ApatheticImagination // @version 1.1 // @license Creative Commons BY-NC-SA // @include http*://forums.sufficientvelocity.com/threads/* // @include http*://forums.spacebattles.com/threads/* // @include http*://forum.questionablequesting.com/threads/* // @encoding utf-8 // @grant none // @history 1.0.6 added HTTPS support for SB and full support for Questionable Questing forum (ApatheticImagination) // @history 1.0.5 added HTTPS support for SV (thanks NuitTombee) // @history 1.0.4 fixed small bug, where wrong posts could be highlighted due to error in partial user name matching // @history 1.0.3 added support for SV FlexileSpace style // @history 1.0.2 fixed bug, where posts by staff on SB would not be highlighted // @history 1.0.1 added option to choose highlight color by active forum style // @history 1.0 initial public version // @downloadURL none // ==/UserScript== function LocalMain () { if (window.top != window.self) { //don't run on iFrames return; } var site = -1; if (document.URL.indexOf("spacebattles.com") > -1) site=0; if (document.URL.indexOf("sufficientvelocity.com") > -1) site=1; if (document.URL.indexOf("questionablequesting.com") > -1) site=2; if (site == -1) return; var style; var rgxp_style = /(.*?)<\/a>/i var match = rgxp_starter.exec(document.documentElement.outerHTML); if (match != null) { starter = match[2]; } else { return; } var messageList = document.getElementsByClassName("messageList"); var messages = messageList[0].getElementsByTagName("LI"); var nr_messages = messages.length; var username; var starter_posts = 0; for(var i=0; i'+starter+'<') > -1)) { messages[i].style.backgroundColor=highlightColor[site][style]; messages[i].getElementsByClassName("primaryContent")[0].style.backgroundColor=highlightColor[site][style]; if(messages[i].getElementsByClassName("secondaryContent").length>0) { messages[i].getElementsByClassName("secondaryContent")[0].style.backgroundColor=highlightColor[site][style]; } starter_posts++; } } var add_html = document.getElementById("pageDescription").innerHTML; if(starter_posts>0) { add_html = add_html+" "+starter_posts+" post(s) by thread starter on this page!"; } else { add_html = add_html+" No posts by thread starter on this page."; } document.getElementById("pageDescription").innerHTML = add_html; } window.addEventListener ("load", LocalMain, false);