Makefile updates to install test3 on unix/win (win not tested)
paths fixed in test3.xul
help message added to test3-static.js
initialize the client object before the help message is displayed in test3-handlers.js
fix to keys() in utils.js to prevent trailing comma
This commit is contained in:
rginda%ndcico.com 1999-09-14 00:27:34 +00:00
Родитель ba19c8fc63
Коммит 98975be650
8 изменённых файлов: 145 добавлений и 12 удалений

Просмотреть файл

@ -19,6 +19,13 @@
# Contributor(s):
# Robert Ginda, rginda@ndcico.com, original author
#
# Large LED icons (green-*, red-*, yellow-*) and Marble background (xtal.jpg)
# Copyright (C) 1996, 1997 Jim Evins.
# http://www.clark.net/pub/evins/Icons/
#
# Other Icons came from "Anthony's WWW Images"
# http://www.cit.gu.edu.au/images/Images.html
#
DEPTH = ../..
topsrcdir = @top_srcdir@
@ -36,10 +43,12 @@ JSLIBFILES = \
$(srcdir)/js/lib/events.js \
$(srcdir)/js/lib/connection-xpcom.js \
$(srcdir)/js/lib/irc.js \
$(srcdir)/js/lib/irc-debug.js \
$(NULL)
XULLIBFILES = \
$(srcdir)/xul/lib/EntryHistory.js \
$(srcdir)/xul/lib/listbox.js \
$(NULL)
TESTFILES = \
@ -52,6 +61,18 @@ TESTFILES = \
$(srcdir)/xul/tests/test2-handlers.js \
$(srcdir)/xul/tests/csteel1.jpg \
$(srcdir)/xul/tests/csteel2.jpg \
$(srcdir)/xul/tests/test3.xul \
$(srcdir)/xul/tests/test3.css \
$(srcdir)/xul/tests/test3-static.js \
$(srcdir)/xul/tests/test3-handlers.js \
$(srcdir)/xul/tests/g_blue.gif \
$(srcdir)/xul/tests/g_blue_on.gif \
$(srcdir)/xul/tests/g_grey.gif \
$(srcdir)/xul/tests/g_grey_on.gif \
$(srcdir)/xul/tests/green-on.gif \
$(srcdir)/xul/tests/green-off.gif \
$(srcdir)/xul/tests/yellow-on.gif \
$(srcdir)/xul/tests/xtal.jpg \
$(NULL)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -240,7 +240,7 @@ function keys (o)
var rv = "";
for (var p in o)
rv += p + ", ";
rv += rv ? ", " + p : p;
return rv;

Просмотреть файл

@ -19,7 +19,15 @@
#
# Contributor(s):
# leaf (daniel nunes) <leaf@mozilla.org>
#
# Robert Ginda, rginda@ndcico.com, test3 updates
#
# Large LED icons (green-*, red-*, yellow-*) and Marble background (xtal.jpg)
# Copyright (C) 1996, 1997 Jim Evins.
# http://www.clark.net/pub/evins/Icons/
#
# Other Icons came from "Anthony's WWW Images"
# http://www.cit.gu.edu.au/images/Images.html
#
DEPTH =..\..
@ -32,10 +40,12 @@ JSLIBFILES = \
.\js\lib\events.js \
.\js\lib\connection-xpcom.js \
.\js\lib\irc.js \
.\js\lib\irc-debug.js \
$(NULL)
XULLIBFILES = \
.\xul\lib\EntryHistory.js \
.\xul\lib\listbox.js \
$(NULL)
TESTFILES = \
@ -48,6 +58,18 @@ TESTFILES = \
.\xul\tests\test2-handlers.js \
.\xul\tests\csteel1.jpg \
.\xul\tests\csteel2.jpg \
.\xul\tests\test3.xul \
.\xul\tests\test3.css \
.\xul\tests\test3-static.js \
.\xul\tests\test3-handlers.js \
.\xul\tests\g_blue.gif \
.\xul\tests\g_blue_on.gif \
.\xul\tests\g_grey.gif \
.\xul\tests\g_grey_on.gif \
.\xul\tests\green-on.gif \
.\xul\tests\green-off.gif \
.\xul\tests\yellow-on.gif \
.\xul\tests\xtal.jpg \
$(NULL)

Просмотреть файл

@ -0,0 +1,86 @@
function CListBox ()
{
this.listContainer = document.createElement ("html:a");
this.listContainer.setAttribute ("class", "list");
}
CListBox.prototype.clear =
function lbox_clear (e)
{
var obj = this.listContainer.firstChild;
while (obj)
{
this.listContainer.removeChild (obj);
obj = obj.nextSibling;
}
}
CListBox.prototype.clickHandler =
function lbox_chandler (e)
{
var lm = this.listManager;
e.target = this;
if (lm && typeof lm.onClick == "function")
lm.onClick ({realTarget: this, event: e});
}
CListBox.prototype.onClick =
function lbox_chandler (e)
{
dd ("onclick: \n" + dumpObjectTree (e, 1));
}
CListBox.prototype.add =
function lbox_add (stuff, tag)
{
var option = document.createElement ("html:a");
option.setAttribute ("class", "list-option");
option.appendChild (stuff);
option.appendChild (document.createElement("html:br"));
option.onclick = this.clickHandler;
option.listManager = this;
option.tag = tag;
this.listContainer.appendChild (option);
}
CListBox.prototype.remove =
function lbox_remove (stuff)
{
var option = this.listContainer.firstChild;
while (option)
{
if (option.firstChild == stuff)
{
this.container.removeChild (option);
return true;
}
option = option.nextSibling;
}
return false;
}
CListBox.prototype.enumerateElements =
function lbox_enum (callback)
{
var i = 0;
var current = this.listContainer.firstChild;
while (current)
{
callback (current, i++);
current = current.nextSibling;
}
}

Просмотреть файл

@ -2,8 +2,8 @@
function onLoad()
{
initStatic();
initHost(client);
initStatic();
mainStep();
}
@ -189,8 +189,8 @@ function clie_inetwork (e)
}
client.onInputConnect =
function cli_iconnect (e)
client.onInputAttach =
function cli_iattach (e)
{
var net;
@ -207,7 +207,7 @@ function cli_iconnect (e)
{
client.display ("No network specified, and no default network " +
"is in place.", "ERROR");
client.display ("connect <network-name>.", "USAGE");
client.display ("attach <network-name>.", "USAGE");
return false;
}
}

Просмотреть файл

@ -44,7 +44,12 @@ function initStatic()
client.quickList = new CListBox(document.getElementById("quickList"));
client.display ("Welcome to ChatZilla", "HELP");
client.display ("More help is on the way!", "HELP");
client.display ("/nick, /join, /part, and /me may also be useful.", "HELP");
client.display ("Where <network-name> is one of [" +
keys (client.networks) + "]", "HELP");
client.display ("Use /attach <network-name> connect to a network.", "HELP");
client.display ("Welcome to ChatZilla...", "HELP");
setCurrentObject (client);
}

Просмотреть файл

@ -16,12 +16,11 @@ file:/home/rginda/src/mozilla_DEV/mozilla/extensions/irc/xul/tests/test3.xul
<html:script src="resource:///irc/js/lib/connection-xpcom.js"/>
<html:script src="resource:///irc/js/lib/events.js"/>
<html:script src="resource:///irc/js/lib/irc.js"/>
<html:script src="resource:///irc/js/lib/irc-debug.js"/>
<html:script src="resource:///irc/xul/lib/listbox.js"/>
<html:script src="../lib/listbox.js"/>
<html:script src="../../js/lib/irc-debug.js"/>
<html:script src="test3-static.js"/>
<html:script src="test3-handlers.js"/>
<html:script src="resource:///irc/tests/test3-static.js"/>
<html:script src="resource:///irc/tests/test3-handlers.js"/>
<toolbox>
<menubar>

Просмотреть файл