home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / mozil06.zip / bin / chrome / chatzilla.jar / content / chatzilla / commands.js < prev    next >
Text File  |  2000-06-01  |  9KB  |  229 lines

  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2.  *
  3.  * The contents of this file are subject to the Mozilla Public
  4.  * License Version 1.1 (the "License"); you may not use this file
  5.  * except in compliance with the License. You may obtain a copy of
  6.  * the License at http://www.mozilla.org/MPL/
  7.  *
  8.  * Software distributed under the License is distributed on an "AS
  9.  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  10.  * implied. See the License for the specific language governing
  11.  * rights and limitations under the License.
  12.  *
  13.  * The Original Code is JSIRC Test Client #3
  14.  *
  15.  * The Initial Developer of the Original Code is New Dimensions Consulting,
  16.  * Inc. Portions created by New Dimensions Consulting, Inc. are
  17.  * Copyright (C) 1999 New Dimenstions Consulting, Inc. All
  18.  * Rights Reserved.
  19.  *
  20.  * Contributor(s): 
  21.  *
  22.  *
  23.  * Contributor(s):
  24.  *  Robert Ginda, rginda@ndcico.com, original author
  25.  */
  26.  
  27. function addCommands(commandObject)
  28. {
  29.  
  30.     function add (name, func, usage, help)
  31.     {
  32.         commandObject.add (name, func, usage, help);
  33.     }
  34.  
  35.     add ("help", "onInputHelp",
  36.          "[<command-name>]",
  37.          "Displays help on all commands matching <command-name>, if " +
  38.          "<command-name> is not given, displays help on all commands");
  39.  
  40.     add ("testdisplay", "onInputTestDisplay",
  41.          "",
  42.          "Displays a sample text.  Used to preview styles");
  43.  
  44.     add ("network", "onInputNetwork",
  45.          "<network-name>",
  46.          "Sets the current network to <network-name>");
  47.  
  48.     add ("server", "onInputServer",
  49.          "<server-hostname> [<port>] [<password>]",
  50.          "Connects to server <server-hostname> on <port>, or 6667 if " +
  51.          "<port> is not specified.  Provides the password <password> if " +
  52.          "specified.");
  53.  
  54.     add ("quit", "onInputQuit", "[<reason>]",
  55.          "Disconnects from the server represented by the active view when " +
  56.          "the command is executed providing the reason <reason> " +
  57.          "or the default reason if <reason> is not specified.");
  58.  
  59.     add ("exit", "onInputExit", "[<reason>]",
  60.          "Disconnects from all active servers and networks,  providing the " +
  61.          "reason <reason>, or the default reason if <reason> is not " +
  62.          "specified.  Exits ChatZilla after disconnecting.");
  63.  
  64.     add ("clear", "onInputClear", "",
  65.          "Clear the current view, discarding *all* content.");
  66.     
  67.     add ("delete", "onInputDelete", "",
  68.          "Clear the current view, discarding *all* content, and drop it's " +
  69.          "icon from the toolbar.");
  70.  
  71.     add ("hide", "onInputHide", "",
  72.          "Drop the current view's icon from the toolbar, but save it's " +
  73.          "contents.  The icon will reappear the next time there is activity " +
  74.          "on the view.");
  75.  
  76.     add ("names", "onInputNames", "",
  77.          "Toggles the visibility of the username list.");
  78.  
  79.     add ("toolbar", "onInputToolbar", "",
  80.          "Toggles the visibility of the channel toolbar.");
  81.  
  82.     add ("statusbar", "onInputStatusbar", "",
  83.          "Toggles the visibility of the status bar.");
  84.  
  85.     add ("commands", "onInputCommands", "[<pattern>]",
  86.          "Lists all command names matching <pattern>, or all command names " +
  87.          "if pattern is not specified.");
  88.     
  89.     add ("attach", "onInputAttach",
  90.          "[<network-name>] [<password>]",
  91.          "Attaches to the network specified by <network-name>, " +
  92.          "or the current network, if no network is specified.  " +
  93.          "Provides the password <password> if specified.");
  94.       
  95.     add ("me", "onInputMe",
  96.          "<action>",
  97.          "Performs an 'action' on the current channel.");
  98.     
  99.     add ("msg", "onInputMsg",
  100.          "<user> <msg>",
  101.          "Sends a private message <msg> to the user <user>.");
  102.     
  103.     add ("nick", "onInputNick",
  104.          "<nickname>",
  105.          "Changes your current nickname.");
  106.  
  107.     add ("name", "onInputName",
  108.          "<username>",
  109.          "Changes the username displayed before your hostmask if the server " +
  110.          "you're connecting to allows it.  Some servers will only trust the " +
  111.          "username reply from the ident service.  You must specify this " +
  112.          "*before* connecting to the network.");
  113.  
  114.     add ("desc", "onInputDesc",
  115.          "<description>",
  116.          "Changes the 'ircname' line returned when someone performs a /whois " +
  117.          "on you.  You must specify this *before* connecting to the network.");
  118.  
  119.     add ("quote", "onInputQuote",
  120.          "<irc-command>",
  121.          "Sends a raw command to the IRC server, not a good idea if you " +
  122.          "don't know what you're doing. see IRC 1459 " +
  123.          "( http://www.irchelp.org/irchelp/rfc1459.html ) for complete " +
  124.          "details.");
  125.  
  126.     add ("eval", "onInputEval",
  127.          "<script>",
  128.          "Evaluates <script> as JavaScript code.  Not for the faint of heart.");
  129.  
  130.     add ("ctcp", "onInputCTCP",
  131.          "<target> <code> [<params>]",
  132.          "Sends the CTCP code <code> to the target (user or channel) " +
  133.          "<target>.  If <params> are specified they are sent along as well.");
  134.     
  135.     add ("join", "onInputJoin",
  136.          "[#|&|+]<channel-name> [<key>]",
  137.          "Joins a the global (name starts with #), local (name starts " +
  138.          "with &), or modeless (name starts with a +) channel named " +
  139.          "<channel-name>.  If no prefix is given, # is " +
  140.          "assumed.  Provides the key <key> if specified.");
  141.  
  142.     add ("leave", "onInputLeave",
  143.          "",
  144.          "Leaves the current channel, use /delete or /hide to force the " +
  145.          "view to go away.");
  146.  
  147.     add ("part", "onInputLeave",
  148.          "",
  149.          "See /leave");
  150.  
  151.     add ("zoom", "onInputZoom",
  152.          "<nick>",
  153.          "Shows only messages <nick> has sent to the channel, filtering out " +
  154.          "all others, (including yours.)");
  155.  
  156.     add ("whois", "onInputWhoIs",
  157.          "<nick>",
  158.          "Displays information about the user <nick>, including 'real name', " +
  159.          "server connected to, idle time, and signon time.  Note that some " +
  160.          "servers will lie about the idle time.");
  161.  
  162.     add ("topic", "onInputTopic",
  163.          "[<new-topic>]",
  164.          "If <new-topic> is specified and you are a chanop, or the channel " +
  165.          "is not in 'private topic' mode (+t), the topic will be changed to " +
  166.          "<new-topic>.  If <new-topic> is *not* specified, the current topic " +
  167.          "will be displayed");
  168.  
  169.     /* JG: commands below jan 24 2000, update mar 15 */
  170.     
  171.     add ("away", "onInputAway",
  172.          "[<reason>]",
  173.          "If <reason> is spcecified, sets you away with that message. " +
  174.          "Used without <reason>, you are marked back as no longer being away.");
  175.     
  176.     add ("op", "onInputOp",
  177.          "<nick>",
  178.           "Gives operator status to <nick> on current channel. Requires " +
  179.          "operator status.");
  180.     
  181.     add ("deop", "onInputDeop",
  182.          "<nick>",
  183.          "Removes operator status from <nick> on current channel. " +
  184.          "Requires operator status.");
  185.     
  186.     add ("voice", "onInputVoice",
  187.          "<nick>",
  188.          "Gives voice status to <nick> on current channel. " +
  189.          "Requires operator status.");   
  190.      
  191.     add ("devoice", "onInputDevoice",
  192.          "<nick>",
  193.          "Removes voice status from <nick> on current channel. " +
  194.          "Requires operator status.");    
  195.     
  196.     add ("stalk", "onInputStalk",
  197.          "<text>",
  198.          "Add text to list of words for which you would like to see alerts.");
  199.     
  200.     add ("unstalk", "onInputUnstalk",
  201.          "<text>",
  202.          "Remove word from list of terms for which you would like to see " +
  203.          "alerts.");
  204.  
  205.     add ("echo", "onInputEcho",
  206.          "<text>",
  207.          "Displays <text> in the current view, but does not send it to " +
  208.          "the server.");
  209.  
  210.     /* FIXME: JG: not implemented yet */
  211.     /*
  212.       add ("filter", "onInputFilter",
  213.       "<regex>",
  214.       "Shows only messages matching <regex> on current channel. When used " $
  215.       "with no parameter, the contents are restored.");
  216.     */  
  217.     
  218.     add ("invite", "onInputInvite",
  219.          "<nick> [<channel>]",
  220.          "Invites <nick> to <channel> or current channel if not " +
  221.          "supplied. Requires operator status if +i is set.");
  222.     
  223.     add ("kick", "onInputKick",
  224.          "[<channel>] <nick>",
  225.          "Kicks <nick> from <channel> or current channel if not " +
  226.          "supplied. Requires operator status.");    
  227. }
  228.  
  229.