Smaller event footprint
This commit is contained in:
parent
dcd72b2345
commit
f088b726fa
@ -194,10 +194,14 @@ h2 {
|
||||
color: #f00;
|
||||
}
|
||||
#chat .message .text {
|
||||
color: #999;
|
||||
color: inherit;
|
||||
}
|
||||
#chat .message.normal .text {
|
||||
color: #000;
|
||||
#chat .message.join,
|
||||
#chat .message.part,
|
||||
#chat .message.nick,
|
||||
#chat .message.quit,
|
||||
#chat .message.notice {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 480px) {
|
||||
|
@ -57,7 +57,7 @@
|
||||
|
||||
<script type="text/html" id="network">
|
||||
{{#networks}}
|
||||
<div class="network list-group" data-id="{{id}}">
|
||||
<div class="network list-group" data-id="{{id}}" data-nick="{{nick}}">
|
||||
{{> channels}}
|
||||
</div>
|
||||
{{/networks}}
|
||||
@ -110,7 +110,7 @@
|
||||
<div class="message {{type}}">
|
||||
<span class="time">{{time}}</span>
|
||||
<a href="{{user}}" class="user">{{mode}}{{user}}</a>
|
||||
<span class="text">{{text}}</span>
|
||||
<span class="text">{{type}} {{text}}</span>
|
||||
</div>
|
||||
{{/messages}}
|
||||
</script>
|
||||
|
@ -48,7 +48,7 @@ models.Message = Backbone.Model.extend({
|
||||
time: "",
|
||||
user: "",
|
||||
text: "",
|
||||
type: "normal"
|
||||
type: ""
|
||||
},
|
||||
initialize: function() {
|
||||
this.set("time", moment().format("HH:mm"));
|
||||
|
@ -24,8 +24,8 @@ Server.prototype.listen = function(port) {
|
||||
|
||||
this.sockets = io.listen(http, {log: false}).sockets;
|
||||
this.sockets.on("connection", function(socket) {
|
||||
socket.emit("NETWORKS", self.networks);
|
||||
socket.on("input", function(input) { handleInput.call(self, input); });
|
||||
socket.emit("NETWORKS", self.networks);
|
||||
});
|
||||
|
||||
if (config.autoConnect) {
|
||||
@ -264,7 +264,7 @@ function handleEvent(argv) {
|
||||
if (typeof user !== "undefined") {
|
||||
mode = user.get("mode");
|
||||
}
|
||||
|
||||
|
||||
channel.get("messages").add(
|
||||
new models.Message({
|
||||
mode: mode,
|
||||
@ -278,7 +278,7 @@ function handleEvent(argv) {
|
||||
var from = argv.nick ? argv.nick : "-!-";
|
||||
channels.first().get("messages").add(new models.Message({
|
||||
user: from,
|
||||
text: "notice: " + argv.args[1],
|
||||
text: argv.args[1],
|
||||
type: "notice"
|
||||
}));
|
||||
break;
|
||||
@ -308,7 +308,7 @@ function handleEvent(argv) {
|
||||
messages.add(
|
||||
new models.Message({
|
||||
user: argv.nick,
|
||||
text: "join",
|
||||
text: channel.get("name"),
|
||||
type: "join"
|
||||
})
|
||||
);
|
||||
@ -330,7 +330,7 @@ function handleEvent(argv) {
|
||||
messages.add(
|
||||
new models.Message({
|
||||
user: argv.nick,
|
||||
text: "part",
|
||||
text: channel.get("name"),
|
||||
type: "part"
|
||||
})
|
||||
);
|
||||
@ -356,7 +356,7 @@ function handleEvent(argv) {
|
||||
|
||||
messages.add(new models.Message({
|
||||
user: argv.nick,
|
||||
text: "changed name to " + argv.args[0],
|
||||
text: argv.args[0],
|
||||
type: "nick"
|
||||
}));
|
||||
});
|
||||
@ -396,7 +396,6 @@ function handleEvent(argv) {
|
||||
case "QUIT":
|
||||
var message = new models.Message({
|
||||
user: argv.nick,
|
||||
text: "quit",
|
||||
type: "quit"
|
||||
});
|
||||
|
||||
@ -420,7 +419,7 @@ function handleEvent(argv) {
|
||||
messages.add(
|
||||
new models.Message({
|
||||
user: argv.nick,
|
||||
text: "sets mode: " + argv.args[1] + " " + target,
|
||||
text: argv.args[1] + " " + target,
|
||||
type: "mode"
|
||||
})
|
||||
);
|
||||
@ -556,4 +555,7 @@ function handleEvent(argv) {
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// Debug
|
||||
console.log(argv);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user