From: Chris Porter Date: Sat, 14 Jun 2008 16:46:46 +0000 (+0100) Subject: Fix colour and $ bugs. X-Git-Url: https://jfr.im/git/irc/quakenet/qwebirc.git/commitdiff_plain/e2757a9142ede7357c7988cd9c2ff9ee8a94e41f?hp=c3efd9cc9309918b389a71d3fb9af7a50e8f1572 Fix colour and $ bugs. --- diff --git a/static/js/irc/baseirc.js b/static/js/irc/baseirc.js index 51fd361..0a97712 100644 --- a/static/js/irc/baseirc.js +++ b/static/js/irc/baseirc.js @@ -84,6 +84,7 @@ function BaseIRCClient(nickname, view) { var user = prefix; var channel = params[0]; var message = params[1]; + var nick = hosttonick(user); if((nick == self.nickname) && self.channels[channel]) diff --git a/static/js/irc/ircclient.js b/static/js/irc/ircclient.js index 46e3173..2e68763 100644 --- a/static/js/irc/ircclient.js +++ b/static/js/irc/ircclient.js @@ -89,11 +89,9 @@ function IRCClient(nickname, ui) { self.tracker.removeChannel(channel); } else { self.tracker.removeNickFromChannel(nick, channel); + newChanLine(channel, "PART", user, {"m": message}); } - - if(!message) - message = ""; - newChanLine(channel, "PART", user, {"m": message}); + self.updateNickList(channel); if(nick == self.nickname) @@ -108,8 +106,6 @@ function IRCClient(nickname, ui) { self.tracker.removeNickFromChannel(kickee, channel); self.updateNickList(channel); } - if(!message) - message = ""; newChanLine(channel, "KICK", kicker, {"v": kickee, "m": message}); } diff --git a/static/js/ui/colour.js b/static/js/ui/colour.js index 460e98f..9599668 100644 --- a/static/js/ui/colour.js +++ b/static/js/ui/colour.js @@ -20,10 +20,10 @@ function colourise(line, entity) { } i++; if(isnum(xline[i + 1])) { - fg = xline[i] + xline[i + 1]; + fg = parseInt(xline[i] + xline[i + 1]); i++; } else { - fg = xline[i]; + fg = parseInt(xline[i]); } if(xline[i + 1] != ",") return i; @@ -32,10 +32,10 @@ function colourise(line, entity) { i+=2; if(isnum(xline[i + 1])) { - bg = xline[i] + xline[i + 1]; + bg = parseInt(xline[i] + xline[i + 1]); i++; } else { - bg = xline[i]; + bg = parseInt(xline[i]); } return i; } @@ -83,6 +83,10 @@ function colourise(line, entity) { ac(); i = parsecolours(xline, i); + if(bg > 15) + bg = undefined; + if(fg > 15) + fg = undefined; pc(); } else { out.push(lc); diff --git a/static/js/ui/theme.js b/static/js/ui/theme.js index 21f1355..e3d2a05 100644 --- a/static/js/ui/theme.js +++ b/static/js/ui/theme.js @@ -39,12 +39,10 @@ function Theme(values) { var c2 = n[++i]; var o = ThemeControlCodeMap[c2]; - if(!o) { + if(!o) o = h[c2]; - if(!o) - o = c; - } - msg.push(o); + if(o) + msg.push(o); } else { msg.push(c); }