From 2622aaac41dda7d156aa9c4fbec157d349e9d3dc Mon Sep 17 00:00:00 2001 From: calzoneman Date: Sat, 11 May 2013 15:12:51 -0400 Subject: [PATCH] Implement #107 --- www/assets/css/darkstrap.css | 8 ++++++++ www/assets/css/ytsync.css | 4 ++++ www/assets/js/functions.js | 16 +++++++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/www/assets/css/darkstrap.css b/www/assets/css/darkstrap.css index fdd581d7..bd8b308c 100644 --- a/www/assets/css/darkstrap.css +++ b/www/assets/css/darkstrap.css @@ -1005,3 +1005,11 @@ li.alert-error.alert-info { background-color: #2f2f2f; border-color: #000000; } + +.nick-hover { + background-color: #660066; +} + +.userlist_owner { + color: #ff9900; +} diff --git a/www/assets/css/ytsync.css b/www/assets/css/ytsync.css index a5ccece2..b484d6a4 100644 --- a/www/assets/css/ytsync.css +++ b/www/assets/css/ytsync.css @@ -185,6 +185,10 @@ html, body { background-color: #ddffdd; } +.nick-hover { + background-color: #ffff99; +} + .drink { margin: 10px 10px; padding: 10px 0px; diff --git a/www/assets/js/functions.js b/www/assets/js/functions.js index 0a7c33f1..d54bc18b 100644 --- a/www/assets/js/functions.js +++ b/www/assets/js/functions.js @@ -151,7 +151,21 @@ function addChatMessage(data) { return; } var div = formatChatMessage(data); + div.data("sender", data.username); div.appendTo($("#messagebuffer")); + div.mouseover(function() { + $("#messagebuffer").children().each(function() { + var name = $(this).data("sender"); + if(name == data.username) { + $(this).addClass("nick-hover"); + } + }); + }); + div.mouseleave(function() { + $("#messagebuffer").children().each(function() { + $(this).removeClass("nick-hover"); + }); + }); // Cap chatbox at most recent 100 messages if($("#messagebuffer").children().length > 100) { $($("#messagebuffer").children()[0]).remove(); @@ -198,7 +212,7 @@ function formatChatMessage(data) { if(!skip) { name.appendTo(div); } - $("").text(data.username + ": ").appendTo(name); + $("").addClass("username").text(data.username + ": ").appendTo(name); var message = $("").appendTo(div); message[0].innerHTML = data.msg; if(data.modflair) {