<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" 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 hidechrome="true"
  id="yoono-new-window" title="Yoono web preview"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  
  <script>
  function inspect(o) {
    // Load the Window DataSource so that browser windows opened subsequent to DOM
    // Inspector show up in the DOM Inspector's window list.
    var windowDS = Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"]
                                     .getService(Components.interfaces.nsIWindowDataSource);
    var tmpNameSpace = {};                         
    var sl = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
      .createInstance(Components.interfaces.mozIJSSubScriptLoader);
    sl.loadSubScript("chrome://inspector/content/hooks.js", tmpNameSpace);
    tmpNameSpace.inspectObject(o);
  }
  </script>
  <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="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>
  

  <vbox id="website-panel" flex="1">
    <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="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>
      
      <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" />
      <box id="website-maximize-button" />
      <box id="website-close" />
    </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>

</window>
