Highlight on private message
This commit is contained in:
parent
ddadf4652c
commit
98465ce9e5
@ -369,16 +369,17 @@ $(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
chat.on("msg", ".messages", function(e, target, msg) {
|
chat.on("msg", ".messages", function(e, target, msg) {
|
||||||
|
var btn = sidebar.find(".chan[data-target=" + target + "]:not(.active)");
|
||||||
|
var query = btn.hasClass("query");
|
||||||
var type = msg.type;
|
var type = msg.type;
|
||||||
var highlight = type.contains("highlight");
|
var highlight = type.contains("highlight");
|
||||||
if (highlight) {
|
if (highlight || query) {
|
||||||
pop.play();
|
pop.play();
|
||||||
if (document.hidden || !$(target).hasClass("active")) {
|
if (document.hidden || !$(target).hasClass("active")) {
|
||||||
favico.badge("!");
|
favico.badge("!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var btn = sidebar.find(".chan[data-target=" + target + "]:not(.active)");
|
|
||||||
if (btn.length === 0) {
|
if (btn.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -397,7 +398,7 @@ $(function() {
|
|||||||
if (badge.length !== 0) {
|
if (badge.length !== 0) {
|
||||||
var i = (parseInt(badge.html()) || 0) + 1;
|
var i = (parseInt(badge.html()) || 0) + 1;
|
||||||
badge.html(i);
|
badge.html(i);
|
||||||
if (highlight) {
|
if (highlight || query) {
|
||||||
badge.addClass("highlight");
|
badge.addClass("highlight");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "shout",
|
"name": "shout",
|
||||||
"description": "A web IRC client",
|
"description": "A web IRC client",
|
||||||
"version": "0.8.7",
|
"version": "0.8.8",
|
||||||
"homepage": "http://github.com/erming/shout",
|
"homepage": "http://github.com/erming/shout",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Mattias Erming",
|
"name": "Mattias Erming",
|
||||||
|
Loading…
Reference in New Issue
Block a user