<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<!DOCTYPE overlay [
<!ENTITY % historyDTD SYSTEM "chrome://communicator/locale/history/history.dtd">
%historyDTD;
<!ENTITY % utilityDTD SYSTEM "chrome://communicator/locale/utilityOverlay.dtd">
%utilityDTD;
]>

<?xml-stylesheet href="chrome://communicator/content/history/places.css"?>
<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css"?>

<overlay id="placesOverlay"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <script type="application/javascript"
          src="chrome://global/content/globalOverlay.js"/>
  <script type="application/javascript"
          src="chrome://communicator/content/history/history.js"/>
  <script type="application/javascript"
          src="chrome://communicator/content/history/controller.js"/>
  <script type="application/javascript"
          src="chrome://communicator/content/history/treeView.js"/>

  <commandset id="placesCommands"
              commandupdater="true"
              events="focus,sort"
              oncommandupdate="updateHistoryCommands(this.firstChild);">
    <command id="placesCmd_open"
             oncommand="goDoCommand('placesCmd_open');"/>
    <command id="placesCmd_open:window"
             oncommand="goDoCommand('placesCmd_open:window');"/>
    <command id="placesCmd_open:tab"
             oncommand="goDoCommand('placesCmd_open:tab');"/>
    <command id="placesCmd_delete:hostname"
             oncommand="goDoCommand('placesCmd_delete:hostname');"/>
    <command id="placesCmd_delete:domain"
             oncommand="goDoCommand('placesCmd_delete:domain');"/>
  </commandset>

  <menupopup id="placesContext"
         onpopupshowing="this._view = PlacesUIUtils.getViewForNode(document.popupNode);
                         return this._view.buildContextMenu(this);"
         onpopuphiding="this._view.destroyContextMenu();">
    <menuitem id="placesContext_open"
              command="placesCmd_open"
              label="&cmd.open.label;"
              accesskey="&cmd.open.accesskey;"
              default="true"
              selectiontype="single"
              selection="link"/>
    <menuitem id="placesContext_open:newtab"
              command="placesCmd_open:tab"
              label="&cmd.open_tab.label;"
              accesskey="&cmd.open_tab.accesskey;"
              selection="link"/>
    <menuitem id="placesContext_open:newwindow"
              command="placesCmd_open:window"
              label="&cmd.open_window.label;"
              accesskey="&cmd.open_window.accesskey;"
              selection="link"/>
    <menuseparator id="placesContext_openSeparator"/>
    <menuitem id="addBookmarkContextItem"
              label="&bookmarkLinkCmd.label;"
              accesskey="&bookmarkLinkCmd.accesskey;"
              selectiontype="single"
              selection="link"
              oncommand="historyAddBookmarks();"/>
    <menuitem id="addMultipleBookmarksContextItem"
              label="&bookmarkLinksCmd.label;"
              accesskey="&bookmarkLinksCmd.accesskey;"
              selectiontype="multiple"
              selection="link"
              oncommand="historyAddBookmarks();"/>
    <menuitem id="placesContext_copy"
              command="cmd_copy"
              label="&copyCmd.label;"
              accesskey="&copyCmd.accesskey;"
              selection="any"/>
    <menuseparator id="placesContext_editSeparator"/>
    <menuitem id="placesContext_delete"
              command="cmd_delete"
              label="&deleteCmd.label;"
              accesskey="&deleteCmd.accesskey;"
              selection="link|host|day"/>
    <menuitem id="placesContext_deleteByHostname"
              command="placesCmd_delete:hostname"
              selection="link|host"/>
    <menuitem id="placesContext_deleteByDomain"
              command="placesCmd_delete:domain"
              selection="link|host"/>
    <menuitem id="placesContext_selectAll"
              command="cmd_selectAll"
              label="&selectAllCmd.label;"
              accesskey="&selectAllCmd.accesskey;"
              selection="any"/>
  </menupopup>

  <menupopup id="viewPopup">
    <menu id="viewColumns"
          label="&view.columns.label;" accesskey="&view.columns.accesskey;">
      <menupopup onpopupshowing="UpdateViewColumns(this.firstChild);"
                 oncommand="ToggleColumn(event.target);">
        <menuitem id="ToggleName" disabled="true" label="&col.title.label;"
                  accesskey="&col.title.accesskey;" type="checkbox"/>
        <menuitem id="ToggleURL" label="&col.url.label;"
                  accesskey="&col.url.accesskey;" type="checkbox"/>
        <menuitem id="ToggleDate" label="&col.lastvisit.label;"
                  accesskey="&col.lastvisit.accesskey;" type="checkbox"/>
        <menuitem id="ToggleVisitCount" label="&col.visitcount.label;"
                  accesskey="&col.visitcount.accesskey;" type="checkbox"/>
      </menupopup>
    </menu>
    <menu id="viewSortBy" label="&view.sortBy.label;"
          accesskey="&view.sortBy.accesskey;">
      <menupopup onpopupshowing="UpdateViewSort(this.firstChild);"
                 oncommand="gHistoryTree.view.cycleHeader({id:event.target.id});">
        <menuitem id="Unsorted" type="radio" name="columns"
                  label="&view.unsorted.label;"
                  accesskey="&view.unsorted.accesskey;"/>
        <menuseparator/>
        <menuitem id="SortByName" type="radio" name="columns"
                  label="&col.title.label;"
                  accesskey="&col.title.accesskey;"/>
        <menuitem id="SortByURL" type="radio" name="columns"
                  label="&col.url.label;"
                  accesskey="&col.url.accesskey;"/>
        <menuitem id="SortByDate" type="radio" name="columns"
                  label="&col.lastvisit.label;"
                  accesskey="&col.lastvisit.accesskey;"/>
        <menuitem id="SortByVisitCount" type="radio" name="columns"
                  label="&col.visitcount.label;"
                  accesskey="&col.visitcount.accesskey;"/>
        <menuseparator/>
        <menuitem id="SortAscending" type="radio" name="direction"
                  label="&view.sortAscending.label;"
                  accesskey="&view.sortAscending.accesskey;"/>
        <menuitem id="SortDescending" type="radio" name="direction"
                  label="&view.sortDescending.label;"
                  accesskey="&view.sortDescending.accesskey;"/>
      </menupopup>
    </menu>
    <menu id="viewGroupBy" label="&view.groupBy.label;"
          accesskey="&view.groupBy.accesskey;">
      <menupopup oncommand="GroupBy(event.target);">
        <menuitem id="GroupByNone" type="radio" name="group"
                  label="&view.groupNone.label;"
                  accesskey="&view.groupNone.accesskey;"/>
        <menuitem id="GroupByDay" type="radio" name="group"
                  label="&view.groupDay.label;"
                  accesskey="&view.groupDay.accesskey;"/>
        <menuitem id="GroupBySite" type="radio" name="group"
                  label="&view.groupSite.label;"
                  accesskey="&view.groupSite.accesskey;"/>
        <menuitem id="GroupByBoth" type="radio" name="group"
                  label="&view.groupDayAndSite.label;"
                  accesskey="&view.groupDayAndSite.accesskey;"/>
      </menupopup>
    </menu>
  </menupopup>
</overlay>
