landing chatzilla 0.8.23, bug 194241, r=samuel@sieb.net, a=asa@mozilla.org

fixes...
bug 190568, ssieb upgraded networking code that was making incorrect assumptions.
bug 191910, added a munger rule to turn `` and '' into unicode left/right double
quotes.
bug 124638, Neil's fix to keep chatzilla from stealing focus when joining channels.
bug 191500, Items in chatzilla's pref tree were hardcoded into the .xul file.
bug 194334, Adds accelerator keys to some pref panels, in places where they were missing.

Allows formatting to be nested, to a certain extent.  * http://foo * will
linkify http://foo AND bold it.
Lets tab characters pass through the control-code munger.
Added auto-reconnect, and a pref to control it.
Fixed URL munging so that it only creates links for valid schemes, and doesn't
include trailing punctuation in the link.
No longer strips leading and trailing whitespace from submitted lines.
This commit is contained in:
rginda%netscape.com 2003-02-26 00:57:45 +00:00
parent 21b4f6bc05
commit 6a3218e1b5
12 changed files with 240 additions and 130 deletions

View File

@ -122,7 +122,6 @@ function net_geturl ()
CIRCNetwork.prototype.connect =
function net_conenct()
{
if ("primServ" in this && this.primServ.connection.isConnected)
return;
@ -132,17 +131,13 @@ function net_conenct()
this.nextHost = 0;
var ev = new CEvent ("network", "do-connect", this, "onDoConnect");
this.eventPump.addEvent (ev);
}
CIRCNetwork.prototype.quit =
function net_quit (reason)
{
this.stayingPower = false;
if (this.isConnected())
this.primServ.logout (reason);
}
/*
@ -366,6 +361,8 @@ function serv_logout(reason)
if (typeof reason == "undefined") reason = this.DEFAULT_REASON;
this.quitting = true;
this.connection.sendData ("QUIT :" + reason + "\n");
this.connection.disconnect();
@ -547,7 +544,8 @@ function serv_disconnect(e)
if (("connecting" in this.parent) ||
/* fell off while connecting, try again */
(this.parent.primServ == this) && (this.parent.stayingPower))
(this.parent.primServ == this) &&
(!("quitting" in this) && this.parent.stayingPower))
{ /* fell off primary server, reconnect to any host in the serverList */
var ev = new CEvent ("network", "do-connect", this.parent,
"onDoConnect");
@ -560,7 +558,9 @@ function serv_disconnect(e)
for (var c in this.channels)
this.channels[c].users = new Object();
delete this.quitting;
return true;
}
@ -692,9 +692,8 @@ function serv_ppline(e)
* connection.....CBSConnection (this.connection)
* source.........the <prefix> of the message (if it exists)
* user...........user object initialized with data from the message <prefix>
* params.........array containing the <middle> parameters of the message
* code...........the first <middle> parameter (most messages have this)
* meat...........the <trailing> parameter of the message
* params.........array containing the parameters of the message
* code...........the first parameter (most messages have this)
*
* See Section 2.3.1 of RFC 1459 for details on <prefix>, <middle> and
* <trailing> tokens.
@ -736,14 +735,16 @@ function serv_onRawData(e)
var sep = l.indexOf(" :");
if (sep != -1) /* <trailing> param, if there is one */
e.meat = l.substr (sep + 2, l.length);
else
e.meat = "";
if (sep != -1)
{
var trail = l.substr (sep + 2, l.length);
e.params = l.substr(0, sep).split(" ");
e.params[e.params.length] = trail;
}
else
{
e.params = l.split(" ");
}
e.code = e.params[0].toUpperCase();
e.type = "parseddata";
@ -799,7 +800,7 @@ function serv_topic (e)
e.channel = new CIRCChannel (this, e.params[1]);
e.channel.topicBy = e.user.nick;
e.channel.topicDate = new Date();
e.channel.topic = e.meat;
e.channel.topic = e.params[2];
e.destObject = e.channel;
e.set = "channel";
@ -843,7 +844,7 @@ function serv_332 (e)
{
e.channel = new CIRCChannel (this, e.params[2]);
e.channel.topic = e.meat;
e.channel.topic = e.params[3];
e.destObject = e.channel;
e.set = "channel";
@ -936,7 +937,7 @@ function serv_353 (e)
e.destObject = e.channel;
e.set = "channel";
var nicks = e.meat.split (" ");
var nicks = e.params[4].split (" ");
for (var n in nicks)
{
@ -1224,9 +1225,7 @@ function serv_chanmode (e)
CIRCServer.prototype.onNick =
function serv_nick (e)
{
/* Some irc networks send the new nick in the meat, some send it in param[1]
* Handle both cases. */
var newNick = (e.meat) ? e.meat : e.params[1];
var newNick = e.params[1];
var newKey = newNick.toLowerCase();
var oldKey = e.user.nick;
var ev;
@ -1283,16 +1282,16 @@ function serv_quit (e)
ev.user = e.server.channels[c].users[e.user.nick];
ev.channel = e.server.channels[c];
ev.server = ev.channel.parent;
ev.reason = e.meat;
ev.reason = e.params[1];
this.parent.eventPump.addEvent(ev);
delete e.server.channels[c].users[e.user.nick];
}
}
this.users[e.user.nick].lastQuitMessage = e.meat;
this.users[e.user.nick].lastQuitMessage = e.params[1];
this.users[e.user.nick].lastQuitDate = new Date;
e.reason = e.meat;
e.reason = e.params[1];
e.destObject = e.user;
e.set = "user";
@ -1325,7 +1324,7 @@ function serv_kick (e)
delete e.channel.users[e.lamer.nick];
if (userIsMe(e.lamer))
e.channel.active = false;
e.reason = e.meat;
e.reason = e.params[3];
e.destObject = e.channel;
e.set = "channel";
@ -1337,7 +1336,7 @@ CIRCServer.prototype.onJoin =
function serv_join (e)
{
e.channel = new CIRCChannel (this, (e.meat ? e.meat : e.params[1]));
e.channel = new CIRCChannel (this, e.params[1]);
if (e.user == this.me)
e.server.sendData ("MODE " + e.channel.encodedName + "\n" /* +
"BANS " + e.channel.encodedName + "\n" */);
@ -1357,14 +1356,7 @@ function serv_ping (e)
{
/* non-queued send, so we can calcualte lag */
if (e.meat)
{
this.connection.sendData ("PONG :" + e.meat + "\n");
}
else
{
this.connection.sendData ("PONG :" + e.params[e.params.length - 1] + "\n");
}
this.connection.sendData ("PONG :" + e.params[1] + "\n");
this.connection.sendData ("PING :LAGTIMER\n");
this.lastPing = this.lastPingSent = new Date();
@ -1378,7 +1370,7 @@ function serv_ping (e)
CIRCServer.prototype.onPong =
function serv_pong (e)
{
if (e.meat != "LAGTIMER")
if (e.params[2] != "LAGTIMER")
return true;
if (this.lastPingSent)
@ -1412,7 +1404,7 @@ function serv_notice (e)
e.replyTo = e.channel;
e.set = "channel";
}
else if (e.meat.search (/\x01.*\x01/i) != -1)
else if (e.params[2].search (/\x01.*\x01/i) != -1)
{
e.type = "ctcp-reply";
e.destMethod = "onCTCPReply";
@ -1452,7 +1444,7 @@ function serv_privmsg (e)
e.replyTo = e.user; /* send replys to the user who sent the message */
}
if (e.meat.search (/\x01.*\x01/i) != -1)
if (e.params[2].search (/\x01.*\x01/i) != -1)
{
e.type = "ctcp";
e.destMethod = "onCTCP";
@ -1469,7 +1461,7 @@ function serv_privmsg (e)
CIRCServer.prototype.onCTCPReply =
function serv_ctcpr (e)
{
var ary = e.meat.match (/^\x01(\S+) ?(.*)\x01$/i);
var ary = e.params[2].match (/^\x01(\S+) ?(.*)\x01$/i);
if (ary == null)
return false;
@ -1512,7 +1504,7 @@ function serv_ctcpr (e)
CIRCServer.prototype.onCTCP =
function serv_ctcp (e)
{
var ary = e.meat.match (/^\x01(\S+) ?(.*)\x01$/i);
var ary = e.params[2].match (/^\x01(\S+) ?(.*)\x01$/i);
if (ary == null)
return false;

View File

@ -763,11 +763,11 @@ function onInputKeyPress (e)
switch (e.keyCode)
{
case 13: /* CR */
e.line = stringTrim(e.target.value);
if (!e.line)
e.line = e.target.value;
e.target.value = "";
if (e.line.search(/\S/) == -1)
return;
onInputCompleteLine (e);
e.target.value = "";
break;
case 38: /* up */
@ -1352,7 +1352,7 @@ function cli_testdisplay (e)
client.currentObject.display (getMsg("cli_testdisplayMsg5"), "USAGE");
client.currentObject.display (getMsg("cli_testdisplayMsg6"), "STATUS");
if (o.server && o.server.me)
if ("server" in o && o.server.me)
{
var me = o.server.me;
var viewType = client.currentObject.TYPE;
@ -1394,6 +1394,8 @@ function cli_testdisplay (e)
"PRIVMSG", sampleUser, me);
client.currentObject.display (unescape(getMsg("cli_testdisplayMsg21")),
"PRIVMSG", sampleUser, me);
client.currentObject.display (unescape(getMsg("cli_testdisplayMsg22")),
"PRIVMSG", sampleUser, me);
if (viewType == "IRCChannel")
@ -2609,11 +2611,14 @@ function my_unknown (e)
e.params.shift(); /* and the dest. nick (always me) */
/* if it looks like some kind of "end of foo" code, and we don't
* already have a mapping for it, make one up */
if (!(e.code in client.responseCodeMap) && e.meat.search (/^end of/i) != -1)
var length = e.params.length;
if (!(e.code in client.responseCodeMap) &&
(e.params[length - 1].search (/^end of/i) != -1))
{
client.responseCodeMap[e.code] = "---";
}
this.display (e.params.join(" ") + ": " + e.meat,
e.code.toUpperCase());
this.display (e.params.join(" "), e.code.toUpperCase());
}
CIRCNetwork.prototype.on001 = /* Welcome! */
@ -2633,7 +2638,7 @@ CIRCNetwork.prototype.on372 = /* MOTD line */
CIRCNetwork.prototype.on376 = /* end of MOTD */
function my_showtonet (e)
{
var p = (2 in e.params) ? e.params[2] + " " : "";
var p = (3 in e.params) ? e.params[2] + " " : "";
var str = "";
switch (e.code)
@ -2661,7 +2666,16 @@ function my_showtonet (e)
}
delete this.pendingURLs;
}
str = e.meat;
for (var v in client.viewsArray)
{
// reconnect to any existing views
var source = client.viewsArray[v].source;
var details = getObjectDetails(client.viewsArray[v].source);
if ("network" in details && details.network == this)
gotoIRCURL(source.getURL());
}
str = e.params[2];
break;
case "372":
@ -2672,7 +2686,8 @@ function my_showtonet (e)
/* no break */
default:
str = e.meat;
var length = e.params.length;
str = e.params[length - 1];
break;
}
@ -2691,13 +2706,13 @@ function my_ctcprunk (e)
CIRCNetwork.prototype.onNotice =
function my_notice (e)
{
this.display (e.meat, "NOTICE", this, e.server.me);
this.display (e.params[2], "NOTICE", this, e.server.me);
}
CIRCNetwork.prototype.on303 = /* ISON (aka notify) reply */
function my_303 (e)
{
var onList = stringTrim(e.meat.toLowerCase()).split(/\s+/);
var onList = stringTrim(e.params[1].toLowerCase()).split(/\s+/);
var offList = new Array();
var newArrivals = new Array();
var newDepartures = new Array();
@ -2792,8 +2807,8 @@ function my_321 (e)
{
if (list.event323)
{
network.displayHere (list.event323.params.join(" ") + ": " +
list.event323.meat, "323");
var length = list.event323.params.length;
network.displayHere (list.event323.params[length - 1], "323");
}
network.displayHere (getMsg("my_323", [list.displayed, list.count]),
"INFO");
@ -2810,7 +2825,7 @@ function my_321 (e)
this.list = new Array();
this.list.regexp = null;
}
this.displayHere (e.params[2] + " " + e.meat, "321");
this.displayHere (e.params[2] + " " + e.params[3], "321");
if (client.currentObject != this)
client.currentObject.display (getMsg("my_321", this.name), "INFO");
this.list.lastLength = 0;
@ -2839,9 +2854,9 @@ function my_listrply (e)
++this.list.count;
e.params[2] = toUnicode(e.params[2]);
if (!(this.list.regexp) || e.params[2].match(this.list.regexp)
|| e.meat.match(this.list.regexp))
|| e.params[4].match(this.list.regexp))
{
this.list.push([e.params[2], e.params[3], e.meat]);
this.list.push([e.params[2], e.params[3], e.params[4]]);
}
}
@ -2865,7 +2880,8 @@ function my_352 (e)
//5-irc.mozilla.org 6-rginda 7-H
var desc;
var hops = "?";
var ary = e.meat.match(/(\d+)\s(.*)/);
var length = e.params.length;
var ary = e.params[length - 1].match(/(\d+)\s(.*)/);
if (ary)
{
hops = Number(ary[1]);
@ -2873,7 +2889,7 @@ function my_352 (e)
}
else
{
desc = e.meat;
desc = e.params[length - 1];
}
var status = e.params[7];
@ -2906,17 +2922,17 @@ function my_whoisreply (e)
{
case 311:
text = getMsg("my_whoisreplyMsg",
[nick, e.params[3], e.params[4], e.meat]);
[nick, e.params[3], e.params[4], e.params[6]]);
break;
case 319:
var ary = stringTrim(e.meat).split(" ");
var ary = stringTrim(e.params[3]).split(" ");
text = getMsg("my_whoisreplyMsg2",[nick, arraySpeak(ary)]);
break;
case 312:
text = getMsg("my_whoisreplyMsg3",
[nick, e.params[3], e.meat]);
[nick, e.params[3], e.params[4]]);
break;
case 317:
@ -2953,7 +2969,7 @@ CIRCNetwork.prototype.onInvite = /* invite message */
function my_invite (e)
{
this.display (getMsg("my_Invite", [e.user.properNick, e.user.name,
e.user.host, e.meat]), "INVITE");
e.user.host, e.params[2]]), "INVITE");
}
CIRCNetwork.prototype.on433 = /* nickname in use */
@ -3000,7 +3016,7 @@ function my_neterror (e)
}
}
else
msg = e.meat;
msg = e.params[e.params.length - 1];
this.display (msg, "ERROR");
}
@ -3011,6 +3027,7 @@ function my_netdisconnect (e)
{
var connection = e.server.connection;
var msg;
var reconnect = false;
if (typeof e.disconnectStatus != "undefined")
{
@ -3039,6 +3056,7 @@ function my_netdisconnect (e)
default:
msg = getMsg("my_netdisconnectConnectionClosedStatus",
[this.name, connection.host, connection.port]);
reconnect = true;
break;
}
}
@ -3119,15 +3137,15 @@ CIRCChannel.prototype.onPrivmsg =
function my_cprivmsg (e)
{
this.display (e.meat, "PRIVMSG", e.user, this);
this.display (e.params[2], "PRIVMSG", e.user, this);
if ((typeof client.prefix == "string") &&
e.meat.indexOf (client.prefix) == 0)
e.params[2].indexOf (client.prefix) == 0)
{
try
{
var v = eval(e.meat.substring (client.prefix.length,
e.meat.length));
var v = eval(e.params[2].substring (client.prefix.length,
e.params[2].length));
}
catch (ex)
{
@ -3180,7 +3198,7 @@ function my_366 (e)
if ("pendingNamesReply" in e.channel)
{
display (e.meat, "366");
display (e.params[3], "366");
e.channel.pendingNamesReply = false;
}
}
@ -3221,14 +3239,14 @@ CIRCChannel.prototype.on353 = /* names reply */
function my_topic (e)
{
if ("pendingNamesReply" in e.channel)
e.channel.display (e.meat, "NAMES");
e.channel.display (e.params[4], "NAMES");
}
CIRCChannel.prototype.onNotice =
function my_notice (e)
{
this.display (e.meat, "NOTICE", e.user, this);
this.display (e.params[2], "NOTICE", e.user, this);
}
CIRCChannel.prototype.onCTCPAction =
@ -3414,7 +3432,7 @@ function my_cprivmsg (e)
setCurrentObject(tab);
}
}
this.display (e.meat, "PRIVMSG", e.user, e.server.me);
this.display (e.params[2], "PRIVMSG", e.user, e.server.me);
}
CIRCUser.prototype.onNick =
@ -3432,7 +3450,7 @@ function my_unick (e)
CIRCUser.prototype.onNotice =
function my_notice (e)
{
this.display (e.meat, "NOTICE", this, e.server.me);
this.display (e.params[2], "NOTICE", this, e.server.me);
}
CIRCUser.prototype.onCTCPAction =

View File

@ -22,14 +22,13 @@
<tr class="msg" msg-type="NOTICE" msg-user="moznet" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="NOTICE" msg-user="moznet" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">===</span></td><td class="msg-data" msg-type="NOTICE" msg-user="moznet" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><span>*** Your host is irc.mozilla.org[irc.mozilla.org/6667], running version 2.8/hybrid-6.0</span></td></tr>
<tr class="msg" msg-type="250" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="250" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">===</span></td><td class="msg-data" msg-type="250" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span>: Highest connection count: 417 (417 clients) (269041 since server was (re)started)</span></td></tr>
<tr class="msg" msg-type="JOIN" msg-user="ME!" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="JOIN" msg-user="ME!" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">--&gt;|</span></td><td class="msg-data" msg-type="JOIN" msg-user="ME!" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span>YOU have joined #mozilla</span></td></tr>
<tr class="msg" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">=-=</span></td><td class="msg-data" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span>Topic for #mozilla is ``&lt;pinkerton&gt; f**k me''</span></td></tr>
<tr class="msg" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">=-=</span></td><td class="msg-data" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span>Topic for #mozilla is ``&lt;pinkerton&gt; something crude''</span></td></tr>
<tr class="msg" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">=-=</span></td><td class="msg-data" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span>Topic for #mozilla was set by dmose on Thu Jul 12 12:03:59 GMT-0700 (PDT) 2001</span></td></tr>
<tr class="msg" msg-type="JOIN" msg-user="illsleydc" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="JOIN" msg-user="illsleydc" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">--&gt;|</span></td><td class="msg-data" msg-type="JOIN" msg-user="illsleydc" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span>illsleydc (<a href="mailto:illsleydc@usr2574-kno.cableinet.co.uk" class="chatzilla-link">illsleydc@usr2574-kno.cableinet.co.uk</a>) has joined #mozilla</span></td></tr>
<tr class="msg" msg-type="JOIN" msg-user="fantasai" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 14:11" class="msg-type" msg-type="JOIN" msg-user="fantasai" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">--&gt;|</span></td><td class="msg-data" msg-type="JOIN" msg-user="fantasai" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span>fantasai (<a href="mailto:fantasai@escape.com" class="chatzilla-link">fantasai@escape.com</a>) has joined #mozilla</span></td></tr>
<tr class="msg" msg-type="JOIN" msg-user="walk84_" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 14:11" class="msg-type" msg-type="JOIN" msg-user="walk84_" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">--&gt;|</span></td><td class="msg-data" msg-type="JOIN" msg-user="walk84_" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span>walk84_ (<a href="mailto:walk84@tc0-193.stn.bluemarble.net" class="chatzilla-link">walk84@tc0-193.stn.bluemarble.net</a>) has joined #mozilla</span></td></tr>
<tr class="msg" msg-type="PRIVMSG" msg-user="fantasai" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 14:12" class="msg-user" msg-type="PRIVMSG" msg-user="fantasai" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">fantasai</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="fantasai" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>Hixie: ping</span></td></tr>
<tr class="msg" msg-type="NICK" msg-user="akkpit" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:13" class="msg-type" msg-type="NICK" msg-user="akkpit" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">=-=</span></td><td class="msg-data" msg-type="NICK" msg-user="akkpit" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>akk is now known as akkPit</span></td></tr>
<tr class="msg" msg-type="PRIVMSG" msg-user="bengoodger" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:14" class="msg-user" msg-type="PRIVMSG" msg-user="bengoodger" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">BenGoodger</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="bengoodger" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>does the matrix include a hot baby?</span></td></tr>
<tr class="msg" msg-type="ACTION" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:14" class="msg-user" msg-type="ACTION" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">pinkerton</span></td><td class="msg-data" msg-type="ACTION" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>notices the tipic</span></td></tr>
<tr class="msg" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:14" class="msg-user" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">pinkerton</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>er, topic</span></td></tr>
<tr class="msg" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:14" class="msg-user" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">pinkerton</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>hey ben</span></td></tr>
@ -70,7 +69,7 @@
<tr class="msg" msg-type="KICK" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="KICK" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">=-=</span></td><td class="msg-data" msg-type="KICK" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Sample Kick message</span></td></tr>
<tr class="msg" msg-type="QUIT" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="QUIT" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">|&lt;--</span></td><td class="msg-data" msg-type="QUIT" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Sample Quit message</span></td></tr>
<tr class="msg" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" important="true"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" important="true"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" important="true" mark="even"><span>rgindafoo : Sample /stalk match.</span></td></tr>
<tr class="msg" msg-type="PRIVMSG" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">rgindaFOO</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Sample text styles <span class="chatzilla-bold">*bold*<img></span>, <span class="chatzilla-underline">_underline_<img></span>, <span class="chatzilla-italic">/italic/<img></span>, <span class="chatzilla-teletype">|teletype|<img></span>, <a href="irc://moznet/#SmallCap#" class="chatzilla-link">#SmallCap#</a> message.</span></td></tr>
<tr class="msg" msg-type="PRIVMSG" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">rgindaFOO</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Sample text styles <span class="chatzilla-bold">*bold*<img></span>, <span class="chatzilla-underline">_underline_<img></span>, <span class="chatzilla-italic">/italic/<img></span>, <span class="chatzilla-teletype">|teletype|<img></span>, message.</span></td></tr>
</tbody>
</table>
</body>

View File

@ -42,7 +42,7 @@
<![CDATA[
var _elementIDs = ["czNickname", "czUsername", "czDesc",
"czNotify", "czDisplayCollapse", "czDisplayCopyMsgs",
"czNickCompleteStr"];
"czReconnect", "czNickCompleteStr"];
]]>
</script>
@ -73,7 +73,8 @@
</rows>
</grid>
<hbox id="czUserHelpButton">
<button label="&userDetails.help.label;"
<button label="&userDetails.help.label;"
accesskey="&userDetails.help.accesskey;"
oncommand="
document.getElementById('czUserHelpButton').hidden = true;
document.getElementById('czUserHelpBox').hidden = false;
@ -95,6 +96,9 @@
<checkbox id="czDisplayCopyMsgs" label="&global.copyMsgs.label;"
accesskey="&global.copyMsgs.accesskey;" prefdefval="true"
prefstring="extensions.irc.views.copyMessages"/>
<checkbox id="czReconnect" label="&global.reconnect.label;"
accesskey="&global.reconnect.accesskey;" prefdefval="true"
prefstring="extensions.irc.reconnect"/>
<separator/>
<hbox align="center">
<label value="&global.nickCompleteStr.label;" control="czNickCompleteStr"

View File

@ -63,10 +63,10 @@
</hbox>
<hbox>
<button id="czAddStalkWords" label="&list.add.label;"
accesskey="&list.add.accesskey;"
accesskey="&list.add.stalk.accesskey;"
oncommand="listAdd('StalkWords');"/>
<button id="czDelStalkWords" label="&list.del.label;"
accesskey="&list.del.accesskey;"
accesskey="&list.del.stalk.accesskey;"
oncommand="listDelete('StalkWords');"/>
</hbox>
</groupbox>

View File

@ -60,16 +60,20 @@
prefvalue="" prefattribute="prefvalue" wsm_attributes="prefvalue"
onselect="listUpdateButtons('Scripts');"/>
<vbox>
<button id="czUpScripts" label="&list.up;" class="up"
<button id="czUpScripts" label="&list.up.label;" class="up"
accesskey="&list.up.script.accesskey;"
oncommand="listMoveUp('Scripts');"/>
<button id="czDnScripts" label="&list.dn;" class="down"
<button id="czDnScripts" label="&list.dn.label;" class="down"
accesskey="&list.dn.script.accesskey;"
oncommand="listMoveDown('Scripts');"/>
</vbox>
</hbox>
<hbox>
<button id="czAddScripts" label="&list.add;"
<button id="czAddScripts" label="&list.add.label;"
accesskey="&list.add.script.accesskey;"
oncommand="listAdd('Scripts');"/>
<button id="czDelScripts" label="&list.del;"
<button id="czDelScripts" label="&list.del.label;"
accesskey="&list.del.script.accesskey;"
oncommand="listDelete('Scripts');"/>
</hbox>
</groupbox>
@ -84,18 +88,23 @@
prefvalue="" prefattribute="prefvalue" wsm_attributes="prefvalue"
onselect="listUpdateButtons('URLs');" ondblclick="listEdit('URLs');"/>
<vbox>
<button id="czUpURLs" label="&list.up;" class="up"
<button id="czUpURLs" label="&list.up.label;" class="up"
accesskey="&list.up.server.accesskey;"
oncommand="listMoveUp('URLs');"/>
<button id="czDnURLs" label="&list.dn;" class="down"
<button id="czDnURLs" label="&list.dn.label;" class="down"
accesskey="&list.dn.server.accesskey;"
oncommand="listMoveDown('URLs');"/>
</vbox>
</hbox>
<hbox>
<button id="czAddURLs" label="&list.add;"
<button id="czAddURLs" label="&list.add.label;"
accesskey="&list.add.server.accesskey;"
oncommand="listAdd('URLs');"/>
<button id="czEditURLs" label="&list.edit;"
<button id="czEditURLs" label="&list.edit.label;"
accesskey="&list.edit.accesskey;"
oncommand="listEdit('URLs');"/>
<button id="czDelURLs" label="&list.del;"
<button id="czDelURLs" label="&list.del.label;"
accesskey="&list.del.server.accesskey;"
oncommand="listDelete('URLs');"/>
</hbox>
</groupbox>

View File

@ -31,6 +31,8 @@
-
- ***** END LICENSE BLOCK ***** -->
<!DOCTYPE window SYSTEM "chrome://chatzilla/locale/pref-irc.dtd">
<overlay id="ovCZPrefs"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@ -38,37 +40,37 @@
<treeitem container="true" id="chatzillaItem" insertbefore="advancedItem">
<treerow>
<treecell url="chrome://chatzilla/content/prefpanel/pref-irc.xul"
label="ChatZilla"/>
label="&pref-irc.window.title;"/>
</treerow>
<treechildren id="chatzillaChildren">
<treeitem>
<treerow>
<treecell url="chrome://chatzilla/content/prefpanel/startup.xul"
label="Startup"/>
label="&startup.window.title;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://chatzilla/content/prefpanel/interface.xul"
label="Interface"/>
label="&interface.window.title;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://chatzilla/content/prefpanel/appearance.xul"
label="Appearance"/>
label="&appearance.window.title;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://chatzilla/content/prefpanel/stalk.xul"
label="Stalking"/>
label="&stalk.window.title;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://chatzilla/content/prefpanel/sound.xul"
label="Sound"/>
label="&sound.window.title;"/>
</treerow>
</treeitem>
</treechildren>

View File

@ -28,6 +28,7 @@
* +- username (String) initial username (ie: username@host.tld)
* +- desc (String) initial description (used in whois info)
* +- defaultNet (String) default network to use for irc:// urls
* +- reconnect (Boolean) reconnect when disconnected due to ERROR
* +- bugURL (String) url to use for "bug 12345" links. Use %s to place
* the bug number.
* +- initialURLs (String) irc:// urls to connect to on startup, semicolon
@ -88,6 +89,7 @@ function initPrefs()
"nickname": ["CIRCNetwork.prototype.INITIAL_NICK", "IRCMonkey"],
"username": ["CIRCNetwork.prototype.INITIAL_NAME", "chatzilla"],
"desc": ["CIRCNetwork.prototype.INITIAL_DESC", "New Now Know How"],
"reconnect": ["CIRCNetwork.prototype.stayingPower", true],
"defaultNet": ["client.DEFAULT_NETWORK", "moznet"],
"charset": ["client.CHARSET", ""],
"initialURLs": ["client.INITIAL_URLS", "irc://"],

View File

@ -36,7 +36,7 @@ const MSG_UNKNOWN = getMsg ("unknown");
client.defaultNick = getMsg("defaultNick");
client.version = "0.8.13c";
client.version = "0.8.23";
client.TYPE = "IRCClient";
client.COMMAND_CHAR = "/";
@ -130,7 +130,8 @@ function ()
function ucConvertIncomingMessage (e)
{
e.meat = toUnicode(e.meat);
var length = e.params.length;
e.params[length - 1] = toUnicode(e.params[length - 1]);
return true;
}
@ -412,10 +413,28 @@ function initHost(obj)
false /* disable */);
}
obj.linkRE = /((\w+):[^<>\[\]()\'\"\s]+|www(\.[^.<>\[\]()\'\"\s]+){2,})/;
obj.linkRE =
/((\w[\w-]+):[^<>\[\]()\'\"\s]+|www(\.[^.<>\[\]()\'\"\s]+){2,})/;
obj.munger = new CMunger();
obj.munger.enabled = true;
obj.munger.addRule ("quote", /(``|'')/, insertQuote);
obj.munger.addRule ("bold", /(?:\s|^)(\*[^*()]*\*)(?:[\s.,]|$)/,
"chatzilla-bold");
obj.munger.addRule ("underline", /(?:\s|^)(\_[^_()]*\_)(?:[\s.,]|$)/,
"chatzilla-underline");
obj.munger.addRule ("italic", /(?:\s|^)(\/[^\/()]*\/)(?:[\s.,]|$)/,
"chatzilla-italic");
/* allow () chars inside |code()| blocks */
obj.munger.addRule ("teletype", /(?:\s|^)(\|[^|]*\|)(?:[\s.,]|$)/,
"chatzilla-teletype");
obj.munger.addRule (".mirc-colors", /(\x03((\d{1,2})(,\d{1,2}|)|))/,
mircChangeColor);
obj.munger.addRule (".mirc-bold", /(\x02)/, mircToggleBold);
obj.munger.addRule (".mirc-underline", /(\x1f)/, mircToggleUnder);
obj.munger.addRule (".mirc-color-reset", /(\x0f)/, mircResetColor);
obj.munger.addRule (".mirc-reverse", /(\x16)/, mircReverseColor);
obj.munger.addRule ("ctrl-char", /([\x01-\x1f])/, showCtrlChar);
obj.munger.addRule ("link", obj.linkRE, insertLink);
obj.munger.addRule ("mailto",
/(?:\s|\W|^)((mailto:)?[^<>\[\]()\'\"\s]+@[^.<>\[\]()\'\"\s]+\.[^<>\[\]()\'\"\s]+)/i,
@ -431,22 +450,6 @@ function initHost(obj)
insertSmiley);
obj.munger.addRule ("ear", /(?:\s|^)(\(\*)(?:\s|$)/, insertEar, false);
obj.munger.addRule ("rheet", /(?:\s|\W|^)(rhee+t\!*)(?:\s|$)/i, insertRheet);
obj.munger.addRule ("bold", /(?:\s|^)(\*[^*,.()]*\*)(?:[\s.,]|$)/,
"chatzilla-bold");
obj.munger.addRule ("italic", /(?:\s|^)(\/[^\/,.()]*\/)(?:[\s.,]|$)/,
"chatzilla-italic");
/* allow () chars inside |code()| blocks */
obj.munger.addRule ("teletype", /(?:\s|^)(\|[^|,.]*\|)(?:[\s.,]|$)/,
"chatzilla-teletype");
obj.munger.addRule ("underline", /(?:\s|^)(\_[^_,.()]*\_)(?:[\s.,]|$)/,
"chatzilla-underline");
obj.munger.addRule (".mirc-colors", /(\x03((\d{1,2})(,\d{1,2}|)|))/,
mircChangeColor);
obj.munger.addRule (".mirc-bold", /(\x02)/, mircToggleBold);
obj.munger.addRule (".mirc-underline", /(\x1f)/, mircToggleUnder);
obj.munger.addRule (".mirc-color-reset", /(\x0f)/, mircResetColor);
obj.munger.addRule (".mirc-reverse", /(\x16)/, mircReverseColor);
obj.munger.addRule ("ctrl-char", /([\x01-\x1f])/, showCtrlChar);
obj.munger.addRule ("word-hyphenator",
new RegExp ("(\\S{" + client.MAX_WORD_DISPLAY + ",})"),
insertHyphenatedWord);
@ -461,21 +464,59 @@ function initHost(obj)
function insertLink (matchText, containerTag)
{
var href;
var linkText;
if (matchText.match (/^[a-zA-Z-]+:/))
href = matchText;
var trailing;
ary = matchText.match(/([.,]+)$/);
if (ary)
{
linkText = RegExp.leftContext;
trailing = ary[1];
}
else
href = "http://" + matchText;
{
linkText = matchText;
}
var ary = linkText.match (/^(\w[\w-]+):/);
if (ary)
{
if (!("schemes" in client))
{
var pfx = "@mozilla.org/network/protocol;1?name=";
var len = pfx.length
client.schemes = new Object();
for (var c in Components.classes)
{
if (c.indexOf(pfx) == 0)
client.schemes[c.substr(len)] = true;
}
}
if (!(ary[1] in client.schemes))
{
insertHyphenatedWord(matchText, containerTag);
return;
}
href = linkText;
}
else
{
href = "http://" + linkText;
}
var anchor = document.createElementNS ("http://www.w3.org/1999/xhtml",
"html:a");
anchor.setAttribute ("href", href);
anchor.setAttribute ("class", "chatzilla-link");
anchor.setAttribute ("target", "_content");
insertHyphenatedWord (matchText, anchor);
insertHyphenatedWord (linkText, anchor);
containerTag.appendChild (anchor);
if (trailing)
insertHyphenatedWord (trailing, containerTag);
}
@ -553,6 +594,14 @@ function insertRheet (matchText, containerTag)
containerTag.appendChild (anchor);
}
function insertQuote (matchText, containerTag)
{
if (matchText == "``")
containerTag.appendChild(document.createTextNode("\u201c"));
else
containerTag.appendChild(document.createTextNode("\u201d"));
}
function insertEar (matchText, containerTag)
{
if (client.smileyText)
@ -707,6 +756,12 @@ function showCtrlChar(c, containerTag)
var span = document.createElementNS ("http://www.w3.org/1999/xhtml",
"html:span");
span.setAttribute ("class", "chatzilla-control-char");
if (c == "\t")
{
containerTag.appendChild(document.createTextNode(c));
return;
}
var ctrlStr = c.charCodeAt(0).toString(16);
if (ctrlStr.length < 2)
ctrlStr = "0" + ctrlStr;
@ -1587,7 +1642,15 @@ function multilineInputMode (state)
function focusInput ()
{
client.input.focus();
const WWATCHER_CTRID = "@mozilla.org/embedcomp/window-watcher;1";
const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher;
var watcher =
Components.classes[WWATCHER_CTRID].getService(nsIWindowWatcher);
if (watcher.activeWindow == window)
client.input.focus();
else
document.commandDispatcher.focusedElement = client.input;
}
function newInlineText (data, className, tagName)

View File

@ -143,6 +143,12 @@ function mng_munge (text, containerTag, data)
subTag.setAttribute ("class", newClass);
/* don't let this rule match again */
this.entries[entry].enabled = false;
this.munge(ary[1], subTag, data);
this.entries[entry].enabled = true;
/*
var wordParts = splitLongWord (ary[1],
client.MAX_WORD_DISPLAY);
for (var i in wordParts)
@ -152,8 +158,10 @@ function mng_munge (text, containerTag, data)
"html:wbr");
subTag.appendChild (wbr);
}
*/
containerTag.appendChild (subTag);
this.munge (text.substr (startPos + ary[1].length,
text.length), containerTag,
data);

View File

@ -303,6 +303,7 @@ cli_testdisplayMsg18=Sample Quit message, <http://testurl.com/foo.html>.
cli_testdisplayMsg19=%S : Sample /stalk match, <http://testurl.com/foo.html>.
cli_testdisplayMsg20=Sample control char >%01<\\1 -- >%05<\\5 -- >%10<\\10
cli_testdisplayMsg21=Sample color %033c%034o%034l%033o%033r%034%20%036t%036e%032s%034t%0f message.
cli_testdisplayMsg22=Sample ``double quote'' message.
cli_inetworkMsg=Unknown network ``%S''
cli_listNetworks.a=Available networks are [
cli_listNetworks.b=].
@ -411,6 +412,7 @@ rule_channel-link=IRC channel
rule_bugzilla-link=Bugzilla link
rule_face=Face
rule_ear=Ear
rule_quote=Double Quotes
rule_rheet=Rheet
rule_bold=Bold
rule_italic=Italic

View File

@ -63,6 +63,7 @@
<!ENTITY userDetails.title "User Identification">
<!ENTITY userDetails.help.label "What do these mean?">
<!ENTITY userDetails.help.accesskey "W">
<!ENTITY userDetails.help.desc "Your hostmask, which is used to identify you to other clients and the server, places your user name before the host you are connecting from. So a user name of 'myself' would mean you would be identified as 'myself@host.tld', where 'host.tld' would be dependant on your internet service provider.">
<!ENTITY userDetails.nick.label "Nick name:">
@ -80,6 +81,8 @@
<!ENTITY global.collapse.accesskey "c">
<!ENTITY global.copyMsgs.label "Copy important messages to the network tab">
<!ENTITY global.copyMsgs.accesskey "i">
<!ENTITY global.reconnect.label "Automatically reconnect after a disconnect">
<!ENTITY global.reconnect.accesskey "r">
<!ENTITY global.nickCompleteStr.label "Nickname completion string:">
<!ENTITY global.nickCompleteStr.accesskey "k">
<!ENTITY global.nickCompleteStr.desc "This is appended to a nickname when tab-completed as the first word.">
@ -133,13 +136,26 @@
<!ENTITY stalkWords.label1 "When ChatZilla sees an 'important' message, it will highlight the line and the channel's tab. If you have 'aggressive notify' enabled, ChatZilla will also use an OS-dependant method to grab your attention.">
<!ENTITY stalkWords.label2 "Your nickname is always considered 'important', but you can add more words; just add them to the list below.">
<!ENTITY list.up "Move Up">
<!ENTITY list.dn "Move Down">
<!ENTITY list.up.label "Move Up">
<!ENTITY list.up.script.accesskey "U">
<!ENTITY list.up.server.accesskey "v">
<!ENTITY list.dn.label "Move Down">
<!ENTITY list.dn.script.accesskey "w">
<!ENTITY list.dn.server.accesskey "n">
<!ENTITY list.add.label "Add...">
<!ENTITY list.add.accesskey "A">
<!ENTITY list.edit "Edit...">
<!ENTITY list.add.script.accesskey "A">
<!ENTITY list.add.server.accesskey "d">
<!ENTITY list.add.stalk.accesskey "A">
<!ENTITY list.edit.label "Edit...">
<!ENTITY list.edit.accesskey "E">
<!ENTITY list.del.label "Remove">
<!ENTITY list.del.accesskey "R">
<!ENTITY list.del.script.accesskey "R">
<!ENTITY list.del.server.accesskey "m">
<!ENTITY list.del.stalk.accesskey "m">
<!ENTITY startup.window.title "Startup">
<!ENTITY startupOrder.label "When ChatZilla starts, it will load the JavaScript scripts first, then connect to any autoconnect servers and channels in the order shown.">
@ -149,11 +165,6 @@
<!ENTITY autoURLs.title "Autoconnect servers, channels and private message views">
<!ENTITY autoURLs.accesskey "c">
<!ENTITY list.up "Move Up">
<!ENTITY list.dn "Move Down">
<!ENTITY list.add "Add...">
<!ENTITY list.edit "Edit...">
<!ENTITY list.del "Remove">
<!ENTITY startup-newScript.window.title "ChatZilla Script Item">
<!ENTITY text.desc "Enter a web location (URL), or specify the local script file you want:">