lib/jschat/http/public/javascripts/app/protocol/display.js in jschat-0.3.6 vs lib/jschat/http/public/javascripts/app/protocol/display.js in jschat-0.3.7
- old
+ new
@@ -15,13 +15,15 @@
message: function(message, time) {
var name = JsChat.user.name;
var user_class = name == message['user'] ? 'user active' : 'user';
var text = '<span class="\#{user_class}">\#{user}</span> <span class="\#{message_class}">\#{message}</span>';
+ var blurred_mention = '';
if (message['message'].match(new RegExp(name, 'i')) && name != message['user']) {
user_class = 'user mentioned';
+ blurred_mention = '*';
}
Display.clearIdleState(message['user']);
text = text.interpolate({
@@ -35,10 +37,10 @@
this.add_message(text, 'message', time);
this.addImageOnLoads();
if (this.show_unread) {
this.unread++;
- document.title = 'JsChat: (' + this.unread + ') new messages';
+ document.title = 'JsChat: (' + this.unread + blurred_mention + ') new messages';
}
},
messages: function(messages) {
$('messages').innerHTML = '';