Fix bugs
This commit is contained in:
parent
3cf870bc06
commit
66785be200
|
@ -454,10 +454,6 @@ button {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat .from_me .text {
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
#chat .msg {
|
#chat .msg {
|
||||||
display: table-row;
|
display: table-row;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
@ -482,7 +478,6 @@ button {
|
||||||
display: table-cell;
|
display: table-cell;
|
||||||
padding: 3px 0;
|
padding: 3px 0;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
|
|
||||||
}
|
}
|
||||||
#chat .time {
|
#chat .time {
|
||||||
color: #d0dbe2;
|
color: #d0dbe2;
|
||||||
|
@ -510,6 +505,9 @@ button {
|
||||||
#chat .text a {
|
#chat .text a {
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
#chat .self .text {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
#chat .join .type,
|
#chat .join .type,
|
||||||
#chat .part .type,
|
#chat .part .type,
|
||||||
#chat .mode .type,
|
#chat .mode .type,
|
||||||
|
|
|
@ -54,28 +54,33 @@ templates['chat'] = template({"1":function(depth0,helpers,partials,data) {
|
||||||
templates['msg'] = template({"1":function(depth0,helpers,partials,data) {
|
templates['msg'] = template({"1":function(depth0,helpers,partials,data) {
|
||||||
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div class=\"msg "
|
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div class=\"msg "
|
||||||
+ escapeExpression(((helper = (helper = helpers.type || (depth0 != null ? depth0.type : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"type","hash":{},"data":data}) : helper)))
|
+ escapeExpression(((helper = (helper = helpers.type || (depth0 != null ? depth0.type : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"type","hash":{},"data":data}) : helper)))
|
||||||
+ "\">\n <span class=\"time\">\n "
|
+ " ";
|
||||||
|
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.self : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
|
||||||
|
if (stack1 != null) { buffer += stack1; }
|
||||||
|
buffer += "\">\n <span class=\"time\">\n "
|
||||||
+ escapeExpression(((helpers.tz || (depth0 && depth0.tz) || helperMissing).call(depth0, (depth0 != null ? depth0.time : depth0), {"name":"tz","hash":{},"data":data})))
|
+ escapeExpression(((helpers.tz || (depth0 && depth0.tz) || helperMissing).call(depth0, (depth0 != null ? depth0.time : depth0), {"name":"tz","hash":{},"data":data})))
|
||||||
+ "\n </span>\n <span class=\"from\">\n";
|
+ "\n </span>\n <span class=\"from\">\n";
|
||||||
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.from : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
|
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.from : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.noop,"data":data});
|
||||||
if (stack1 != null) { buffer += stack1; }
|
if (stack1 != null) { buffer += stack1; }
|
||||||
buffer += " </span>\n <span class=\"text\">\n <em class=\"type\">"
|
buffer += " </span>\n <span class=\"text\">\n <em class=\"type\">"
|
||||||
+ escapeExpression(((helper = (helper = helpers.type || (depth0 != null ? depth0.type : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"type","hash":{},"data":data}) : helper)))
|
+ escapeExpression(((helper = (helper = helpers.type || (depth0 != null ? depth0.type : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"type","hash":{},"data":data}) : helper)))
|
||||||
+ "</em>\n";
|
+ "</em>\n";
|
||||||
stack1 = ((helpers.equal || (depth0 && depth0.equal) || helperMissing).call(depth0, (depth0 != null ? depth0.type : depth0), "image", {"name":"equal","hash":{},"fn":this.program(4, data),"inverse":this.program(6, data),"data":data}));
|
stack1 = ((helpers.equal || (depth0 && depth0.equal) || helperMissing).call(depth0, (depth0 != null ? depth0.type : depth0), "image", {"name":"equal","hash":{},"fn":this.program(6, data),"inverse":this.program(8, data),"data":data}));
|
||||||
if (stack1 != null) { buffer += stack1; }
|
if (stack1 != null) { buffer += stack1; }
|
||||||
return buffer + " </span>\n</div>\n";
|
return buffer + " </span>\n</div>\n";
|
||||||
},"2":function(depth0,helpers,partials,data) {
|
},"2":function(depth0,helpers,partials,data) {
|
||||||
|
return "self";
|
||||||
|
},"4":function(depth0,helpers,partials,data) {
|
||||||
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
||||||
return " <button class=\"user\">"
|
return " <button class=\"user\">"
|
||||||
+ escapeExpression(((helper = (helper = helpers.from || (depth0 != null ? depth0.from : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"from","hash":{},"data":data}) : helper)))
|
+ escapeExpression(((helper = (helper = helpers.from || (depth0 != null ? depth0.from : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"from","hash":{},"data":data}) : helper)))
|
||||||
+ "</button>\n";
|
+ "</button>\n";
|
||||||
},"4":function(depth0,helpers,partials,data) {
|
},"6":function(depth0,helpers,partials,data) {
|
||||||
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
||||||
return " <img src=\""
|
return " <img src=\""
|
||||||
+ escapeExpression(((helper = (helper = helpers.text || (depth0 != null ? depth0.text : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"text","hash":{},"data":data}) : helper)))
|
+ escapeExpression(((helper = (helper = helpers.text || (depth0 != null ? depth0.text : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"text","hash":{},"data":data}) : helper)))
|
||||||
+ "\" class=\"image\">\n";
|
+ "\" class=\"image\">\n";
|
||||||
},"6":function(depth0,helpers,partials,data) {
|
},"8":function(depth0,helpers,partials,data) {
|
||||||
var stack1, helperMissing=helpers.helperMissing, buffer = " ";
|
var stack1, helperMissing=helpers.helperMissing, buffer = " ";
|
||||||
stack1 = ((helpers.uri || (depth0 && depth0.uri) || helperMissing).call(depth0, (depth0 != null ? depth0.text : depth0), {"name":"uri","hash":{},"data":data}));
|
stack1 = ((helpers.uri || (depth0 && depth0.uri) || helperMissing).call(depth0, (depth0 != null ? depth0.text : depth0), {"name":"uri","hash":{},"data":data}));
|
||||||
if (stack1 != null) { buffer += stack1; }
|
if (stack1 != null) { buffer += stack1; }
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
{{#each messages}}
|
{{#each messages}}
|
||||||
{{#if from_me}}
|
<div class="msg {{type}} {{#if self}}self{{/if}}">
|
||||||
<div class="msg {{type}} from_me">
|
|
||||||
{{else}}
|
|
||||||
<div class="msg {{type}}">
|
|
||||||
{{/if}}
|
|
||||||
<span class="time">
|
<span class="time">
|
||||||
{{tz time}}
|
{{tz time}}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -26,6 +26,6 @@ function Msg(attr) {
|
||||||
text: "",
|
text: "",
|
||||||
time: moment().utc().format("HH:mm:ss"),
|
time: moment().utc().format("HH:mm:ss"),
|
||||||
type: Msg.Type.MESSAGE,
|
type: Msg.Type.MESSAGE,
|
||||||
from_me: false,
|
self: false
|
||||||
}, attr));
|
}, attr));
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,16 +25,16 @@ module.exports = function(irc, network) {
|
||||||
if (typeof chan === "undefined") {
|
if (typeof chan === "undefined") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var from_me = false
|
var self = false;
|
||||||
if (data.from.toLowerCase() == irc.me.toLowerCase() ) {
|
if (data.from.toLowerCase() == irc.me.toLowerCase()) {
|
||||||
from_me = true
|
self = true;
|
||||||
}
|
}
|
||||||
fetchImage(image, function(name) {
|
fetchImage(image, function(name) {
|
||||||
var msg = new Msg({
|
var msg = new Msg({
|
||||||
type: Msg.Type.IMAGE,
|
type: Msg.Type.IMAGE,
|
||||||
from: data.from,
|
from: data.from,
|
||||||
text: "thumbs/" + name,
|
text: "thumbs/" + name,
|
||||||
from_me = from_me
|
self: self
|
||||||
});
|
});
|
||||||
chan.messages.push(msg);
|
chan.messages.push(msg);
|
||||||
client.emit("msg", {
|
client.emit("msg", {
|
||||||
|
|
|
@ -17,10 +17,6 @@ module.exports = function(irc, network) {
|
||||||
chan: chan
|
chan: chan
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var from_me = false
|
|
||||||
if (data.from.toLowerCase() == irc.me.toLowerCase() ) {
|
|
||||||
from_me = true
|
|
||||||
}
|
|
||||||
var users = chan.users;
|
var users = chan.users;
|
||||||
users.push(new User({name: data.nick}));
|
users.push(new User({name: data.nick}));
|
||||||
chan.sortUsers();
|
chan.sortUsers();
|
||||||
|
@ -28,10 +24,14 @@ module.exports = function(irc, network) {
|
||||||
chan: chan.id,
|
chan: chan.id,
|
||||||
users: users
|
users: users
|
||||||
});
|
});
|
||||||
|
var self = false;
|
||||||
|
if (data.nick.toLowerCase() == irc.me.toLowerCase()) {
|
||||||
|
self = true;
|
||||||
|
}
|
||||||
var msg = new Msg({
|
var msg = new Msg({
|
||||||
from: data.nick,
|
from: data.nick,
|
||||||
type: Msg.Type.JOIN,
|
type: Msg.Type.JOIN,
|
||||||
from_me: from_me
|
self: self
|
||||||
});
|
});
|
||||||
chan.messages.push(msg);
|
chan.messages.push(msg);
|
||||||
client.emit("msg", {
|
client.emit("msg", {
|
||||||
|
|
|
@ -17,15 +17,15 @@ module.exports = function(irc, network) {
|
||||||
chan: chan.id,
|
chan: chan.id,
|
||||||
users: chan.users
|
users: chan.users
|
||||||
});
|
});
|
||||||
var from_me = false
|
var self = false;
|
||||||
if (data.nick.toLowerCase() == irc.me.toLowerCase() ) {
|
if (data.nick.toLowerCase() == irc.me.toLowerCase()) {
|
||||||
from_me = true
|
self = true;
|
||||||
}
|
}
|
||||||
var msg = new Msg({
|
var msg = new Msg({
|
||||||
type: Msg.Type.KICK,
|
type: Msg.Type.KICK,
|
||||||
from: data.nick,
|
from: data.nick,
|
||||||
text: data.client,
|
text: data.client,
|
||||||
from_me: from_me
|
self: self
|
||||||
});
|
});
|
||||||
chan.messages.push(msg);
|
chan.messages.push(msg);
|
||||||
client.emit("msg", {
|
client.emit("msg", {
|
||||||
|
|
|
@ -30,15 +30,15 @@ module.exports = function(irc, network) {
|
||||||
text.split(" ").forEach(function(w) {
|
text.split(" ").forEach(function(w) {
|
||||||
if (w.indexOf(irc.me) === 0) type += " highlight";
|
if (w.indexOf(irc.me) === 0) type += " highlight";
|
||||||
});
|
});
|
||||||
var from_me = false
|
var self = false;
|
||||||
if (data.from.toLowerCase() == irc.me.toLowerCase() ) {
|
if (data.from.toLowerCase() == irc.me.toLowerCase()) {
|
||||||
from_me = true
|
self = true;
|
||||||
}
|
}
|
||||||
var msg = new Msg({
|
var msg = new Msg({
|
||||||
type: type || Msg.Type.MESSAGE,
|
type: type || Msg.Type.MESSAGE,
|
||||||
from: data.from,
|
from: data.from,
|
||||||
text: text,
|
text: text,
|
||||||
from_me: from_me
|
self: self
|
||||||
});
|
});
|
||||||
chan.messages.push(msg);
|
chan.messages.push(msg);
|
||||||
client.emit("msg", {
|
client.emit("msg", {
|
||||||
|
|
|
@ -13,15 +13,15 @@ module.exports = function(irc, network) {
|
||||||
if (nick.indexOf(".") !== -1) {
|
if (nick.indexOf(".") !== -1) {
|
||||||
nick = data.target;
|
nick = data.target;
|
||||||
}
|
}
|
||||||
var from_me = false
|
var self = false;
|
||||||
if (nick.toLowerCase() == irc.me.toLowerCase() ) {
|
if (nick.toLowerCase() == irc.me.toLowerCase()) {
|
||||||
from_me = true
|
self = true;
|
||||||
}
|
}
|
||||||
var msg = new Msg({
|
var msg = new Msg({
|
||||||
type: Msg.Type.MODE,
|
type: Msg.Type.MODE,
|
||||||
from: nick,
|
from: nick,
|
||||||
text: data.mode + " " + data.client,
|
text: data.mode + " " + data.client,
|
||||||
from_me: from_me
|
self: self
|
||||||
});
|
});
|
||||||
chan.messages.push(msg);
|
chan.messages.push(msg);
|
||||||
client.emit("msg", {
|
client.emit("msg", {
|
||||||
|
|
|
@ -3,6 +3,7 @@ var Msg = require("../../models/msg");
|
||||||
|
|
||||||
module.exports = function(irc, network) {
|
module.exports = function(irc, network) {
|
||||||
var client = this;
|
var client = this;
|
||||||
|
var self = false;
|
||||||
irc.on("nick", function(data) {
|
irc.on("nick", function(data) {
|
||||||
if (data["new"] == irc.me) {
|
if (data["new"] == irc.me) {
|
||||||
var lobby = network.channels[0];
|
var lobby = network.channels[0];
|
||||||
|
@ -14,6 +15,7 @@ module.exports = function(irc, network) {
|
||||||
chan: lobby.id,
|
chan: lobby.id,
|
||||||
msg: msg
|
msg: msg
|
||||||
});
|
});
|
||||||
|
self = true;
|
||||||
}
|
}
|
||||||
network.channels.forEach(function(chan) {
|
network.channels.forEach(function(chan) {
|
||||||
var user = _.findWhere(chan.users, {name: data.nick});
|
var user = _.findWhere(chan.users, {name: data.nick});
|
||||||
|
@ -29,7 +31,8 @@ module.exports = function(irc, network) {
|
||||||
var msg = new Msg({
|
var msg = new Msg({
|
||||||
type: Msg.Type.NICK,
|
type: Msg.Type.NICK,
|
||||||
from: data.nick,
|
from: data.nick,
|
||||||
text: data["new"]
|
text: data["new"],
|
||||||
|
self: self
|
||||||
});
|
});
|
||||||
chan.messages.push(msg);
|
chan.messages.push(msg);
|
||||||
client.emit("msg", {
|
client.emit("msg", {
|
||||||
|
|
|
@ -9,15 +9,15 @@ module.exports = function(irc, network) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var from = data.nick || chan.name;
|
var from = data.nick || chan.name;
|
||||||
var from_me = false
|
var self = false;
|
||||||
if (data.nick.toLowerCase() == irc.me.toLowerCase() ) {
|
if (from.toLowerCase() == irc.me.toLowerCase()) {
|
||||||
from_me = true
|
self = true;
|
||||||
}
|
}
|
||||||
var msg = new Msg({
|
var msg = new Msg({
|
||||||
type: Msg.Type.TOPIC,
|
type: Msg.Type.TOPIC,
|
||||||
from: from,
|
from: from,
|
||||||
text: data.topic,
|
text: data.topic,
|
||||||
from_me: from_me,
|
self: self
|
||||||
});
|
});
|
||||||
chan.messages.push(msg);
|
chan.messages.push(msg);
|
||||||
client.emit("msg", {
|
client.emit("msg", {
|
||||||
|
|
Loading…
Reference in New Issue