Highlight messages which contain your name.

This was requested by CUSTOMER18 and CUSTOMER4.

Closes trac #705.

(imported from commit a25c6b7ca0ae3ba89c03779b19c4d6b0af93a014)
This commit is contained in:
Luke Faraone
2013-03-12 17:36:13 -04:00
parent e9cbae67b3
commit 10b15640e9
4 changed files with 14 additions and 4 deletions

View File

@@ -57,7 +57,7 @@
{{/include_sender}}
</td>
<td class="pointer"><p></p></td>
<td class="messagebox{{^include_sender}} prev_is_same_sender{{/include_sender}}{{^is_stream}} private-message{{/is_stream}}">
<td class="messagebox{{^include_sender}} prev_is_same_sender{{/include_sender}}{{^is_stream}} private-message{{/is_stream}}{{#contains_mention}} mention{{/contains_mention}}">
<div class="message_top_line">
{{#include_sender}}
<span class="message_sender actions_hover">

View File

@@ -285,6 +285,8 @@ MessageList.prototype = {
message.invite_only = subs.get_invite_only(message.display_recipient);
}
message.contains_mention = notifications.speaking_at_me(message);
messages_to_render.push(message);
prev = message;
});

View File

@@ -159,7 +159,7 @@ function process_desktop_notification(message) {
notification_object.show();
}
function speaking_at_me(message) {
exports.speaking_at_me = function (message) {
var content_lc = message.content.toLowerCase();
var found_match = false, indexof, after_name, after_atname;
var punctuation = /[\.,-\/#!$%\^&\*;:{}=\-_`~()\+\?\[\]\s<>]/;
@@ -191,7 +191,7 @@ function speaking_at_me(message) {
});
return found_match;
}
};
exports.received_messages = function (messages) {
var i, title_needs_update = false;
@@ -207,7 +207,7 @@ exports.received_messages = function (messages) {
if (desktop_notifications_enabled &&
browser_desktop_notifications_on() &&
(message.type === "private" ||
speaking_at_me(message))) {
exports.speaking_at_me(message))) {
process_desktop_notification(message);
}
}

View File

@@ -268,6 +268,10 @@ td.pointer {
background-color: #FEFFCC;
}
.selected_message .messagebox.mention {
background-color: #ffe192;
}
.selected_message .pointer {
background-color: #08c;
}
@@ -342,6 +346,10 @@ td.pointer {
background-color: #feffe0;
}
.messagebox.mention {
background-color: #ffe8ab;
}
.sender_name {
color: #333;
font-weight: bold;