Created
November 25, 2011 11:31
-
-
Save cheeplusplus/1393325 to your computer and use it in GitHub Desktop.
FA Journal Highlighter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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