Rename message property
This commit is contained in:
parent
9e860b14d7
commit
6366fd38a2
@ -114,7 +114,7 @@
|
|||||||
<div class="time">{{time}}</div>
|
<div class="time">{{time}}</div>
|
||||||
<div class="user">{{from}}</div>
|
<div class="user">{{from}}</div>
|
||||||
<div class="type">{{type}}</div>
|
<div class="type">{{type}}</div>
|
||||||
<div class="text">{{message}}</div>
|
<div class="text">{{text}}</div>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</script>
|
</script>
|
||||||
|
@ -31,7 +31,7 @@ models.Message = Backbone.Model.extend({
|
|||||||
type: "",
|
type: "",
|
||||||
time: "",
|
time: "",
|
||||||
from: "-!-",
|
from: "-!-",
|
||||||
message: "",
|
text: "",
|
||||||
},
|
},
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.set("time", require("moment")().format("HH:mm"));
|
this.set("time", require("moment")().format("HH:mm"));
|
||||||
|
@ -121,7 +121,7 @@ function input(json) {
|
|||||||
}
|
}
|
||||||
channel.get("messages").add({
|
channel.get("messages").add({
|
||||||
from: user,
|
from: user,
|
||||||
message: message,
|
text: message,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ function event(event, data) {
|
|||||||
|
|
||||||
chan.get("messages").add({
|
chan.get("messages").add({
|
||||||
from: data[0].nick,
|
from: data[0].nick,
|
||||||
message: data[0].client,
|
text: data[0].client,
|
||||||
type: "kick",
|
type: "kick",
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@ -254,7 +254,7 @@ function event(event, data) {
|
|||||||
if (typeof chan !== "undefined") {
|
if (typeof chan !== "undefined") {
|
||||||
chan.get("messages").add({
|
chan.get("messages").add({
|
||||||
from: data[0].nick,
|
from: data[0].nick,
|
||||||
message: data[0].mode + " " + data[0].client,
|
text: data[0].mode + " " + data[0].client,
|
||||||
type: "mode",
|
type: "mode",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -263,7 +263,7 @@ function event(event, data) {
|
|||||||
case "motd":
|
case "motd":
|
||||||
var messages = data[0].motd;
|
var messages = data[0].motd;
|
||||||
messages.forEach(function(msg) {
|
messages.forEach(function(msg) {
|
||||||
channels.first().get("messages").add({message: msg});
|
channels.first().get("messages").add({text: msg});
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ function event(event, data) {
|
|||||||
var chan = channels.findWhere({name: data[0].to}) || channels.add({type: "query", name: data[0].from});
|
var chan = channels.findWhere({name: data[0].to}) || channels.add({type: "query", name: data[0].from});
|
||||||
chan.get("messages").add({
|
chan.get("messages").add({
|
||||||
from: data[0].from,
|
from: data[0].from,
|
||||||
message: data[0].message
|
text: data[0].message
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -288,7 +288,7 @@ function event(event, data) {
|
|||||||
case "nick":
|
case "nick":
|
||||||
if (data[0].new == this.get("client").me) {
|
if (data[0].new == this.get("client").me) {
|
||||||
channels.first().get("messages").add({
|
channels.first().get("messages").add({
|
||||||
message: "You're now known as " + data[0]["new"],
|
text: "You're now known as " + data[0]["new"],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
channels.each(function(chan) {
|
channels.each(function(chan) {
|
||||||
@ -303,7 +303,7 @@ function event(event, data) {
|
|||||||
|
|
||||||
chan.get("messages").add({
|
chan.get("messages").add({
|
||||||
from: data[0].nick,
|
from: data[0].nick,
|
||||||
message: data[0]["new"],
|
text: data[0]["new"],
|
||||||
type: "nick",
|
type: "nick",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -313,7 +313,11 @@ function event(event, data) {
|
|||||||
if (data[0].to = "*") {
|
if (data[0].to = "*") {
|
||||||
data[0].from = "-!-";
|
data[0].from = "-!-";
|
||||||
}
|
}
|
||||||
channels.first().get("messages").add(data[0]);
|
channels.first().get("messages").add({
|
||||||
|
type: "notice",
|
||||||
|
from: data[0].from,
|
||||||
|
text: data[0].message,
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "part":
|
case "part":
|
||||||
@ -351,15 +355,15 @@ function event(event, data) {
|
|||||||
var from = data[0].nick || chan.get("name");
|
var from = data[0].nick || chan.get("name");
|
||||||
chan.get("messages").add({
|
chan.get("messages").add({
|
||||||
from: from,
|
from: from,
|
||||||
message: data[0].topic,
|
text: data[0].topic,
|
||||||
type: "topic",
|
type: "topic",
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "welcome":
|
case "welcome":
|
||||||
channels.first().get("messages").add([
|
channels.first().get("messages").add([
|
||||||
{message: "You're now connected to " + this.get("host")},
|
{text: "You're now connected to " + this.get("host")},
|
||||||
{message: "You're now known as " + data[0]}
|
{text: "You're now known as " + data[0]}
|
||||||
]);
|
]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -367,7 +371,7 @@ function event(event, data) {
|
|||||||
if (data[1] == null) {
|
if (data[1] == null) {
|
||||||
channels.first().get("messages").add({
|
channels.first().get("messages").add({
|
||||||
type: "error",
|
type: "error",
|
||||||
message: data[0]
|
text: data[0]
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -379,7 +383,7 @@ function event(event, data) {
|
|||||||
for (var k in data[1]) {
|
for (var k in data[1]) {
|
||||||
if (i++ == 5) break;
|
if (i++ == 5) break;
|
||||||
chan.get("messages").add({
|
chan.get("messages").add({
|
||||||
message: k + ": " + data[1][k]
|
text: k + ": " + data[1][k]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user