Created
May 6, 2017 21:08
-
-
Save dvingerh/d19aca223f5fd5213d705e4faf2f7286 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var smartQuoteBackgroundColor = "#adb1a1"; // (Default: #adb1a1) | |
var smartQuoteTextColor = "#111111"; // (Default: #111111) | |
// Quote Header Colors (Header of Quote Block) | |
var smartQuoteHeaderTextColor = "#000000"; // (Default: #000000) | |
var smartQuoteHeaderBackgroundColor = "#b1d8bf"; // (Default: #b1d8bf) | |
// Notification Text - Username Quoted (Mention text at top of page) | |
var showsmartQuoteNotification = true; // (Default: true) | |
var smartQuoteNotificationColor = "#bbb"; // (Default: #FF3B30) | |
var smartQuoteNotificationColorMentioned = "#ff0000"; // (Default: #FF3B30) | |
// Quote Header Colors - Username Quoted | |
var smartQuoteHeaderMatchBackgroundColor = "#bc3232"; // (Default: #bc3232) | |
var smartQuoteHeaderMatchTextColor = "#000000"; // (Default: #000000) | |
// Debug | |
var debug = false; | |
// ------------------------------ ON PAGE LOAD ------------------------------ | |
var username = $("#panel strong a:eq(0)").text(); | |
var usernameCount = 0; | |
// Blockquotes | |
if (debug){console.log("Number of Quotes: "+$("*").find("blockquote").length);} | |
if ($("*").find("blockquote").length > 0){ | |
// Each Block Quote Header | |
$("*").find("blockquote cite").each(function() { | |
// Username Quoted | |
if ($(this).text().includes(username)){ | |
usernameCount++; | |
if (debug){console.log("Username found.");} | |
$(this) | |
.parent().css("border", '3px groove #633453'); | |
} | |
}); | |
} | |
if (showsmartQuoteNotification){ | |
if (usernameCount < 1) | |
$(".quick_keys .float_left:eq(0)").append($("<strong>").text("No Mentions Found").css("color",smartQuoteNotificationColor)); | |
else | |
$(".quick_keys .float_left:eq(0)").append($("<strong>").text("("+usernameCount+") Mentions").css("color",smartQuoteNotificationColorMentioned)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment