<?xml version="1.0"?>

<!--
   - 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 JSIRC Test Client #3
   - 
   - The Initial Developer of the Original Code is New Dimensions Consulting,
   - Inc. Portions created by New Dimensions Consulting, Inc. are
   - Copyright (C) 1999 New Dimenstions Consulting, Inc. All
   - Rights Reserved.
   - 
   - Contributor(s):
   -  Robert Ginda, rginda@ndcico.com, original author
   -  Josh Soref, timeless@mac.com, international support
  -->

<!DOCTYPE window SYSTEM "chrome://chatzilla/locale/chatzilla.dtd">

<?xml-stylesheet href="chrome://chatzilla/skin/chatzilla.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>

<window id="main-window"
        xmlns:html="http://www.w3.org/1999/xhtml"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        align="vertical" onload="onLoad();" onunload="onUnload();"
        persist="width height" windowtype="irc:chatzilla">

<script src="chrome://chatzilla/content/lib/js/utils.js"/>
<script src="chrome://chatzilla/content/lib/js/connection-xpcom.js"/>
<script src="chrome://chatzilla/content/lib/js/events.js"/>
<script src="chrome://chatzilla/content/lib/js/command-manager.js"/>
<script src="chrome://chatzilla/content/lib/js/irc.js"/>
<script src="chrome://chatzilla/content/lib/js/irc-debug.js"/>
<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/handlers.js"/>
<script src="chrome://chatzilla/content/rdf.js"/>

<commandset id="tasksCommands">
  <command id="cmd_close" oncommand="window.close();"/>
  <command id="cmd_quit"/>
</commandset>

<keyset id="tasksKeys">
  <key id="key_close"/>
  <key id="key_quit"/>
</keyset>

<popupset>
    <popup id="userlistPopup" oncommand="onUserListPopupClick(event)">
        <menuitem label="&op.value;" accesskey="&op.accesskey;" code="/op" />
        <menuitem label="&deop.value;" accesskey="&deop.accesskey;"
          code="/deop" />
        <menuitem label="&voice.value;" accesskey="&voice.accesskey;"
          code="/voice" />
        <menuitem label="&devoice.value;" accesskey="&devoice.accesskey;"
          code="/devoice" />  
        <menuitem label="&kick.value;" accesskey="&kick.accesskey;"
          code="/kick" />
<!--
    <menuitem label="&kick2.value;" accesskey="&kick2.accesskey;"
          code="/kick" />
 -->
    <menuitem label="&whois.value;" accesskey="&whois.accesskey;" code="/whois" />
    </popup>
</popupset>

<toolbox>
  <menubar id="main-menubar" persist="collapsed">
    <menu id="menu_File">
      <menupopup id="menu_FilePopup">
        <menu label="Options">
          <menupopup>

            <menuitem id="menu-view-toolbar" label="Show Toolbar" 
              type="checkbox" oncommand="onToggleVisibility('toolbar');"/>
            <menuitem id="menu-view-info" label="Show Userlist" 
              type="checkbox" oncommand="onToggleVisibility('info');"/>
            <menuitem id="menu-view-status" label="Show Statusbar" 
              type="checkbox" oncommand="onToggleVisibility('status');"/>

            <menuseparator/>

            <menuitem id="menu-munger" label="Enable Smileys"
              oncommand="onToggleMunger()" type="checkbox"/>

            <menuseparator/>

            <menuitem id="menu-dmessages" label="Debug Messages"
              oncommand="onToggleTraceHook()" type="checkbox"/>

            <menuseparator/>

            <menuitem id="menu-settings-save-now" label="Save Settings Now"
              oncommand="writeIRCPrefs()"/>
            <menuitem id="menu-settings-autosave" label="Save Settings On Exit"
              oncommand="onToggleSaveOnExit()" type="checkbox"/>

          </menupopup>
        </menu>

        <menuseparator/>
        <menuitem id="menu_close"/>
      </menupopup>
    </menu>
    <menu label="View">
      <menupopup>

       <!-- hide vs delete nuances are too vague
        <menuitem label="Hide" oncommand="onHideCurrentView();"/>
       -->
        <menuitem label="Clear this view" oncommand="onClearCurrentView();"/>
        <menuitem label="Delete this view" oncommand="onDeleteCurrentView();"/>

      </menupopup>
    </menu>
    <menu id="tasksMenu"/>
  </menubar>
  
</toolbox>

<vbox id="outer-box" flex="1">
  <vbox id="upper-box" flex="1">
    <hbox id="tabpanels-contents-box" flex="1">
      <vbox id="user-list-box" flex="1" width="20%" persist="collapsed width">
  
        <tree id="user-list" container="true" datasources="rdf:null" flex="1"
         containment="http://home.netscape.com/NC-irc#chanuser"
         multiple="true" context="userlistPopup">

          <template>
            <treechildren flex="1">
              <treeitem uri="..." flex="1">
                <treerow crop="right">
                    <treecell>
                      <image class="op-image"
                        state="rdf:http://home.netscape.com/NC-irc#op"/>
                    </treecell>
                    <treecell>
                      <image class="voice-image"
                        state="rdf:http://home.netscape.com/NC-irc#voice"/>
                    </treecell>
                    <treecell flex="1">
                      <text value="rdf:http://home.netscape.com/NC-irc#nick"
                        flex="1" crop="right"/>
                    </treecell>
                </treerow>
              </treeitem>
            </treechildren>
          </template>
  
          <treecolgroup flex="1">
            <treecol
              resource="http://home.netscape.com/NC-irc#op" wwidth="15"/>
            <splitter class="tree-splitter"/>
            <treecol
              resource="http://home.netscape.com/NC-irc#voice" wwidth="15"/>
            <splitter class="tree-splitter"/>
            <treecol flex="1"
              resource="http://home.netscape.com/NC-irc#nick"/>
          </treecolgroup>
  
          <treehead>
            <treerow crop="right">
              <treecell id="usercol-op"
                resource="http://home.netscape.com/NC-irc#op"
                class="treecell-header sortDirectionIndicator" label="O"
                onclick="return onSortCol('usercol-op');"/>
              <treecell id="usercol-voice"
                resource="http://home.netscape.com/NC-irc#voice"
                class="treecell-header sortDirectionIndicator" label="V"
                onclick="return onSortCol('usercol-voice');"/>
              <treecell id="usercol-nick"
                resource="http://home.netscape.com/NC-irc#nick"
                class="treecell-header sortDirectionIndicator" label="Nick"
                onclick="return onSortCol('usercol-nick');"/>
            </treerow>
          </treehead>
  
        </tree>
  
      </vbox> <!-- user-list-box -->

      <splitter id="main-splitter" align="vertical" collapse="before"
        persist="collapsed left">
        <grippy/>
      </splitter>

      <vbox flex="1" persist="width">
        <iframe id="output-iframe" class="output-container" type="content"
          flex="1" src="chrome://chatzilla/content/outputwindow.html"/>
      </vbox>

    </hbox> <!-- tabpanels-contents-box -->
  
    <hbox id="tabstrip-box" flex="0" crop="right">
      <scrollbox id="views-tbar" persist="collapsed" orient="horizontal"
        flex="1" onoverflow="dd('views-tbar overflow');"
        onunderflow="dd('views-tbar underflow');">

        <tabs class="tabs-bottom" id="views-tbar-inner" flex="1"
          crop="right">
          <tab collapsed="true"/> <!-- dummy tab to keep the freaking xbl from 
                                       causing an exception -->
        </tabs>
      </scrollbox>
    </hbox>

  </vbox> <!-- upper-box -->

  <splitter id="input-splitter" orient="vertical" collapse="after"
    collapsed="true"/>

  <vbox id="input-widgets">
    <textbox id="multiline-input" multiline="true" flex="1" height="100px"
      class="multiline-input-widget" collapsed="true"/>
    <textbox id="input" class="input-widget"/>
  </vbox>

</vbox> <!-- outer-box -->

<toolbox id="status-bar-tbox" crop="right">
  <toolbar id="status-bar-tbar" class="chromeclass-status" persist="collapsed"
    crop="right">
    <hbox class="status-box" flex="20%" crop="right">
      <vbox class="status-label" crop="right">
        <text value="&network.label;" crop="right"/>
        <text value="&channel.label;" crop="right"/>
        <text value="&topicBy.label;" crop="right"/>
      </vbox>
      <vbox class="status-data" crop="right">
         <text id="net-name" value="(one)" crop="right"/> 
         <text id="channel-name" value="(none)" crop="right"/>
         <text id="channel-topicby" value="(nobody)" crop="right"/>
      </vbox>
      <spring flex="20%"/>
      <vbox class="status-label" crop="right">
         <text value="&server.label;" crop="right"/>
         <text value="&mode.label;" crop="right"/>
         <text value="&topic.label;" crop="right"/>
      </vbox>
      <vbox flex="80%" crop="right">
        <hbox flex="1" crop="right">
          <vbox class="status-data" crop="right">
            <text id="server-name" value="(none)" crop="right"/>
            <text id="channel-mode" value="(none)" crop="right"/>
          </vbox>
          <spring flex="100%"/>
          <vbox class="status-label" crop="right">
            <text value="&nickname.label;" crop="right"/>
            <text value="&users.label;" crop="right"/>
          </vbox>
          <vbox class="status-data" crop="right">
            <text id="server-nick" value="(unknown)" crop="right"/>
            <text id="channel-users" value="(none)" crop="right"/>
          </vbox>
          <spring flex="100%"/>
          <vbox class="status-label" crop="right">
            <text value="&lag.label;" crop="right"/>
            <text value="&limit.label;" crop="right"/>
          </vbox>
          <vbox class="status-data" crop="right">
            <text id="server-lag" value="-1" crop="right"/>
            <text id="channel-limit" value="(none)" crop="right"/>
          </vbox>
          <spring flex="100%"/>
          <vbox class="status-label" crop="right"
            collapsed="true">
            <text value="&lastPing.label;" crop="right"/>
            <text value="&key.label;" crop="right"/>
          </vbox>
          <vbox class="status-data" crop="right"
            collapsed="true">
            <text id="last-ping" value="(never)" crop="right"/>
          <text id="channel-key" value="(none)" crop="right"/>
          </vbox>
        </hbox>
        <hbox flex="1" crop="right">
          <vbox class="status-data" flex="1" crop="right">
            <text id="channel-topic" value="(none)" crop="right"/>
          </vbox>
        </hbox>
      </vbox>
    </hbox>
  </toolbar>
</toolbox>


</window>
