Show errors in current window

This commit is contained in:
Mattias Erming 2014-06-13 13:22:03 +02:00
parent 9f5d3807ec
commit 047f8b0302
3 changed files with 11 additions and 13 deletions

View file

@ -265,6 +265,7 @@ button {
color: #bbb;
}
#chat .action .type,
#chat .error .type,
#chat .highlight .type,
#chat .motd .type,
#chat .normal .type,
@ -278,6 +279,8 @@ button {
#chat .action .user:before {
content: '* ';
}
#chat .error,
#chat .error .from a,
#chat .highlight,
#chat .highlight .from a {
color: #f00;

View file

@ -77,7 +77,8 @@ $(function() {
case "messages":
case "msg":
var target = $("#window-" + data.id).find(".messages");
var target = (data.id ? $("#window-" + data.id) : $("#chat .active"))
.find(".messages");
var html = render(
"messages",
{messages: toArray(data.msg)}
@ -122,10 +123,7 @@ $(function() {
case "users":
var target = $("#window-" + data.id);
var json = {
name: target.find("h1").html(),
users: data.users
};
var json = {name: target.find("h1").html(), users: data.users};
target.find(".meta")
.replaceWith(render("meta", json))
.end();

View file

@ -652,15 +652,12 @@ function event(e, data) {
case "whois":
if (!data) {
var chan = channels[0];
var msg = new Msg({
type: "error",
text: "No such nick/channel.",
});
chan.messages.push(msg);
sockets.emit("msg", {
id: chan.id,
msg: msg,
msg: new Msg({
type: "error",
from: "-!-",
text: "No such nick/channel.",
}),
});
} else {
var chan = _.findWhere(channels, {name: data.nickname});