Skip to content

Instantly share code, notes, and snippets.

@cheeplusplus
Created November 25, 2011 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cheeplusplus/1393325 to your computer and use it in GitHub Desktop.
Save cheeplusplus/1393325 to your computer and use it in GitHub Desktop.
FA Journal Highlighter
// ==UserScript==
// @name FA Journal Highlighter
// @namespace http://projects.neocodenetworks.com/gm/
// @include http://www.furaffinity.net/msg/others/
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
// ==/UserScript==
function highlightLine(row, color) {
$(row).css("background-color", color);
}
$(document).ready(function() {
var hTitles = {"MFF": "blue", "commission": "lightblue", "stream": "pink"};
var hUsers = ["midori8", "chocolatekitsune", "cappuccino", "cappucola"];
var w = unsafeWindow;
$("form#messages-form ul.message-stream li").each(function(i, row) {
var title = $("a[href^='/journal/']", row).text().toLowerCase();
var user = $("a[href^='/user/']", row).text().toLowerCase();
// Titles
$.each(hTitles, function(item, color) {
if (title.indexOf(item.toLowerCase()) > -1) {
highlightLine(row, color);
}
});
// Users
$.each(hUsers, function(i, item) {
if (user.indexOf(item.toLowerCase()) > -1) {
highlightLine(row, "orange");
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment