<!-- ***** BEGIN LICENSE BLOCK *****
   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
   -
   - The contents of this file are subject to the Mozilla Public License Version
   - 1.1 (the "License"); you may not use this file except in compliance with
   - the License. You may obtain a copy of the License at
   - http://www.mozilla.org/MPL/
   -
   - Software distributed under the License is distributed on an "AS IS" basis,
   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   - for the specific language governing rights and limitations under the
   - License.
   -
   - The Original Code is mozilla.org code.
   -
   - The Initial Developer of the Original Code is
   - Netscape Communications Corporation.
   - Portions created by the Initial Developer are Copyright (C) 1998
   - the Initial Developer. All Rights Reserved.
   -
   - Contributor(s):
   -   Ben Goodger <beng@google.com>
   -   Asaf Romano <mano@mozilla.com>
   -   Robert Kaiser <kairo@kairo.at>
   -
   - Alternatively, the contents of this file may be used under the terms of
   - either the GNU General Public License Version 2 or later (the "GPL"), or
   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   - in which case the provisions of the GPL or the LGPL are applicable instead
   - of those above. If you wish to allow use of your version of this file only
   - under the terms of either the GPL or the LGPL, and not to allow others to
   - use your version of this file under the terms of the MPL, indicate your
   - decision by deleting the provisions above and replace them with the notice
   - and other provisions required by the LGPL or the GPL. If you do not delete
   - the provisions above, a recipient may use your version of this file under
   - the terms of any one of the MPL, the GPL or the LGPL.
   -
   - ***** END LICENSE BLOCK ***** -->

<!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/utils.js"/>
  <script type="application/javascript"
          src="chrome://communicator/content/history/controller.js"/>
  <script type="application/javascript"
          src="chrome://communicator/content/history/treeView.js"/>
  <script type="application/javascript"
          src="chrome://global/content/nsDragAndDrop.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="addBookmarkContextItem"
              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>
