From ab6fc965178a64c772cae7c6c101c1d12055cb81 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Tue, 5 Mar 2013 12:43:50 -0600 Subject: [PATCH] Add CSS for message modifiers [untested] --- www/assets/css/ytsync.css | 18 ++++++++++++++++++ www/assets/js/callbacks.js | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/www/assets/css/ytsync.css b/www/assets/css/ytsync.css index ea20921e..bc2f5822 100644 --- a/www/assets/css/ytsync.css +++ b/www/assets/css/ytsync.css @@ -73,3 +73,21 @@ .userlist_op { color: #00cc00; } + +.action { + text-decoration: italic; + color: #bbbbbb; +} + +.spoiler { + color: #000000; + background-color: #000000; +} + +.spoiler:hover { + color: #ffffff; +} + +.greentext { + color: #99ff99; +} diff --git a/www/assets/js/callbacks.js b/www/assets/js/callbacks.js index 58ec5856..07387839 100644 --- a/www/assets/js/callbacks.js +++ b/www/assets/js/callbacks.js @@ -45,7 +45,9 @@ function initCallbacks() { var div = document.createElement('div'); var span = document.createElement('span'); $(span).addClass(data.msgclass); - span.innerHTML = "<" + data.username + "> " + data.msg; + if(data.msgclass != "action") + data.msg = "<" + data.username + "> " + data.msg; + span.innerHTML = data.msg; div.appendChild(span); $('#messagebuffer')[0].appendChild(div); // Cap chatbox at most recent 100 messages