<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://yoonorunner/skin/main.css" type="text/css"?>

<?xml-stylesheet href="chrome://yoonorunner/skin/website-panel.css" type="text/css"?>
<?xml-stylesheet href="chrome://yoono/skin/account-selector/accountSelector.css" type="text/css"?> 

<!DOCTYPE overlay SYSTEM "chrome://yoono/locale/accountSelector.dtd">

<window windowtype="navigator:browser" hidechrome="true"
  id="yoono-window" title="Yoono" screenX="2" screenY="2" width="250" height="200" simplewidth="300" expandwidth="1130" mode="simple" tab="columns"
  persist="screenX screenY width height simplewidth expandwidth mode tab" 
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  
  <script src="chrome://yoonorunner/content/debug.js" />
  
  <script src="chrome://yoonorunner/content/main.js" />
  <script src="chrome://yoonorunner/content/release-page.js" />
  <script src="chrome://yoonorunner/content/yoonoGlob.js" />
  <script src="chrome://yoonorunner/content/actions.js" />
  <script src="chrome://yoonorunner/content/window-handlers.js" />
  <script src="chrome://yoonorunner/content/tray-icon.js" />
  
  <script src="chrome://yoonorunner/content/webpanel-2.js" />
  <script src="chrome://yoonorunner/content/website-context-menu.js" />
  <script type="application/x-javascript" src="chrome://yoono/content/accountSelector.js" />
  <stringbundleset>
    <stringbundle id="account-selector-bundle" src="chrome://yoono/locale/accountSelector.properties"/>
  </stringbundleset>

  
  <popupset id="mainPopupSet">

    <menupopup id="main-menu">
      <menu id="debug-menu" label="Debug" hidden="true">
        <menupopup>
          <menuitem label="Call test() function" oncommand="test()"/>
          <menuitem label="Enable debug prefs" oncommand="enableDebugPrefs()"/>
          <menuitem label="about:config" oncommand="aboutConfig()"/>
          <menuitem label="about:yoono" oncommand="aboutYoono()"/>
          <menuitem label="Open Debug widget" oncommand="openDebugWidget()"/>
          <menuitem label="Open JS Console" oncommand="openConsole()"/>
          <menuitem label="DOMi" oncommand="openDOMi()"/>
        </menupopup>
      </menu>
      <menuitem label="Add Social Network/IM" oncommand="addNetwork()" />
      <menuitem label="Options" oncommand="showFriendsConfig(event)" />
      <menuseparator />
      <checkbox id="open-in-browser-pref" label="Open links in your browser" />
      <hbox id="text-sizes" onclick="textSizeClick(event)">
        <label value="" />
      </hbox>
      <menuseparator />
      <menuitem label="Check for updates" oncommand="checkForUpdates()" />
      <menuitem label="Register/Sign In" oncommand="register()" />
      <menuitem label="Sign Out" oncommand="signOut()" />
      <menuitem id="menu-close" label="Close" oncommand="trayIcon.close()" />
      <menuitem label="Exit" oncommand="trayIcon.quit()" />
    </menupopup>
    
    <menupopup id="context-menu">
      <menuitem label="Cut" id="menu-cut" />
      <menuitem label="Copy" id="menu-copy" />
      <menuitem label="Paste" id="menu-paste" />
    </menupopup>
    
    <panel id="account-selector-popup" onpopuphidden="gAccountSelector.onPopupHidden()" hidden="true" noautofocus="true" level="top">
      <vbox id="account-selector-popup-innerbox">
        <label id="account-selector-header-text" value="&accountSelector.header;" />
        <vbox id="account-selector-popup-list">
        </vbox>
        <label id="account-selector-add" hidden="true" value="&accountSelector.addNew;" onclick="gAccountSelector.addNewProfile()" />
        <label id="account-selector-help" value="&accountSelector.help;" onclick="gAccountSelector.help()" />
      </vbox>
    </panel>
    
    <hbox id="account-selector-session-template" class="account-selector-session" 
          hidden="true" onclick="gAccountSelector.onSessionClick(event, this)">
      <stack class="account-selector-session-stack">
        <image class="account-selector-session-avatar" />
        <box class="account-selector-session-network account-network-icon twitter" />
      </stack>
      <vbox flex="1">
        <label class="account-selector-session-name" flex="1" />
        <hbox class="account-selector-session-actions" align="center">
          <label class="account-selector-session-profile" value="&accountSelector.goHome;" />
          <box class="account-selector-session-pipe" />
          <label class="account-selector-session-reload" value="&accountSelector.switchTo;" />
        </hbox>
      </vbox>
      <box class="account-selector-session-checked" />
    </hbox>
  
  </popupset>
  
  <keyset>
    <key id="toggle-debug" modifiers="control shift" key="D" oncommand="toggleDebug();"/>
    <key id="open-domi" modifiers="control shift" key="I" oncommand="openDOMi();"/>
    <key id="open-jsconsole" modifiers="control shift" key="J" oncommand="openConsole();"/>
    <key id="open-jsconsole" modifiers="control alt" key="D" oncommand="openDebugWidget();"/>
  </keyset>
  
  <!-- start of "sidebar" box -->
  <vbox flex="1">
    <hbox flex="1">
      <spacer id="left-resizer" class="left vertical resizer" />
      
      <vbox id="root-box" flex="1">
        <hbox id="header" align="top">
          <spacer id="flying-logo" />
          <box id="settings-button" onmouseup="document.getElementById('main-menu').openPopup(this,'after_start');event.stopPropagation()" />
          <spacer id="header-spacer" />
          <hbox id="tab-buttons" hidden="true">
            <label id="tab-browser" value="Browser" onclick="ynWebPanel.show()" />
            <label id="tab-columns" value="Columns" onclick="ynWindowHandlers.expand('columns')" />
          </hbox>
          <spacer id="move-handler" flex="1" style="min-width: 10px; min-height: 30px;" />
          <box id="expand-button" class="simple" onclick="ynWindowHandlers.toggleExpand(this);" />
          <label id="minimize-button" value="_" />
          <box id="maximize-button" class="normal" onclick="ynWindowHandlers.toggleMaximize();" />
          <box id="close-button" onclick="ynWindowHandlers.close()" />
        </hbox>
        
        <hbox flex="1">
          <vbox id="sidebar-box" flex="1">
            <iframe id="main-iframe" type="content" src="chrome://yoonosb/content/sidebar.html" flex="1" />
          </vbox>
          <hbox id="tabs" flex="1" hidden="true">
            <hbox id="middle-resizer">
              <box class="resizer-line" />
            </hbox>
            <vbox id="columns-panel" flex="1" hidden="true">
              <iframe id="columns-iframe" flex="1" src="chrome://yoonosb/content/friends2/multicolumn/columns.html" />
            </vbox>
            <vbox id="website-panel" flex="1" hidden="true">
              <hbox id="website-header" align="center">
                <box id="website-history-box">
                  <box id="website-go-previous" />
                  <spacer />
                  <box id="website-go-next" />
                </box>
                <spacer style="min-width: 15px" />
                <box id="urlbar-account-selector" tooltiptext="&accountSelector.tooltip;" 
                     align="center" onclick="gAccountSelector.onClick()">
                  <box id="account-selector-icon" class="account-network-icon default" />
                  <label id="account-selector-name" />
                  <box id="account-selector-arrow" />
                </box>
                
                <label id="website-title" flex="1" crop="end" value="Loading ..." />
                <hbox id="website-open-in-browser">
                  <hbox>
                    <box class="icon" />
                    <label value="Open in browser" />
                  </hbox>
                  <box class="popup-button" onclick="this.firstChild.openPopup(this.parentNode,'after_end');event.stopPropagation()">
                    <menupopup>
                      <label value="By default, open links from Yoono in:" />
                      <radiogroup>
                        <radio id="website-open-in-browser-pref-yoono" label="Yoono preview browser" />
                        <radio id="website-open-in-browser-pref-system" label="My default browser" />
                      </radiogroup>
                    </menupopup>
                  </box>
                </hbox>
                <box id="website-share-button" />
              </hbox>
              
              <label id="website-url" value="" crop="end" />
              
              <box flex="1">
                <browser id="website-iframe" flex="1" type="content" src="about:config" context="context-menu" />
              </box>
              <hbox id="website-progress-box">
                <progressmeter id="website-progress" mode="determined" value="0"/>
                <label id="website-status" value="loading" />
              </hbox>
            </vbox>
          </hbox>
        </hbox>
      </vbox>
      
      <vbox>
        <spacer id="right-resizer" flex="1" class="right vertical resizer" />
        <spacer id="bottom-right-right-resizer" class="bottom-right-right resizer" />
      </vbox>
    </hbox>
    <hbox>
      <spacer id="bottom-resizer" class="bottom resizer" flex="1" />
      <spacer id="bottom-right-bottom-resizer" class="bottom-right-bottom resizer" />
    </hbox>
  </vbox>
  <!-- end of "sidebar" box -->
  
  <iframe id="content" flex="0" src="http://www.google.com" style="background-color:white; height: 1px; max-height: 1px !important; display:none; " />


</window>
