<?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="yoono-account-selector-bundle" src="chrome://yoono/locale/accountSelector.properties"/>
  </stringbundleset>

  
  <popupset id="mainPopupSet">
    <menupopup id="MinTrayR_context">
      <menuitem label="Open Yoono" oncommand="gMinTrayR.restore();" />
      <menuitem label="Exit Yoono" oncommand="trayIcon.quit()" />
    </menupopup>
    
    <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 id="menu-close" label="Minimize" oncommand="trayIcon.minimize()" />
      <menuitem id="menu-exit" 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="yoono-account-selector-popup" onpopuphidden="YoonoAccountSelector.onPopupHidden()" hidden="true" noautofocus="true" level="top">
      <vbox id="yoono-account-selector-popup-innerbox">
        <label id="yoono-account-selector-header-text" value="&accountSelector.header;" />
        <vbox id="yoono-account-selector-popup-list">
        </vbox>
        <label id="yoono-account-selector-add" hidden="true" value="&accountSelector.addNew;" onclick="YoonoAccountSelector.addNewProfile()" />
        <label id="yoono-account-selector-help" value="&accountSelector.help;" onclick="YoonoAccountSelector.help()" />
      </vbox>
    </panel>
    
    <hbox id="yoono-account-selector-session-template" class="yoono-account-selector-session"
          hidden="true" onclick="YoonoAccountSelector.onSessionClick(event, this)">
      <stack class="yoono-account-selector-session-stack">
        <image class="yoono-account-selector-session-avatar" />
        <box class="yoono-account-selector-session-network account-network-icon twitter" />
      </stack>
      <vbox flex="1">
        <label class="yoono-account-selector-session-name" flex="1" />
        <hbox class="yoono-account-selector-session-actions" align="center">
          <label class="yoono-account-selector-session-profile" value="&accountSelector.goHome;" />
          <box class="yoono-account-selector-session-pipe" />
          <label class="yoono-account-selector-session-reload" value="&accountSelector.switchTo;" />
        </hbox>
      </vbox>
      <box class="yoono-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')" />
            <label id="tab-socialzine" value="Socialzine" onclick="ynWindowHandlers.expand('socialzine')" hidden="true"/>            
          </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="_" onclick="trayIcon.minimize();"/>
          <box id="maximize-button" class="normal" onclick="ynWindowHandlers.toggleMaximize();" tooltiptext="Maximize"/>
          <box id="close-button" onclick="ynWindowHandlers.close()" tooltiptext="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="middle-resizer">
            <box class="resizer-line" />
          </hbox>
          <deck id="tabs" flex="1" hidden="true" selectedIndex="0">
            <vbox id="browser-panel" flex="1" class="yoono-panel">
              <hbox id="website-header" align="center">
                <box id="website-history-box">
                  <box id="website-go-previous" />
                  <spacer />
                  <box id="website-go-next" />
                </box>
                <box id="website-refresh-box">
                  <box id="website-refresh" onclick="ynWebPanel.refresh();"/>
                </box>
                <box id="website-home-box" >
                  <box id="website-home" onclick="ynWebPanel.goHome();"/>
                </box>
                <spacer style="min-width: 5px" />
                <box id="urlbar-yoono-account-selector" tooltiptext="&accountSelector.tooltip;"
                     align="center" onclick="YoonoAccountSelector.onClick()">
                  <box id="yoono-account-selector-icon" class="account-network-icon default" />
                  <label id="yoono-account-selector-name" />
                  <box id="yoono-account-selector-arrow" />
                </box>
                <textbox id="urlbar" flex="1" placeholder="Go to a Web Site"
                         type="autocomplete" autocompletesearch="history" autocompletesearchparam="enable-actions"
                         autocompletepopup="PopupAutoCompleteRichResult" completeselectedindex="true" tabscrolling="true"
                         showcommentcolumn="true" showimagecolumn="true" enablehistory="true" maxrows="6" newlines="stripsurroundingwhitespace"
                         Xoninput="alert(3)" ontextentered="ynWindowHandlers.urlTextEntered(this.value);" ontextreverted="ynWindowHandlers.cancelUrlInput(this);"
                         pageproxystate="valid" Xonsearchbegin="LocationBarHelpers._searchBegin();" Xonsearchcomplete="LocationBarHelpers._searchComplete();"
                         Xonfocus="document.getElementById('identity-box').style.MozUserFocus= 'normal'"
                         Xonblur="setTimeout(function() {document.getElementById('identity-box').style.MozUserFocus = ''}, 0);"
                         sizetopopup="pref" clickSelectsAll="true" completedefaultindex="false" timeout="50" level="high"
                         crop="end"
                        >
                </textbox>
                <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>
                          
              <box flex="1">
                <browser id="website-iframe" flex="1" type="content" src="about:blank" 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>
            <vbox id="columns-panel" flex="1" class="yoono-panel">
              <iframe type="content" id="columns-iframe" flex="1" src="chrome://yoonosb/content/friends2/multicolumn/columns.html" />
            </vbox>
            <vbox id="socialzine-panel" flex="1" class="yoono-panel" hidden="true">
              <iframe type="content" id="socialzine-iframe" flex="1" src="" />
            </vbox>
          </deck>
        </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>
