From e646c23bc204ff1bb21cb19e22df4e34b10f1043 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Mon, 4 May 2015 16:42:00 -0400 Subject: [PATCH] Add subtle notifications for room activity Chat room titles now turn orange and their icon changes when someone talks in them. This is subtler than the highlight notification, and should make it easier to keep up with rooms. This change involves a refactor of the notification system, which also happens to improve room-switching performance by only running updateTopbar once instead of 3-5 times like it would before. --- js/client-chat.js | 2 + js/client.js | 106 +++++++++++++++++++++++++++++++--------------- style/client.css | 7 +++ 3 files changed, 80 insertions(+), 35 deletions(-) diff --git a/js/client-chat.js b/js/client-chat.js index 5c90dbe43..d932fc67b 100644 --- a/js/client-chat.js +++ b/js/client-chat.js @@ -1299,6 +1299,8 @@ if (isHighlighted) { var notifyTitle = "Mentioned by "+name+(this.id === 'lobby' ? '' : " in "+this.title); this.notifyOnce(notifyTitle, "\""+message+"\"", 'highlight'); + } else { + this.subtleNotifyOnce(); } } var highlight = isHighlighted ? ' highlighted' : ''; diff --git a/js/client.js b/js/client.js index dc5877254..82a2a0f87 100644 --- a/js/client.js +++ b/js/client.js @@ -1522,7 +1522,7 @@ var curId = (app.curRoom ? app.curRoom.id : ''); var curSideId = (app.curSideRoom ? app.curSideRoom.id : ''); - var buf = '