add /server, /quit, /exit commands
This commit is contained in:
rginda%netscape.com 2000-05-10 07:08:33 +00:00
Родитель 1cfe56707a
Коммит b0d19c19d8
4 изменённых файлов: 76 добавлений и 3 удалений

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

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file

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

@ -45,6 +45,21 @@ function addCommands(commandObject)
"<network-name>",
"Sets the current network to <network-name>");
add ("server", "onInputServer",
"<server-hostname> [<port>]",
"Connects to server <server-hostname> on <port>, or 6667 if " +
"<port> is not specified.");
add ("quit", "onInputQuit", "[<reason>]",
"Disconnects from the server represented by the view active when " +
"the command is executed with <reason> if it is specified, or the " +
"default reason if not.");
add ("exit", "onInputExit", "[<reason>]",
"Disconnects from the all connected servers with <reason> if it is " +
"specified, or the default reason if not. Exits ChatZilla after " +
"disconnecting.");
add ("attach", "onInputAttach",
"[<network-name>]",
"Attaches to the network specified by <network-name>, " +

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

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
@ -429,7 +429,7 @@ function cli_testdisplay (e)
}
client.onInputNetwork =
function clie_inetwork (e)
function cli_inetwork (e)
{
if (!e.inputData)
return false;
@ -452,6 +452,62 @@ function clie_inetwork (e)
}
client.onInputServer =
function cli_iserver (e)
{
if (!e.inputData)
return false;
var ary = e.inputData.match(/^(\S+) ?(\d+)?$/);
if (ary == null)
return false;
if (!ary[2])
ary[2] = 6667;
client.networks[ary[1]] =
new CIRCNetwork (ary[1], [{name: ary[1], port: ary[2]}],
client.eventPump);
client.onInputAttach ({inputData: ary[1]});
return true;
}
client.onInputQuit =
function cli_quit (e)
{
if (!e.server)
{
client.currentObject.display ("Quit can only be used in the context " +
"of a network, perhaps you meant /exit?",
"ERROR");
return false;
}
if (!e.server.connection.isConnected)
{
client.currentObject.display ("Not connected", "ERROR");
return false;
}
e.server.logout (e.inputData);
return true;
}
client.onInputExit =
function cli_exit (e)
{
client.quit(e.inputData);
window.close();
}
client.onInputAttach =
function cli_iattach (e)
{

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

@ -24,6 +24,8 @@
*/
@import url(chrome://communicator/skin/);
/*@import url(chrome://global/skin/global.css);*/
window {