Show errors in current window
This commit is contained in:
parent
9f5d3807ec
commit
047f8b0302
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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});
|
||||
|
|
Loading…
Reference in New Issue