зеркало из https://github.com/mozilla/pjs.git
- chatzilla only -
add James Ross' pref panel, bug 23265 rework pref code to be table driven add pref observer to watch for prefs changed from outside chatzilla make the keyboard shortcut for ``Leave Channel'' and ``Close View'' Accel+W, bug 122782 add UI for the multiline input mode, bug 149588 add tab completion for channel names, bug 131633 fix bug where networks added from a startup script didn't show in the list displayed in the *client* tab at startup. adds key= and pass= parameters to irc: urls, bug 187699 fix ``secret'' channel mode, bug 184244
This commit is contained in:
Родитель
33228f561b
Коммит
5f1a26c873
|
@ -23,6 +23,29 @@ chatzilla.jar:
|
|||
content/chatzilla/output-base.css (xul/content/output-base.css)
|
||||
content/chatzilla/chatzillaOverlay.xul (xul/content/chatzillaOverlay.xul)
|
||||
content/chatzilla/chatzillaOverlay.js (xul/content/chatzillaOverlay.js)
|
||||
content/chatzilla/prefsOverlay.xul (xul/content/prefsOverlay.xul)
|
||||
content/chatzilla/pref-irc.xul (xul/content/pref-irc.xul)
|
||||
content/chatzilla/pref-irc.js (xul/content/pref-irc.js)
|
||||
content/chatzilla/pref-irc-appearance.js (xul/content/pref-irc-appearance.js)
|
||||
content/chatzilla/pref-irc-appearance.css (xul/content/pref-irc-appearance.css)
|
||||
content/chatzilla/pref-irc-appearance.xul (xul/content/pref-irc-appearance.xul)
|
||||
content/chatzilla/pref-irc-interface.js (xul/content/pref-irc-interface.js)
|
||||
content/chatzilla/pref-irc-interface.xul (xul/content/pref-irc-interface.xul)
|
||||
content/chatzilla/pref-irc-sound.js (xul/content/pref-irc-sound.js)
|
||||
content/chatzilla/pref-irc-sound.xul (xul/content/pref-irc-sound.xul)
|
||||
content/chatzilla/pref-irc-stalk.js (xul/content/pref-irc-stalk.js)
|
||||
content/chatzilla/pref-irc-stalk.xul (xul/content/pref-irc-stalk.xul)
|
||||
content/chatzilla/pref-irc-startup.js (xul/content/pref-irc-startup.js)
|
||||
content/chatzilla/pref-irc-startup.xul (xul/content/pref-irc-startup.xul)
|
||||
content/chatzilla/pref-irc-startup-newScript.js (xul/content/pref-irc-startup-newScript.js)
|
||||
content/chatzilla/pref-irc-startup-newScript.xul (xul/content/pref-irc-startup-newScript.xul)
|
||||
content/chatzilla/pref-irc-startup-newURL.js (xul/content/pref-irc-startup-newURL.js)
|
||||
content/chatzilla/pref-irc-startup-newURL.xul (xul/content/pref-irc-startup-newURL.xul)
|
||||
content/chatzilla/pref-irc-appearance-previewCSS.html (xul/content/pref-irc-appearance-previewCSS.html)
|
||||
content/chatzilla/pref-irc-appearance-previewCSS.js (xul/content/pref-irc-appearance-previewCSS.js)
|
||||
content/chatzilla/pref-irc-appearance-previewCSS.xul (xul/content/pref-irc-appearance-previewCSS.xul)
|
||||
content/chatzilla/pref-irc-tabs.xul (xul/content/pref-irc-tabs.xul)
|
||||
content/chatzilla/pref-irc-text.xul (xul/content/pref-irc-text.xul)
|
||||
skin/modern/chatzilla/chatzilla.css (xul/skin/chatzilla.css)
|
||||
skin/modern/chatzilla/chatzillaOverlay.css (xul/skin/chatzillaOverlay.css)
|
||||
skin/modern/chatzilla/output-default.css (xul/skin/output-default.css)
|
||||
|
@ -44,7 +67,20 @@ chatzilla.jar:
|
|||
skin/modern/chatzilla/images/isnt-voice.gif (xul/skin/images/isnt-voice.gif)
|
||||
skin/modern/chatzilla/images/taskbar-irc.gif (xul/skin/images/taskbar-irc.gif)
|
||||
skin/modern/chatzilla/images/chatzilla-16.gif (xul/skin/images/chatzilla-16.gif)
|
||||
skin/modern/chatzilla/images/multiline-expand.png (xul/skin/images/multiline-expand.png)
|
||||
skin/modern/chatzilla/images/multiline-contract.png (xul/skin/images/multiline-contract.png)
|
||||
skin/modern/chatzilla/images/input-send.png (xul/skin/images/input-send.png)
|
||||
locale/en-US/chatzilla/chatzillaOverlay.dtd (xul/locale/en-US/chatzillaOverlay.dtd)
|
||||
locale/en-US/chatzilla/chatzilla.dtd (xul/locale/en-US/chatzilla.dtd)
|
||||
locale/en-US/chatzilla/chatzilla.properties (xul/locale/en-US/chatzilla.properties)
|
||||
locale/en-US/chatzilla/pref-irc.dtd (xul/locale/en-US/pref-irc.dtd)
|
||||
locale/en-US/chatzilla/pref-irc-appearance.dtd (xul/locale/en-US/pref-irc-appearance.dtd)
|
||||
locale/en-US/chatzilla/pref-irc-interface.dtd (xul/locale/en-US/pref-irc-interface.dtd)
|
||||
locale/en-US/chatzilla/pref-irc-sound.dtd (xul/locale/en-US/pref-irc-sound.dtd)
|
||||
locale/en-US/chatzilla/pref-irc-stalk.dtd (xul/locale/en-US/pref-irc-stalk.dtd)
|
||||
locale/en-US/chatzilla/pref-irc-startup.dtd (xul/locale/en-US/pref-irc-startup.dtd)
|
||||
locale/en-US/chatzilla/pref-irc-startup-newScript.dtd (xul/locale/en-US/pref-irc-startup-newScript.dtd)
|
||||
locale/en-US/chatzilla/pref-irc-startup-newURL.dtd (xul/locale/en-US/pref-irc-startup-newURL.dtd)
|
||||
locale/en-US/chatzilla/pref-irc-tabs.dtd (xul/locale/en-US/pref-irc-tabs.dtd)
|
||||
locale/en-US/chatzilla/pref-irc-text.dtd (xul/locale/en-US/pref-irc-text.dtd)
|
||||
locale/en-US/chatzilla/pref-irc-appearance-previewCSS.dtd (xul/locale/en-US/pref-irc-appearance-previewCSS.dtd)
|
||||
|
|
|
@ -74,11 +74,11 @@ function CLineService()
|
|||
|
||||
CLineService.prototype.commandLineArgument = "-chat";
|
||||
CLineService.prototype.prefNameForStartup = "general.startup.chat";
|
||||
CLineService.prototype.chromeUrlForTask="chrome://chatzilla/content";
|
||||
CLineService.prototype.chromeUrlForTask = "chrome://chatzilla/content";
|
||||
CLineService.prototype.helpText = "Start with an IRC chat client";
|
||||
CLineService.prototype.handlesArgs=false;
|
||||
CLineService.prototype.defaultArgs ="";
|
||||
CLineService.prototype.openWindowWithArgs=false;
|
||||
CLineService.prototype.handlesArgs = false;
|
||||
CLineService.prototype.defaultArgs = "";
|
||||
CLineService.prototype.openWindowWithArgs = false;
|
||||
|
||||
/* factory for command line handler service (CLineService) */
|
||||
var CLineFactory = new Object();
|
||||
|
@ -177,8 +177,8 @@ function (aPort, aScheme)
|
|||
IRCProtocolHandler.prototype.newURI =
|
||||
function (aSpec, aCharset, aBaseURI)
|
||||
{
|
||||
var url = Components.classes[STANDARDURL_CONTRACTID].
|
||||
createInstance(nsIStandardURL);
|
||||
var cls = Components.classes[STANDARDURL_CONTRACTID];
|
||||
var url = cls.createInstance(nsIStandardURL);
|
||||
url.init(nsIStandardURL.URLTYPE_STANDARD, 6667, aSpec, aCharset, aBaseURI);
|
||||
|
||||
return url.QueryInterface(nsIURI);
|
||||
|
|
|
@ -45,8 +45,7 @@ function toScriptableInputStream (i)
|
|||
si = si.QueryInterface(Components.interfaces.nsIScriptableInputStream);
|
||||
si.init(i);
|
||||
|
||||
return si;
|
||||
|
||||
return si;
|
||||
}
|
||||
|
||||
function CBSConnection ()
|
||||
|
@ -80,9 +79,9 @@ function bc_connect(host, port, bind, tcp_flag, observer)
|
|||
this.tcp_flag = tcp_flag;
|
||||
|
||||
// Lets get a transportInfo for this
|
||||
var pps = Components.classes["@mozilla.org/network/protocol-proxy-service;1"].
|
||||
getService().
|
||||
QueryInterface(Components.interfaces.nsIProtocolProxyService);
|
||||
var cls =
|
||||
Components.classes["@mozilla.org/network/protocol-proxy-service;1"];
|
||||
var pps = cls.getService(Components.interfaces.nsIProtocolProxyService);
|
||||
|
||||
if (!pps)
|
||||
throw ("Couldn't get protocol proxy service");
|
||||
|
@ -108,13 +107,15 @@ function bc_connect(host, port, bind, tcp_flag, observer)
|
|||
0, -1, 0);
|
||||
}
|
||||
else
|
||||
{ /* no nspr event queues in this environment, we can't use async calls,
|
||||
* so set up the streams. */
|
||||
{
|
||||
/* no nspr event queues in this environment, we can't use async
|
||||
* calls, so set up the streams. */
|
||||
this._outputStream = this._transport.openOutputStream(0, -1, 0);
|
||||
if (!this._outputStream)
|
||||
throw "Error getting output stream.";
|
||||
this._inputStream =
|
||||
toScriptableInputStream(this._transport.openInputStream (0, -1, 0));
|
||||
toScriptableInputStream(this._transport.openInputStream(0,
|
||||
-1, 0));
|
||||
if (!this._inputStream)
|
||||
throw "Error getting input stream.";
|
||||
}
|
||||
|
@ -122,7 +123,8 @@ function bc_connect(host, port, bind, tcp_flag, observer)
|
|||
else
|
||||
{
|
||||
/* use new necko interfaces */
|
||||
this._transport = this._sockService.createTransport(null, 0, host, port, info);
|
||||
this._transport = this._sockService.createTransport(null, 0, host, port,
|
||||
info);
|
||||
if (!this._transport)
|
||||
throw ("Error creating transport.");
|
||||
|
||||
|
@ -134,7 +136,8 @@ function bc_connect(host, port, bind, tcp_flag, observer)
|
|||
openFlags = Components.interfaces.nsITransport.OPEN_BLOCKING;
|
||||
|
||||
/* no limit on the output stream buffer */
|
||||
this._outputStream = this._transport.openOutputStream(openFlags, 4096, -1);
|
||||
this._outputStream =
|
||||
this._transport.openOutputStream(openFlags, 4096, -1);
|
||||
if (!this._outputStream)
|
||||
throw "Error getting output stream.";
|
||||
this._inputStream = this._transport.openInputStream(openFlags, 0, 0);
|
||||
|
@ -201,11 +204,14 @@ CBSConnection.prototype.startAsyncRead =
|
|||
function bc_saread (observer)
|
||||
{
|
||||
if (jsenv.HAS_STREAM_PROVIDER)
|
||||
this._transport.asyncRead (new StreamListener (observer), this, 0, -1, 0);
|
||||
{
|
||||
this._transport.asyncRead (new StreamListener (observer),
|
||||
this, 0, -1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
var pump = Components.classes["@mozilla.org/network/input-stream-pump;1"].
|
||||
createInstance(Components.interfaces.nsIInputStreamPump);
|
||||
var cls = Components.classes["@mozilla.org/network/input-stream-pump;1"];
|
||||
var pump = cls.createInstance(Components.interfaces.nsIInputStreamPump);
|
||||
pump.init(this._inputStream, -1, -1, 0, 0, false);
|
||||
pump.asyncRead(new StreamListener(observer), this);
|
||||
}
|
||||
|
@ -291,7 +297,7 @@ function sp_datawrite (request, ctxt, ostream, offset, count)
|
|||
{
|
||||
//dd ("StreamProvider.prototype.onDataWritable");
|
||||
|
||||
if (this.isClosed)
|
||||
if ("isClosed" in this && this.isClosed)
|
||||
throw Components.results.NS_BASE_STREAM_CLOSED;
|
||||
|
||||
if (!this.pendingData)
|
||||
|
@ -356,7 +362,8 @@ function sl_dataavail (request, ctxt, inStr, sourceOffset, count)
|
|||
"StreamListener.onDataAvailable ***");
|
||||
return;
|
||||
}
|
||||
if (!ctxt._scriptableInputStream)
|
||||
|
||||
if (!("_scriptableInputStream" in ctxt))
|
||||
ctxt._scriptableInputStream = toScriptableInputStream (inStr);
|
||||
|
||||
if (this._observer)
|
||||
|
|
|
@ -106,8 +106,17 @@ function ep_addhook(pattern, f, name, neg, enabled, hooks)
|
|||
|
||||
neg = Boolean(neg);
|
||||
|
||||
return (hooks.push({pattern: pattern, f: f, name: name,
|
||||
neg: neg, enabled: enabled}) - 1);
|
||||
var hook = {
|
||||
pattern: pattern,
|
||||
f: f,
|
||||
name: name,
|
||||
neg: neg,
|
||||
enabled: enabled
|
||||
};
|
||||
|
||||
hooks.push(hook);
|
||||
|
||||
return hook;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -655,7 +655,7 @@ function serv_ppline(e)
|
|||
if (line == "")
|
||||
return false;
|
||||
|
||||
var incomplete = (line[line.length] != '\n');
|
||||
var incomplete = (line[line.length - 1] != '\n');
|
||||
var lines = line.split("\n");
|
||||
|
||||
if (this.savedLine)
|
||||
|
@ -671,7 +671,8 @@ function serv_ppline(e)
|
|||
{
|
||||
var ev = new CEvent("server", "rawdata", this, "onRawData");
|
||||
ev.data = lines[i].replace(/\r/g, "");
|
||||
this.parent.eventPump.addEvent (ev);
|
||||
if (ev.data)
|
||||
this.parent.eventPump.addEvent (ev);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -704,6 +705,12 @@ function serv_onRawData(e)
|
|||
var ary;
|
||||
var l = e.data;
|
||||
|
||||
if (l.length == 0)
|
||||
{
|
||||
dd ("empty line on onRawData?");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (l[0] == ":")
|
||||
{
|
||||
ary = l.match (/:(\S+)\s(.*)/);
|
||||
|
@ -2031,7 +2038,7 @@ function chan_secret (f)
|
|||
var modifier = (f) ? "+" : "-";
|
||||
|
||||
this.parent.parent.sendData ("MODE " + this.parent.encodedName + " " +
|
||||
modifier + "p\n");
|
||||
modifier + "s\n");
|
||||
return true;
|
||||
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@ jsenv.HAS_JAVA = (typeof java == "object");
|
|||
jsenv.HAS_RHINO = (typeof defineClass == "function");
|
||||
jsenv.HAS_DOCUMENT = (typeof document == "object");
|
||||
jsenv.HAS_NSPR_EVENTQ = jsenv.HAS_DOCUMENT;
|
||||
jsenv.HAS_STREAM_PROVIDER = ("nsIStreamProvider" in Components.interfaces);
|
||||
|
||||
function dumpObject (o, pfx, sep)
|
||||
{
|
||||
|
|
|
@ -166,11 +166,25 @@
|
|||
|
||||
<hbox id="input-widgets">
|
||||
<text id="server-nick" value=""/>
|
||||
<textbox id="multiline-input" multiline="true" flex="1" height="100px"
|
||||
class="multiline-input-widget" collapsed="true" autostretch="true"
|
||||
onfocus="onInputFocus();"/>
|
||||
<textbox id="input" class="input-widget" flex="1" autostretch="true"
|
||||
onfocus="onInputFocus();"/>
|
||||
<hbox id="multiline-box" flex="1" collapsed="true">
|
||||
<textbox id="multiline-input" multiline="true" flex="1" height="100px"
|
||||
class="multiline-input-widget" onfocus="onInputFocus();"/>
|
||||
<vbox>
|
||||
<toolbarbutton id="button-input" flex="1"
|
||||
oncommand="onMultilineSend(event);"
|
||||
tooltiptext="&multiline-send.tooltip;" />
|
||||
<toolbarbutton id="button-multiline-contract"
|
||||
oncommand="multilineInputMode(false);"
|
||||
tooltiptext="&multiline-contract.tooltip;" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
<hbox id="singleline-box" flex="1" collapsed="true">
|
||||
<textbox id="input" class="input-widget" flex="1" autostretch="true"
|
||||
onfocus="onInputFocus();"/>
|
||||
<toolbarbutton id="button-multiline-expand"
|
||||
oncommand="multilineInputMode(true);"
|
||||
tooltiptext="&multiline-expand.tooltip;"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</vbox> <!-- outer-box -->
|
||||
|
||||
|
|
|
@ -18,9 +18,15 @@
|
|||
<!-- overlay information -->
|
||||
<RDF:Seq about="urn:mozilla:overlays">
|
||||
<RDF:li resource="chrome://editor/content/editorTasksOverlay.xul"/>
|
||||
<RDF:li resource="chrome://communicator/content/pref/preftree.xul"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<RDF:Seq about="chrome://editor/content/editorTasksOverlay.xul">
|
||||
<RDF:li>chrome://chatzilla/content/chatzillaOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<RDF:Seq about="chrome://communicator/content/pref/preftree.xul">
|
||||
<RDF:li>chrome://chatzilla/content/prefsOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
</RDF:RDF>
|
||||
|
|
|
@ -78,10 +78,20 @@ function onLoad()
|
|||
{
|
||||
|
||||
initHost(client);
|
||||
readIRCPrefs();
|
||||
initPrefs();
|
||||
readPrefs();
|
||||
setClientOutput();
|
||||
initStatic();
|
||||
|
||||
if (!CIRCNetwork.prototype.INITIAL_NICK)
|
||||
CIRCNetwork.prototype.INITIAL_NICK = "IRCMonkey";
|
||||
|
||||
if (!CIRCNetwork.prototype.INITIAL_NAME)
|
||||
CIRCNetwork.prototype.INITIAL_NAME = "chatzilla";
|
||||
|
||||
if (!CIRCNetwork.prototype.INITIAL_DESC)
|
||||
CIRCNetwork.prototype.INITIAL_DESC = "New Now Know How";
|
||||
|
||||
client.userScripts = new Array();
|
||||
if (client.INITIAL_SCRIPTS)
|
||||
{
|
||||
|
@ -94,6 +104,10 @@ function onLoad()
|
|||
}
|
||||
|
||||
processStartupURLs();
|
||||
|
||||
client.onInputNetworks();
|
||||
client.onInputCommands();
|
||||
|
||||
mainStep();
|
||||
}
|
||||
|
||||
|
@ -117,7 +131,9 @@ function onClose()
|
|||
function onUnload()
|
||||
{
|
||||
if (client.SAVE_SETTINGS)
|
||||
writeIRCPrefs();
|
||||
writePrefs();
|
||||
|
||||
destroyPrefs();
|
||||
}
|
||||
|
||||
function onNotImplemented()
|
||||
|
@ -630,7 +646,10 @@ function onSortCol(sortColName)
|
|||
return false;
|
||||
try
|
||||
{
|
||||
xulSortService.sort(node, sortResource, sortDirection);
|
||||
if ("sort" in xulSortService)
|
||||
xulSortService.sort(node, sortResource, sortDirection);
|
||||
else
|
||||
xulSortService.Sort(node, sortResource, sortDirection);
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
|
@ -663,8 +682,7 @@ function onMultilineInputKeyPress (e)
|
|||
if ((e.ctrlKey || e.metaKey) && e.keyCode == 13)
|
||||
{
|
||||
/* meta-enter, execute buffer */
|
||||
e.line = e.target.value;
|
||||
onInputCompleteLine (e);
|
||||
onMultilineSend(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -676,6 +694,14 @@ function onMultilineInputKeyPress (e)
|
|||
}
|
||||
}
|
||||
|
||||
function onMultilineSend(e)
|
||||
{
|
||||
var multiline = document.getElementById("multiline-input");
|
||||
e.line = multiline.value;
|
||||
onInputCompleteLine (e);
|
||||
multiline.value = "";
|
||||
}
|
||||
|
||||
function onToggleMsgCollapse()
|
||||
{
|
||||
client.COLLAPSE_MSGS = !client.COLLAPSE_MSGS;
|
||||
|
@ -954,7 +980,7 @@ function onInputCompleteLine(e, simulated)
|
|||
|
||||
if (!simulated)
|
||||
{
|
||||
if (client.inputHistory[0] != e.line)
|
||||
if (!client.inputHistory.length || client.inputHistory[0] != e.line)
|
||||
client.inputHistory.unshift (e.line);
|
||||
|
||||
if (client.inputHistory.length > client.MAX_HISTORY)
|
||||
|
@ -1734,7 +1760,7 @@ function cli_irlist (e)
|
|||
return false;
|
||||
}
|
||||
o.network.list = new Array();
|
||||
var ary = e.inputData.match (/^\s*("([^"]*)"|([^\s]*))/);
|
||||
var ary = e.inputData.match (/^\s*(\"([^\"]*)\"|([^\s]*))/);
|
||||
try
|
||||
{
|
||||
if (ary[2])
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
<key id="key_clearview" observes="cmd_clearview"
|
||||
modifiers="accel" key="R"/>
|
||||
<key id="key_deleteview" observes="cmd_deleteview"
|
||||
modifiers="accel" key="X"/>
|
||||
modifiers="accel" key="W"/>
|
||||
<key id="key_status" observes="cmd_status"
|
||||
modifiers="accel shift" key="S"/>
|
||||
|
||||
|
@ -136,7 +136,7 @@
|
|||
<key id="key_toggleheader" observes="cmd_toggleheader"
|
||||
modifiers="accel" key="H"/>
|
||||
<key id="key_togglestatus" observes="cmd_togglestatus"
|
||||
modifiers="accel" key="S"/>
|
||||
modifiers="accel" key="B"/>
|
||||
|
||||
<!-- Tasks keys -->
|
||||
<keyset id="tasksKeys"/>
|
||||
|
@ -174,7 +174,7 @@
|
|||
|
||||
<menuitem id="menu-settings-save-now"
|
||||
label="&SaveSetNowCmd.label;" accesskey="&SaveSetNowCmd.akey;"
|
||||
oncommand="writeIRCPrefs()"/>
|
||||
oncommand="writePrefs()"/>
|
||||
<menuitem id="menu-settings-autosave"
|
||||
label="&SaveSetExitCmd.label;" accesskey="&SaveSetExitCmd.akey;"
|
||||
oncommand="onToggleSaveOnExit()" type="checkbox"/>
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
-->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://communicator/locale/pref/pref-irc.dtd" >
|
||||
|
||||
<window xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
class="dialog"
|
||||
title="&window.title;"
|
||||
onload="if( parent.handle ) parent.handle.onpageload( 'pref-irc' ); else parent.queuedTag = 'pref-irc';">
|
||||
|
||||
<hbox class="header">
|
||||
<button class="left-header-text" label="&lHeader;"/>
|
||||
<spacer class="header-spacer" flex="1"/>
|
||||
<button class="right-header-text" label="&rHeader;"/>
|
||||
</hbox>
|
||||
|
||||
<html:fieldset style="width: 100%;">
|
||||
|
||||
<!-- put something here -->
|
||||
|
||||
</html:fieldset>
|
||||
|
||||
</window>
|
|
@ -0,0 +1,80 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Chatzilla
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- James Ross, <twpol@aol.com>, original author
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<overlay id="ovCZPrefs"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<treechildren id="panelChildren">
|
||||
<treeitem container="true" id="chatzillaItem" insertbefore="advancedItem">
|
||||
<treerow>
|
||||
<treecell url="chrome://chatzilla/content/pref-irc.xul"
|
||||
label="ChatZilla"/>
|
||||
</treerow>
|
||||
<treechildren id="chatzillaChildren">
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell url="chrome://chatzilla/content/pref-irc-startup.xul"
|
||||
label="Startup"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell url="chrome://chatzilla/content/pref-irc-interface.xul"
|
||||
label="Interface"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell url="chrome://chatzilla/content/pref-irc-appearance.xul"
|
||||
label="Appearance"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell url="chrome://chatzilla/content/pref-irc-stalk.xul"
|
||||
label="Stalking"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell url="chrome://chatzilla/content/pref-irc-sound.xul"
|
||||
label="Sound"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
|
||||
</overlay>
|
||||
|
||||
|
|
@ -28,6 +28,8 @@
|
|||
* +- 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
|
||||
* +- 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
|
||||
* | seperated
|
||||
* +- initialScripts (String) urls for scripts to run at startup,
|
||||
|
@ -80,181 +82,204 @@
|
|||
* +- tracer (Boolean) enable/disable debug message tracing
|
||||
*/
|
||||
|
||||
function readIRCPrefs (rootNode)
|
||||
function initPrefs()
|
||||
{
|
||||
client.prefSpecs = {
|
||||
"nickname": ["CIRCNetwork.prototype.INITIAL_NICK", "IRCMonkey"],
|
||||
"username": ["CIRCNetwork.prototype.INITIAL_NAME", "chatzilla"],
|
||||
"desc": ["CIRCNetwork.prototype.INITIAL_DESC", "New Now Know How"],
|
||||
"defaultNet": ["client.DEFAULT_NETWORK", "moznet"],
|
||||
"charset": ["client.CHARSET", ""],
|
||||
"initialURLs": ["client.INITIAL_URLS", "irc://"],
|
||||
"initialScripts": ["client.INITIAL_SCRIPTS", ""],
|
||||
"newTabLimit": ["client.NEW_TAB_LIMIT", 15],
|
||||
"raiseNewTab": ["client.RAISE_NEW_TAB", false],
|
||||
"nickCompleteStr": ["client.ADDRESSED_NICK_SEP", ", "],
|
||||
"stalkWords": ["client.stalkingVictims", []],
|
||||
"deleteOnPart": ["client.DELETE_ON_PART", true],
|
||||
"stalkBeep": ["client.STALK_BEEP", "beep"],
|
||||
"msgBeep": ["client.MSG_BEEP", "beep beep"],
|
||||
"queryBeep": ["client.QUERY_BEEP", "beep"],
|
||||
"munger": ["client.munger.enabled", true],
|
||||
"munger.colorCodes": ["client.enableColors", true],
|
||||
"munger.smileyText": ["client.smileyText", false],
|
||||
"bugURL": ["client.BUG_URL",
|
||||
"http://bugzilla.mozilla.org/show_bug.cgi?id=%s"],
|
||||
"notify.aggressive": ["client.FLASH_WINDOW", true],
|
||||
"settings.autoSave": ["client.SAVE_SETTINGS", true],
|
||||
"debug.tracer" : ["client.debugHook.enabled", false],
|
||||
"style.default": ["client.DEFAULT_STYLE",
|
||||
"chrome://chatzilla/skin/output-default.css"],
|
||||
"views.collapseMsgs": ["client.COLLAPSE_MSGS", false],
|
||||
"views.copyMessages": ["client.COPY_MESSAGES", true],
|
||||
"views.client.maxlines": ["client.MAX_MESSAGES", 200],
|
||||
"views.network.maxlines": ["CIRCNetwork.prototype.MAX_MESSAGES", 100],
|
||||
"views.channel.maxlines": ["CIRCChannel.prototype.MAX_MESSAGES", 300],
|
||||
"views.chanuser.maxlines": ["CIRCChanUser.prototype.MAX_MESSAGES", 200]
|
||||
};
|
||||
|
||||
const PREF_CTRID = "@mozilla.org/preferences-service;1";
|
||||
const nsIPrefBranch = Components.interfaces.nsIPrefBranch
|
||||
var pref = Components.classes[PREF_CTRID].getService(nsIPrefBranch);
|
||||
if(!pref)
|
||||
throw ("Can't find pref component.");
|
||||
const nsIPrefService = Components.interfaces.nsIPrefService;
|
||||
const nsIPrefBranch = Components.interfaces.nsIPrefBranch;
|
||||
const nsIPrefBranchInternal = Components.interfaces.nsIPrefBranchInternal;
|
||||
|
||||
if (!rootNode)
|
||||
rootNode = "extensions.irc.";
|
||||
client.prefService =
|
||||
Components.classes[PREF_CTRID].getService(nsIPrefService);
|
||||
client.prefBranch = client.prefService.getBranch ("extensions.irc.");
|
||||
|
||||
if (!rootNode.match(/\.$/))
|
||||
rootNode += ".";
|
||||
var internal = client.prefBranch.QueryInterface(nsIPrefBranchInternal);
|
||||
internal.addObserver("", client.prefObserver, false);
|
||||
|
||||
readPrefs();
|
||||
}
|
||||
|
||||
function destroyPrefs()
|
||||
{
|
||||
const nsIPrefBranchInternal = Components.interfaces.nsIPrefBranchInternal;
|
||||
var internal = client.prefBranch.QueryInterface(nsIPrefBranchInternal);
|
||||
internal.removeObserver("", client.prefObserver);
|
||||
}
|
||||
|
||||
client.prefObserver = new Object();
|
||||
|
||||
client.prefObserver.observe =
|
||||
function pref_observe (prefService, topic, prefName)
|
||||
{
|
||||
if (!("prefLock" in client))
|
||||
readPref(prefName);
|
||||
}
|
||||
|
||||
function readPref(prefName)
|
||||
{
|
||||
//if (prefName.indexOf("extensions.irc." == 0))
|
||||
// prefName = prefName.substr(15);
|
||||
var ary;
|
||||
|
||||
if (prefName in client.prefSpecs)
|
||||
{
|
||||
var varName = client.prefSpecs[prefName][0];
|
||||
var defaultValue = client.prefSpecs[prefName][1];
|
||||
var prefValue;
|
||||
|
||||
if (typeof defaultValue == "boolean")
|
||||
{
|
||||
prefValue = getBoolPref(prefName, defaultValue);
|
||||
eval (varName + " = " + prefValue);
|
||||
}
|
||||
else if (typeof defaultValue == "number")
|
||||
{
|
||||
prefValue = getIntPref(prefName, defaultValue);
|
||||
eval (varName + " = " + prefValue);
|
||||
}
|
||||
else if (defaultValue instanceof Array)
|
||||
{
|
||||
prefValue = getCharPref(prefName, defaultValue.join("; "));
|
||||
if (prefValue)
|
||||
eval (varName + " = " + prefValue.split(/\s*;\s*/).toSource());
|
||||
else
|
||||
eval (varName + " = []");
|
||||
}
|
||||
else
|
||||
{
|
||||
prefValue = getCharPref (prefName, defaultValue);
|
||||
eval (varName + " = " + prefValue.quote());
|
||||
}
|
||||
}
|
||||
else if ((ary = prefName.match(/munger.(.*)/)) &&
|
||||
ary[1] in client.munger.entries)
|
||||
{
|
||||
client.munger.entries[ary[1]].enabled =
|
||||
getBoolPref ("munger." + prefName,
|
||||
client.munger.entries[ary[1]].enabled);
|
||||
}
|
||||
else
|
||||
{
|
||||
dd ("readPref: UNKNOWN PREF ``" + prefName + "''");
|
||||
}
|
||||
}
|
||||
|
||||
function readPrefs()
|
||||
{
|
||||
for (var p in client.prefSpecs)
|
||||
readPref(p);
|
||||
|
||||
CIRCNetwork.prototype.INITIAL_NICK =
|
||||
getCharPref (pref, rootNode + "nickname",
|
||||
CIRCNetwork.prototype.INITIAL_NICK);
|
||||
CIRCNetwork.prototype.INITIAL_NAME =
|
||||
getCharPref (pref, rootNode + "username",
|
||||
CIRCNetwork.prototype.INITIAL_NAME);
|
||||
CIRCNetwork.prototype.INITIAL_DESC =
|
||||
getCharPref (pref, rootNode + "desc",
|
||||
CIRCNetwork.prototype.INITIAL_DESC);
|
||||
client.DEFAULT_NETWORK =
|
||||
getCharPref (pref, rootNode + "defaultNet", "moznet");
|
||||
client.CHARSET = getCharPref (pref, rootNode + "charset", "");
|
||||
client.INITIAL_URLS =
|
||||
getCharPref (pref, rootNode + "initialURLs", "irc://");
|
||||
if (!client.INITIAL_URLS)
|
||||
client.INITIAL_URLS = "irc://";
|
||||
client.INITIAL_SCRIPTS =
|
||||
getCharPref (pref, rootNode + "initialScripts", "");
|
||||
client.NEW_TAB_LIMIT =
|
||||
getIntPref (pref, rootNode + "newTabLimit", 15);
|
||||
client.RAISE_NEW_TAB =
|
||||
getBoolPref (pref, rootNode + "raiseNewTab", false);
|
||||
client.ADDRESSED_NICK_SEP =
|
||||
getCharPref (pref, rootNode + "nickCompleteStr",
|
||||
client.ADDRESSED_NICK_SEP).replace(/\s*$/, "");
|
||||
client.INITIAL_VICTIMS =
|
||||
getCharPref (pref, rootNode + "stalkWords", "");
|
||||
|
||||
client.DELETE_ON_PART =
|
||||
getCharPref (pref, rootNode + "deleteOnPart", true);
|
||||
|
||||
client.STALK_BEEP =
|
||||
getCharPref (pref, rootNode + "stalkBeep", "beep");
|
||||
client.MSG_BEEP =
|
||||
getCharPref (pref, rootNode + "msgBeep", "beep beep");
|
||||
client.QUERY_BEEP =
|
||||
getCharPref (pref, rootNode + "queryBeep", "beep");
|
||||
|
||||
client.munger.enabled =
|
||||
getBoolPref (pref, rootNode + "munger", client.munger.enabled);
|
||||
|
||||
client.enableColors =
|
||||
getBoolPref (pref, rootNode + "munger.colorCodes", true);
|
||||
|
||||
client.smileyText =
|
||||
getBoolPref (pref, rootNode + "munger.smileyText", false);
|
||||
|
||||
for (var entry in client.munger.entries)
|
||||
{
|
||||
if (entry[0] != ".")
|
||||
{
|
||||
client.munger.entries[entry].enabled =
|
||||
getBoolPref (pref, rootNode + "munger." + entry,
|
||||
getBoolPref ("munger." + entry,
|
||||
client.munger.entries[entry].enabled);
|
||||
}
|
||||
}
|
||||
|
||||
client.FLASH_WINDOW =
|
||||
getBoolPref (pref, rootNode + "notify.aggressive", true);
|
||||
|
||||
client.SAVE_SETTINGS =
|
||||
getBoolPref (pref, rootNode + "settings.autoSave", true);
|
||||
|
||||
client.DEFAULT_STYLE =
|
||||
getCharPref (pref, rootNode + "style.default",
|
||||
"chrome://chatzilla/skin/output-default.css");
|
||||
|
||||
client.COLLAPSE_MSGS =
|
||||
getBoolPref (pref, rootNode + "views.collapseMsgs", false);
|
||||
|
||||
client.COPY_MESSAGES =
|
||||
getBoolPref (pref, rootNode + "views.copyMessages", true);
|
||||
|
||||
client.MAX_MESSAGES =
|
||||
getIntPref (pref, rootNode + "views.client.maxlines",
|
||||
client.MAX_MESSAGES);
|
||||
|
||||
CIRCNetwork.prototype.MAX_MESSAGES =
|
||||
getIntPref (pref, rootNode + "views.network.maxlines",
|
||||
CIRCChanUser.prototype.MAX_MESSAGES);
|
||||
|
||||
CIRCChannel.prototype.MAX_MESSAGES =
|
||||
getIntPref (pref, rootNode + "views.channel.maxlines",
|
||||
CIRCChannel.prototype.MAX_MESSAGES);
|
||||
|
||||
CIRCUser.prototype.MAX_MESSAGES =
|
||||
getIntPref (pref, rootNode + "views.chanuser.maxlines",
|
||||
CIRCChanUser.prototype.MAX_MESSAGES);
|
||||
|
||||
var h = client.eventPump.getHook ("event-tracer");
|
||||
h.enabled = client.debugMode =
|
||||
getBoolPref (pref, rootNode + "debug.tracer", h.enabled);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function writeIRCPrefs (rootNode)
|
||||
function writePref(prefName)
|
||||
{
|
||||
const PREF_CTRID = "@mozilla.org/preferences-service;1";
|
||||
const nsIPrefBranch = Components.interfaces.nsIPrefBranch;
|
||||
var pref = Components.classes[PREF_CTRID].getService(nsIPrefBranch);
|
||||
if(!pref)
|
||||
throw ("Can't find pref component.");
|
||||
//if (prefName.indexOf("extensions.irc." == 0))
|
||||
// prefName = prefName.substr(15);
|
||||
var ary;
|
||||
|
||||
if (!rootNode)
|
||||
rootNode = "extensions.irc.";
|
||||
if (prefName in client.prefSpecs)
|
||||
{
|
||||
var varName = client.prefSpecs[prefName][0];
|
||||
var defaultValue = client.prefSpecs[prefName][1];
|
||||
var prefValue = eval(varName);
|
||||
|
||||
if (typeof defaultValue == "boolean")
|
||||
client.prefBranch.setBoolPref(prefName, prefValue);
|
||||
else if (typeof defaultValue == "number")
|
||||
client.prefBranch.setIntPref(prefName, prefValue);
|
||||
else if (defaultValue instanceof Array)
|
||||
client.prefBranch.setCharPref(prefName, prefValue.join("; "));
|
||||
else
|
||||
client.prefBranch.setCharPref(prefName, prefValue);
|
||||
}
|
||||
else if ((ary = prefName.match(/munger\.(.*)/)) &&
|
||||
ary[1] in client.munger.entries)
|
||||
{
|
||||
client.prefBranch.setBoolPref (prefName,
|
||||
client.munger.entries[ary[1]].enabled);
|
||||
}
|
||||
else
|
||||
{
|
||||
dd ("writePref: UNKNOWN PREF ``" + prefName + "''");
|
||||
}
|
||||
|
||||
if (!rootNode.match(/\.$/))
|
||||
rootNode += ".";
|
||||
if (!("prefLock" in client))
|
||||
client.prefService.savePrefFile(null);
|
||||
}
|
||||
|
||||
function writePrefs (rootNode)
|
||||
{
|
||||
client.prefLock = true;
|
||||
|
||||
for (var p in client.prefSpecs)
|
||||
writePref(p);
|
||||
|
||||
pref.setCharPref (rootNode + "nickname",
|
||||
CIRCNetwork.prototype.INITIAL_NICK);
|
||||
pref.setCharPref (rootNode + "username",
|
||||
CIRCNetwork.prototype.INITIAL_NAME);
|
||||
pref.setCharPref (rootNode + "desc", CIRCNetwork.prototype.INITIAL_DESC);
|
||||
pref.setCharPref (rootNode + "charset", client.CHARSET);
|
||||
pref.setCharPref (rootNode + "nickCompleteStr", client.ADDRESSED_NICK_SEP);
|
||||
pref.setCharPref (rootNode + "initialURLs", client.INITIAL_URLS);
|
||||
pref.setCharPref (rootNode + "initialScripts", client.INITIAL_SCRIPTS);
|
||||
pref.setIntPref (rootNode + "newTabLimit", client.NEW_TAB_LIMIT);
|
||||
pref.setBoolPref (rootNode + "raiseNewTab", client.RAISE_NEW_TAB);
|
||||
pref.setCharPref (rootNode + "style.default", client.DEFAULT_STYLE);
|
||||
pref.setCharPref (rootNode + "stalkWords",
|
||||
client.stalkingVictims.join ("; "));
|
||||
pref.setCharPref (rootNode + "stalkBeep", client.STALK_BEEP);
|
||||
pref.setCharPref (rootNode + "msgBeep", client.MSG_BEEP);
|
||||
pref.setCharPref (rootNode + "queryBeep", client.QUERY_BEEP);
|
||||
pref.setBoolPref (rootNode + "munger", client.munger.enabled);
|
||||
pref.setBoolPref (rootNode + "munger.colorCodes", client.enableColors);
|
||||
pref.setBoolPref (rootNode + "munger.smileyText", client.smileyText);
|
||||
|
||||
for (var entry in client.munger.entries)
|
||||
{
|
||||
if (entry[0] != ".")
|
||||
{
|
||||
pref.setBoolPref (rootNode + "munger." + entry,
|
||||
client.munger.entries[entry].enabled);
|
||||
writePref("munger." + entry);
|
||||
}
|
||||
}
|
||||
pref.setBoolPref (rootNode + "notify.aggressive", client.FLASH_WINDOW);
|
||||
pref.setBoolPref (rootNode + "views.collapseMsgs", client.COLLAPSE_MSGS);
|
||||
pref.setBoolPref (rootNode + "views.copyMessages", client.COPY_MESSAGES);
|
||||
pref.setIntPref (rootNode + "views.client.maxlines", client.MAX_MESSAGES);
|
||||
pref.setIntPref (rootNode + "views.network.maxlines",
|
||||
CIRCChanUser.prototype.MAX_MESSAGES);
|
||||
pref.setIntPref (rootNode + "views.channel.maxlines",
|
||||
CIRCChannel.prototype.MAX_MESSAGES);
|
||||
pref.setIntPref (rootNode + "views.chanuser.maxlines",
|
||||
CIRCChanUser.prototype.MAX_MESSAGES);
|
||||
|
||||
var h = client.eventPump.getHook ("event-tracer");
|
||||
pref.setBoolPref (rootNode + "debug.tracer", h.enabled);
|
||||
|
||||
}
|
||||
|
||||
delete client.prefLock;
|
||||
|
||||
client.prefService.savePrefFile(null);
|
||||
}
|
||||
|
||||
function getCharPref (prefObj, prefName, defaultValue)
|
||||
function getCharPref (prefName, defaultValue)
|
||||
{
|
||||
var e, rv;
|
||||
|
||||
try
|
||||
{
|
||||
rv = prefObj.getCharPref (prefName);
|
||||
rv = client.prefBranch.getCharPref (prefName);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
|
@ -266,13 +291,13 @@ function getCharPref (prefObj, prefName, defaultValue)
|
|||
|
||||
}
|
||||
|
||||
function getIntPref (prefObj, prefName, defaultValue)
|
||||
function getIntPref (prefName, defaultValue)
|
||||
{
|
||||
var e;
|
||||
|
||||
try
|
||||
{
|
||||
return prefObj.getIntPref (prefName);
|
||||
return client.prefBranch.getIntPref (prefName);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
|
@ -281,13 +306,13 @@ function getIntPref (prefObj, prefName, defaultValue)
|
|||
|
||||
}
|
||||
|
||||
function getBoolPref (prefObj, prefName, defaultValue)
|
||||
function getBoolPref (prefName, defaultValue)
|
||||
{
|
||||
var e;
|
||||
|
||||
try
|
||||
{
|
||||
return prefObj.getBoolPref (prefName);
|
||||
return client.prefBranch.getBoolPref (prefName);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
|
|
|
@ -60,8 +60,8 @@
|
|||
<script src="chrome://chatzilla/content/lib/xul/munger.js"/>
|
||||
|
||||
<script src="chrome://chatzilla/content/commands.js"/>
|
||||
<script src="chrome://chatzilla/content/readprefs.js"/>
|
||||
<script src="chrome://chatzilla/content/static.js"/>
|
||||
<script src="chrome://chatzilla/content/readprefs.js"/>
|
||||
<script src="chrome://chatzilla/content/handlers.js"/>
|
||||
<script src="chrome://chatzilla/content/rdf.js"/>
|
||||
|
||||
|
|
|
@ -34,9 +34,9 @@ const MSG_CSP = getMsg ("commaSpace", " ");
|
|||
const MSG_NONE = getMsg ("none");
|
||||
const MSG_UNKNOWN = getMsg ("unknown");
|
||||
|
||||
client.defaultNick = getMsg( "defaultNick" );
|
||||
client.defaultNick = getMsg("defaultNick");
|
||||
|
||||
client.version = "0.8.11";
|
||||
client.version = "0.8.12";
|
||||
|
||||
client.TYPE = "IRCClient";
|
||||
client.COMMAND_CHAR = "/";
|
||||
|
@ -277,16 +277,6 @@ function initStatic()
|
|||
client.display (getMsg("welcome"), "HELLO");
|
||||
setCurrentObject (client);
|
||||
|
||||
client.onInputNetworks();
|
||||
client.onInputCommands();
|
||||
|
||||
ary = client.INITIAL_VICTIMS.split(/\s*;\s*/);
|
||||
for (i in ary)
|
||||
{
|
||||
if (ary[i])
|
||||
client.stalkingVictims.push (ary[i]);
|
||||
}
|
||||
|
||||
var m = document.getElementById ("menu-settings-autosave");
|
||||
m.setAttribute ("checked", String(client.SAVE_SETTINGS));
|
||||
|
||||
|
@ -412,12 +402,15 @@ function initHost(obj)
|
|||
obj.primNet = obj.networks["efnet"];
|
||||
|
||||
if (DEBUG)
|
||||
{
|
||||
/* hook all events EXCEPT server.poll and *.event-end types
|
||||
* (the 4th param inverts the match) */
|
||||
obj.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/},
|
||||
{type: "event-end"}], event_tracer,
|
||||
"event-tracer", true /* negate */,
|
||||
false /* disable */);
|
||||
obj.debugHook =
|
||||
obj.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/},
|
||||
{type: "event-end"}], event_tracer,
|
||||
"event-tracer", true /* negate */,
|
||||
false /* disable */);
|
||||
}
|
||||
|
||||
obj.linkRE = /((\w+):[^<>\[\]()\'\"\s]+|www(\.[^.<>\[\]()\'\"\s]+){2,})/;
|
||||
|
||||
|
@ -539,9 +532,7 @@ function insertBugzillaLink (matchText, containerTag)
|
|||
|
||||
var anchor = document.createElementNS ("http://www.w3.org/1999/xhtml",
|
||||
"html:a");
|
||||
anchor.setAttribute ("href",
|
||||
"http://bugzilla.mozilla.org/show_bug.cgi?id=" +
|
||||
number);
|
||||
anchor.setAttribute ("href", client.BUG_URL.replace("%s", number));
|
||||
anchor.setAttribute ("class", "chatzilla-link");
|
||||
anchor.setAttribute ("target", "_content");
|
||||
insertHyphenatedWord (matchText, anchor);
|
||||
|
@ -747,10 +738,7 @@ function msgIsImportant (msg, sourceNick, myNick)
|
|||
var str = "(^|[\\W\\s])" + sv + "([\\W\\s]|$)";
|
||||
var re = new RegExp(str, "i");
|
||||
if (msg.search(re) != -1 || sourceNick && sourceNick.search(re) != -1)
|
||||
{
|
||||
playSounds(client.STALK_BEEP);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1193,6 +1181,9 @@ function parseIRCURL (url)
|
|||
|
||||
rv.target = (1 in ary) ?
|
||||
unescape(ary[1]).replace("\n", "\\n") : "";
|
||||
var i = rv.target.indexOf(" ");
|
||||
if (i != -1)
|
||||
rv.target = rv.target.substr(0, i);
|
||||
var params = (2 in ary) ? ary[2].toLowerCase() : "";
|
||||
var query = (3 in ary) ? ary[3] : "";
|
||||
|
||||
|
@ -1203,12 +1194,16 @@ function parseIRCURL (url)
|
|||
if (rv.isnick && !rv.target)
|
||||
{
|
||||
dd ("parseIRCURL: isnick w/o target");
|
||||
/* isnick w/o a target is bogus */
|
||||
/* isnick w/o a target is bogus */
|
||||
return null;
|
||||
}
|
||||
|
||||
rv.isserver =
|
||||
(params.search (/,\s*isserver\s*,|,\s*isserver\s*$/) != -1);
|
||||
if (!rv.isserver)
|
||||
{
|
||||
rv.isserver =
|
||||
(params.search (/,\s*isserver\s*,|,\s*isserver\s*$/) != -1);
|
||||
}
|
||||
|
||||
if (rv.isserver && !specifiedHost)
|
||||
{
|
||||
dd ("parseIRCURL: isserver w/o host");
|
||||
|
@ -1226,16 +1221,32 @@ function parseIRCURL (url)
|
|||
|
||||
if (query)
|
||||
{
|
||||
ary = query.match
|
||||
(/^\?msg=([^\&]*)$|^\?msg=([^\&]*)\&|\&msg=([^\&]*)\&|\&msg=([^\&]*)$/);
|
||||
if (ary)
|
||||
for (var i = 1; i < ary.length; i++)
|
||||
if (i in ary)
|
||||
{
|
||||
rv.msg = unescape(ary[i]).replace ("\n", "\\n");
|
||||
ary = query.substr(1).split("&");
|
||||
while (ary.length)
|
||||
{
|
||||
var arg = ary.pop().split("=");
|
||||
/*
|
||||
* we don't want to accept *any* query, or folks could
|
||||
* say things like "target=foo", and overwrite what we've
|
||||
* already parsed, so we only use query args we know about.
|
||||
*/
|
||||
switch (arg[0].toLowerCase())
|
||||
{
|
||||
case "msg":
|
||||
rv.msg = unescape(arg[1]).replace ("\n", "\\n");
|
||||
break;
|
||||
|
||||
case "pass":
|
||||
rv.needpass = true;
|
||||
rv.pass = unescape(arg[1]).replace ("\n", "\\n");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case "key":
|
||||
rv.needkey = true;
|
||||
rv.key = unescape(arg[1]).replace ("\n", "\\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1268,7 +1279,12 @@ function gotoIRCURL (url)
|
|||
var pass = "";
|
||||
|
||||
if (url.needpass)
|
||||
pass = window.prompt (getMsg("gotoIRCURLMsg2",url.spec));
|
||||
{
|
||||
if ("pass" in url)
|
||||
pass = url.pass;
|
||||
else
|
||||
pass = window.prompt (getMsg("gotoIRCURLMsg2",url.spec));
|
||||
}
|
||||
|
||||
if (url.isserver)
|
||||
{
|
||||
|
@ -1344,7 +1360,13 @@ function gotoIRCURL (url)
|
|||
/* url points to a channel */
|
||||
var key = "";
|
||||
if (url.needkey)
|
||||
key = window.prompt (getMsg("gotoIRCURLMsg3", url.spec));
|
||||
{
|
||||
if ("key" in url)
|
||||
key = url.key;
|
||||
else
|
||||
key = window.prompt (getMsg("gotoIRCURLMsg3", url.spec));
|
||||
}
|
||||
|
||||
ev = {inputData: url.target + " " + key,
|
||||
network: net, server: net.primServ};
|
||||
client.onInputJoin (ev);
|
||||
|
@ -1377,7 +1399,6 @@ function gotoIRCURL (url)
|
|||
"INFO");
|
||||
setCurrentObject (net);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setTopicText (text)
|
||||
|
@ -1528,7 +1549,9 @@ function updateTitle (obj)
|
|||
function multilineInputMode (state)
|
||||
{
|
||||
var multiInput = document.getElementById("multiline-input");
|
||||
var multiInputBox = document.getElementById("multiline-box");
|
||||
var singleInput = document.getElementById("input");
|
||||
var singleInputBox = document.getElementById("singleline-box");
|
||||
var splitter = document.getElementById("input-splitter");
|
||||
var iw = document.getElementById("input-widgets");
|
||||
var h;
|
||||
|
@ -1542,9 +1565,9 @@ function multilineInputMode (state)
|
|||
if (h)
|
||||
iw.setAttribute ("height", h); /* restore the slider position */
|
||||
|
||||
singleInput.setAttribute ("collapsed", "true");
|
||||
singleInputBox.setAttribute ("collapsed", "true");
|
||||
splitter.setAttribute ("collapsed", "false");
|
||||
multiInput.setAttribute ("collapsed", "false");
|
||||
multiInputBox.setAttribute ("collapsed", "false");
|
||||
client.input = multiInput;
|
||||
}
|
||||
else /* turn off multiline input mode */
|
||||
|
@ -1554,8 +1577,8 @@ function multilineInputMode (state)
|
|||
iw.removeAttribute ("height"); /* let the slider drop */
|
||||
|
||||
splitter.setAttribute ("collapsed", "true");
|
||||
multiInput.setAttribute ("collapsed", "true");
|
||||
singleInput.setAttribute ("collapsed", "false");
|
||||
multiInputBox.setAttribute ("collapsed", "true");
|
||||
singleInputBox.setAttribute ("collapsed", "false");
|
||||
client.input = singleInput;
|
||||
}
|
||||
|
||||
|
@ -1816,7 +1839,7 @@ function notifyAttention (source)
|
|||
function getFrameForDOMWindow(window)
|
||||
{
|
||||
var frame;
|
||||
for (i = 0; i < client.deck.childNodes.length; i++)
|
||||
for (var i = 0; i < client.deck.childNodes.length; i++)
|
||||
{
|
||||
frame = client.deck.childNodes[i];
|
||||
if (frame.contentWindow == window)
|
||||
|
@ -2014,7 +2037,7 @@ function getTabForObject (source, create)
|
|||
browser.setAttribute ("tooltip", "aHTMLTooltip");
|
||||
browser.setAttribute ("context", "outputContext");
|
||||
//browser.setAttribute ("onload", "scrollDown(true);");
|
||||
browser.setAttribute ("onclick", "focusInput()");
|
||||
//browser.setAttribute ("onclick", "focusInput()");
|
||||
browser.setAttribute ("ondragover", "nsDragAndDrop.dragOver(event, contentDropObserver);");
|
||||
browser.setAttribute ("ondragdrop", "nsDragAndDrop.drop(event, contentDropObserver);");
|
||||
browser.setAttribute ("ondraggesture", "nsDragAndDrop.startDrag(event, contentAreaDNDObserver);");
|
||||
|
@ -2388,8 +2411,12 @@ function __display(message, msgtype, sourceObj, destObj)
|
|||
{
|
||||
isImportant = msgIsImportant (message, nick, me.nick);
|
||||
if (isImportant)
|
||||
{
|
||||
this.defaultCompletion = nick +
|
||||
client.ADDRESSED_NICK_SEP + " ";
|
||||
if (this.TYPE != "IRCNetwork")
|
||||
playSounds(client.STALK_BEEP);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2444,13 +2471,13 @@ function __display(message, msgtype, sourceObj, destObj)
|
|||
else
|
||||
{
|
||||
isSuperfluous = true;
|
||||
if (!client.debugMode && msgtype in client.responseCodeMap)
|
||||
if (!client.debugHook.enabled && msgtype in client.responseCodeMap)
|
||||
{
|
||||
code = client.responseCodeMap[msgtype];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!client.debugMode && client.HIDE_CODES)
|
||||
if (!client.debugHook.enabled && client.HIDE_CODES)
|
||||
code = client.DEFAULT_RESPONSE_CODE;
|
||||
else
|
||||
code = "[" + msgtype + "]";
|
||||
|
@ -2742,27 +2769,58 @@ function gettabmatch_usr (line, wordStart, wordEnd, word, cursorPos)
|
|||
CIRCChannel.prototype.performTabMatch =
|
||||
CIRCNetwork.prototype.performTabMatch =
|
||||
CIRCUser.prototype.performTabMatch =
|
||||
function gettabmatch_usr (line, wordStart, wordEnd, word, cursorpos)
|
||||
function gettabmatch_other (line, wordStart, wordEnd, word, cursorpos)
|
||||
{
|
||||
if (wordStart == 0 && line[0] == client.COMMAND_CHAR)
|
||||
{
|
||||
return client.performTabMatch (line, wordStart, wordEnd, word,
|
||||
cursorpos);
|
||||
}
|
||||
|
||||
if (!("users" in this))
|
||||
return [];
|
||||
var matchList = new Array();
|
||||
var users;
|
||||
var channels;
|
||||
|
||||
var details = getObjectDetails(this);
|
||||
|
||||
if ("channel" in details && word == details.channel.name[0])
|
||||
{
|
||||
/* When we have #<tab>, we just want the current channel, if possible. */
|
||||
matchList.push (details.channel.unicodeName);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Ok, not #<tab> or no current channel, so get the full list. */
|
||||
|
||||
if ("users" in details.orig)
|
||||
{
|
||||
users = details.orig.users;
|
||||
for (var n in users)
|
||||
matchList.push (users[n].nick);
|
||||
}
|
||||
|
||||
if ("server" in details)
|
||||
{
|
||||
channels = details.server.channels;
|
||||
for (var c in channels)
|
||||
matchList.push (channels[c].name);
|
||||
}
|
||||
}
|
||||
|
||||
var users = this.users;
|
||||
var nicks = new Array();
|
||||
|
||||
for (var n in users)
|
||||
nicks.push (users[n].nick);
|
||||
|
||||
var matches = matchEntry (word, nicks);
|
||||
var matches = matchEntry (word, matchList);
|
||||
|
||||
if (matches.length == 1)
|
||||
{
|
||||
matches[0] = this.users[matches[0]].properNick;
|
||||
if (wordStart == 0)
|
||||
matches[0] += client.ADDRESSED_NICK_SEP;
|
||||
if (users && matches[0] in users)
|
||||
{
|
||||
matches[0] = users[matches[0]].properNick;
|
||||
if (wordStart == 0)
|
||||
matches[0] += client.ADDRESSED_NICK_SEP;
|
||||
}
|
||||
else if (channels && matches[0] in channels)
|
||||
{
|
||||
matches[0] = channels[matches[0]].unicodeName;
|
||||
}
|
||||
|
||||
if (wordEnd == line.length)
|
||||
{
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
<!ENTITY whois.value "Whois">
|
||||
<!ENTITY whois.accesskey "w">
|
||||
|
||||
<!ENTITY multiline-expand.tooltip "Switch to multi-line input (Ctrl+Up)">
|
||||
<!ENTITY multiline-contract.tooltip "Switch to single-line input (Ctrl+Down)">
|
||||
<!ENTITY multiline-send.tooltip "Send this text (Ctrl+Enter)">
|
||||
|
||||
<!ENTITY url.label "URL">
|
||||
<!ENTITY mode.label "Mode">
|
||||
<!ENTITY topic.label "Topic">
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
# Contributor(s):
|
||||
# Chiaki Koufugata, original author
|
||||
# Robert Ginda, rginda@netscape.com, owner/maintainer
|
||||
# James Ross, twpol@aol.com, pref pages code
|
||||
#
|
||||
|
||||
unknown=<unknown>
|
||||
|
@ -418,3 +419,17 @@ rule_underline=Underline
|
|||
rule_word-hyphenator=Word Hyphenator
|
||||
rule_ctrl-char=Control Chars
|
||||
|
||||
# pref-irc-appearance.js
|
||||
file_browse_CSS=Choose a Cascading Stylesheet (CSS) file
|
||||
file_browse_CSS_spec=Cascading Stylesheet files (*.css)
|
||||
|
||||
# pref-irc-sound.js
|
||||
file_browse_Wave=Choose a Wave Sound file
|
||||
file_browse_Wave_spec=Sound files (*.wav)
|
||||
|
||||
# pref-irc-stalk.js
|
||||
stalk_add_msg=Enter the stalk word to add:
|
||||
|
||||
# pref-irc-startup.js
|
||||
file_browse_Script=Choose a JavaScript Script file
|
||||
file_browse_Script_spec=JavaScript Script files (*.js)
|
||||
|
|
|
@ -1,19 +1,24 @@
|
|||
<!-- extracted from content/pref-advanced.xul -->
|
||||
<!ENTITY window.title "ChatZilla">
|
||||
|
||||
<!--LOCALIZATION NOTE : FILE 'Advanced' prefs settings -->
|
||||
<!ENTITY window.title "Advanced">
|
||||
<!ENTITY lHeader "Advanced">
|
||||
<!ENTITY autoLoadImgCheck.label "Automatically load images">
|
||||
<!--LOCALIZATION NOTE (enbJavaCheck.label): 'Java' should never be translated -->
|
||||
<!ENTITY enbJavaCheck.label "Enable Java">
|
||||
<!--LOCALIZATION NOTE (enbJsCheck.label): 'JavaScript' should never be translated -->
|
||||
<!ENTITY enbJsCheck.label "Enable JavaScript in Navigator">
|
||||
<!ENTITY enbJsCheck.labelforMailNNews "Enable JavaScript for Mail and News">
|
||||
<!ENTITY enbCssCheck.label "Enable style sheets">
|
||||
<!ENTITY sendAddFtpCheck.label "Send email address as anonymous FTP password">
|
||||
<!ENTITY remSignCheck.label "Automatically prefill usernames and passwords">
|
||||
<!ENTITY capFormsCheck.label "Enable prefilling of forms">
|
||||
<!ENTITY rHeader "Changing preferences that affect the entire product">
|
||||
<!--LOCALIZATION NOTE (server.label): 'Wallet' is a product name and should not be translated. -->
|
||||
<!ENTITY server.label "Server for wallet tables">
|
||||
<!ENTITY userDetails.title "User Identification">
|
||||
<!ENTITY userDetails.help.label "What do these mean?">
|
||||
<!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:">
|
||||
<!ENTITY userDetails.nick.accesskey "N">
|
||||
<!ENTITY userDetails.name.label "User name:">
|
||||
<!ENTITY userDetails.name.accesskey "U">
|
||||
<!ENTITY userDetails.desc.label "Description:">
|
||||
<!ENTITY userDetails.desc.accesskey "D">
|
||||
|
||||
<!ENTITY global.title "Global Options">
|
||||
|
||||
<!ENTITY global.notify.label "Allow aggressive notify (flashing window or bringing to top)">
|
||||
<!ENTITY global.notify.accesskey "a">
|
||||
<!ENTITY global.collapse.label "Collapse consecutive messages from the same source">
|
||||
<!ENTITY global.collapse.accesskey "c">
|
||||
<!ENTITY global.copyMsgs.label "Copy important messages to the network tab">
|
||||
<!ENTITY global.copyMsgs.accesskey "i">
|
||||
<!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.">
|
||||
|
|
|
@ -53,6 +53,18 @@ window {
|
|||
border: thin silver inset;
|
||||
}
|
||||
|
||||
#button-multiline-expand {
|
||||
list-style-image:url("chrome://chatzilla/skin/images/multiline-expand.png");
|
||||
}
|
||||
|
||||
#button-multiline-contract {
|
||||
list-style-image:url("chrome://chatzilla/skin/images/multiline-contract.png");
|
||||
}
|
||||
|
||||
#button-input {
|
||||
list-style-image:url("chrome://chatzilla/skin/images/input-send.png");
|
||||
}
|
||||
|
||||
.highlight-menu-item:hover {
|
||||
color: white !important;
|
||||
background: darkslategrey !important;
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
blue_rock.gif
|
||||
face-angry.gif
|
||||
face-cry.gif
|
||||
face-dunno.gif
|
||||
face-frown.gif
|
||||
face-screw.gif
|
||||
face-smile.gif
|
||||
face-surprise.gif
|
||||
face-tongue.gif
|
||||
face-wink.gif
|
||||
is-op.gif
|
||||
is-voice.gif
|
||||
isnt-op.gif
|
||||
isnt-voice.gif
|
||||
view-activity.gif
|
||||
view-attention.gif
|
||||
view-current.gif
|
||||
view-normal.gif
|
||||
xtal.jpg
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 290 B |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 262 B |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 266 B |
Загрузка…
Ссылка в новой задаче