<?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="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="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>
  

  <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="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" />
      <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>
