-- CHATZILLA CHANGES ONLY --

* test3-handlers.js
  Map function keys to available views

* test3-readprefs.js
  Removed debugging output.

* test3-static.js
  Wiring for fn key->view mapping
  Tweak smiley regexp to require spaces on each side.
  Ignore view change if new view == current view
  Apply munger rules on TOPIC messages in addition to PRIVMSG and ACTIONs
This commit is contained in:
rginda%netscape.com 1999-12-03 06:24:29 +00:00
parent 87f3583410
commit 92b8ee0132
3 changed files with 52 additions and 6 deletions

View File

@ -104,6 +104,34 @@ function onInputKeyUp (e)
}
function onWindowKeyPress (e)
{
var code = Number (e.keyCode)
switch (code)
{
case 112: /* F1 */
case 113: /* ... */
case 114:
case 115:
case 116:
case 117:
case 118:
case 119:
case 120:
case 121: /* F10 */
var idx = code - 112;
if ((client.viewsArray[idx]) && (client.viewsArray[idx].source))
setCurrentObject(client.viewsArray[idx].source);
return false;
break;
default:
}
}
function onInputCompleteLine(e)
{

View File

@ -54,7 +54,6 @@ function getCharPref (prefObj, prefName, defaultValue)
}
catch (e)
{
dd ("Reading pref '" + prefName + "' threw '" + e + "'");
return defaultValue;
}
}

View File

@ -45,7 +45,6 @@ client.PRINT_DIRECTION = 1; /*1 => new messages at bottom, -1 => at top */
client.name = "*client*";
client.viewsArray = new Array();
client.currentObject = client;
client.lastListType = "chan-users";
CIRCNetwork.prototype.INITIAL_NICK = "IRCMonkey";
@ -76,7 +75,7 @@ function initStatic()
obj = document.getElementById("input");
obj.onkeyup = onInputKeyUp;
obj = document.getElementById("tb[*client*]");
client.quickList = new CListBox(document.getElementById("quickList"));
@ -92,6 +91,8 @@ function initStatic()
client.PRINT_DIRECTION = saveDir;
setCurrentObject (client);
window.onkeypress = onWindowKeyPress;
}
@ -132,7 +133,8 @@ function initHost(obj)
("link", /((http|mailto|ftp)\:\/\/[^\)\s]*|www\.\S+\.\S[^\)\s]*)/,
insertLink);
obj.munger.addRule
("face", /([\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\])/,
("face",
/((^|\s)[\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/,
insertSmiley);
obj.munger.addRule ("rheet", /(rhe+t\!*)/i, "rheet");
obj.munger.addRule ("bold", /(\*.*\*)/, "bold");
@ -400,7 +402,14 @@ function setCurrentObject (obj)
return false;
}
var tb = getTBForObject(client.currentObject);
if (client.currentObject == obj)
return true;
var tb;
if (client.currentObject)
tb = getTBForObject(client.currentObject);
if (tb)
tb.setAttribute ("src", client.NACT_IMG);
@ -423,6 +432,9 @@ function setCurrentObject (obj)
updateNetwork();
updateChannel();
if (client.PRINT_DIRECTION == 1)
window.frames[0].scrollTo(0, 100000);
}
@ -506,6 +518,13 @@ function getTBForObject (source, create)
{
var name;
if (!source)
{
dd ("** UNDEFINED passed to getTBForObject **");
dd (getStackTrace());
return;
}
create = (typeof create != "undefined") ? Boolean(create) : false;
switch (source.TYPE)
@ -909,7 +928,7 @@ function chan_display (message, msgtype, nick)
for (var l in ary)
{
if (msgtype.search (/PRIVMSG|ACTION/) != -1)
if (msgtype.search (/PRIVMSG|ACTION|TOPIC/) != -1)
client.munger.munge(ary[l], msgData, getObjectDetails (this));
else
msgData.appendChild(newInlineText (ary[l]));