From c96d16159f15e14a188c9261833686dca240dee2 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Mon, 18 Feb 2013 00:00:08 -0800 Subject: Chat updates. Commands /say to speak as server. Notification of new maps in chat. --- pages/chat.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'pages') diff --git a/pages/chat.php b/pages/chat.php index e165457..8aec336 100644 --- a/pages/chat.php +++ b/pages/chat.php @@ -65,6 +65,15 @@ function getChatDone(data) { //var timestamp = postDate.format("ddd h:MM TT"); //var timestamp = postDate.format("h:MM:ss"); var timestamp = postDate.format("hh:MM:ss"); + + var strClass = ''; + if (user.userID == userObj.ID) { + strClass += ' self'; + } + if (user.userID == '-1') { + strClass += ' server'; + user.displayName = 'SERVER' + } //console.log("INSIDE BUILD START"); p = ''; @@ -77,8 +86,11 @@ function getChatDone(data) { p = p+ " "; p = p+ "
"; - - p = p+ ""; + if (user.userID == '-1') { + p = p+ ""; + } else { + p = p+ ""; + } p = p+ user.displayName+":"; p = p+ " "; @@ -86,15 +98,7 @@ function getChatDone(data) { p = p+ " "; p = p+ "
"; - lastID = user.ID; - - var strClass = ''; - if (user.userID == userObj.ID) { - strClass += ' self'; - } - if (user.serverMessage == 'true') { - strClass += ' server'; - } + if (user.ID > 0) lastID = user.ID; items.push('
' + p + '
'); newChats = true; -- cgit v1.2.3