Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dvingerh/d19aca223f5fd5213d705e4faf2f7286 to your computer and use it in GitHub Desktop.
Save dvingerh/d19aca223f5fd5213d705e4faf2f7286 to your computer and use it in GitHub Desktop.
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