From 3a89c414676b9fccfba7086059eeff1fc58c5938 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sat, 4 Aug 2012 11:23:55 -0700 Subject: [PATCH] Classify different kinds of messages --- webclient/rc.html | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/webclient/rc.html b/webclient/rc.html index 840851c..e23286e 100644 --- a/webclient/rc.html +++ b/webclient/rc.html @@ -156,7 +156,22 @@ timestamp.appendChild(document.createTextNode(timestamp_text)); message.UI.appendChild(timestamp); - message.UI.appendChild(document.createTextNode(message.Text)); + // Classify different message types + var text_span = document.createElement("span"); + var type; + if (/^\*\*\* /.test(message.Text)) { + type = "status"; + } else if (/^\* /.test(message.Text)) { + type = "me"; + } else { + type = "text"; + } + if (Object.keys(message.ServerTimes).length == 0) { + type += " self"; + } + text_span.setAttribute("class", type); + text_span.appendChild(document.createTextNode(message.Text)); + message.UI.appendChild(text_span); } function rcaddmessagetohistory(message) { -- 2.44.1