browser/components/places/content/history-panel.xul
author Brendan Dahl <brendan.dahl@gmail.com>
Mon, 12 Mar 2018 10:43:35 -0700
changeset 461920 4e4b09a24ae786a8fffe7f3ba954b87ece7cf938
parent 458091 ba1808744ced3e0700950496f44e326c6e6ecf70
permissions -rw-r--r--
Bug 1442302 - Remove placesOverlay.xul. r=Gijs,mak,standard8 The overlay was responsible for script loading and defining three elements (bhTooltip, placesCommands, placesContext). In the majority of places where the overlay was included only part of it was used. To remove the overlay, the elements were each split into include files and moved into where they were used. For the scripts, a JS file was added that defines all the lazy modules and then this script, globalOverlay.js and utilityOverlay.js were inlined to everywhere that would have included them from the overlay. MozReview-Commit-ID: 8T5D46oYWLn

<?xml version="1.0"?> <!-- -*- Mode: xml; indent-tabs-mode: nil; -*- -->

# 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/.

<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>

<!DOCTYPE page [
<!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
%placesDTD;
<!ENTITY % editMenuDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
%editMenuDTD;
]>

<!-- we need to keep id="history-panel" for upgrade and switching
     between versions of the browser -->

<page id="history-panel" orient="vertical"
      xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
      onload="HistorySidebarInit();"
      onunload="SidebarUtils.setMouseoverURL('');">

  <script type="application/javascript"
          src="chrome://browser/content/bookmarks/sidebarUtils.js"/>
  <script type="application/javascript"
          src="chrome://browser/content/places/history-panel.js"/>
  <script type="application/javascript"
          src="chrome://global/content/globalOverlay.js"/>
  <script type="application/javascript"
          src="chrome://browser/content/utilityOverlay.js"/>
  <script type="application/javascript"><![CDATA[
    ChromeUtils.defineModuleGetter(window,
      "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
    ChromeUtils.defineModuleGetter(window,
      "PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
    ChromeUtils.defineModuleGetter(window,
      "PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");

    ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
    XPCOMUtils.defineLazyScriptGetter(window, "PlacesTreeView",
      "chrome://browser/content/places/treeView.js");
    XPCOMUtils.defineLazyScriptGetter(window,
      ["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],
       "chrome://browser/content/places/controller.js");
  ]]></script>

#include ../../../../toolkit/content/editMenuCommands.inc.xul

#include placesCommands.inc.xul

#include ../../../../toolkit/content/editMenuKeys.inc.xul
#ifdef XP_MACOSX
  <keyset id="editMenuKeysExtra">
    <key id="key_delete2" keycode="VK_BACK" command="cmd_delete"/>
  </keyset>
#endif

#include placesContextMenu.inc.xul
#include bookmarksHistoryTooltip.inc.xul

  <hbox id="sidebar-search-container">
    <textbox id="search-box" flex="1" type="search"
             placeholder="&historySearch.placeholder;"
             aria-controls="historyTree"
             oncommand="searchHistory(this.value);"/>
    <button id="viewButton" style="min-width:0px !important;" type="menu"
            label="&view.label;" accesskey="&view.accesskey;" selectedsort="day"
            persist="selectedsort">
      <menupopup>
        <menuitem id="bydayandsite" label="&byDayAndSite.label;"
                  accesskey="&byDayAndSite.accesskey;" type="radio"
                  oncommand="this.parentNode.parentNode.setAttribute('selectedsort', 'dayandsite'); GroupBy('dayandsite');"/>
        <menuitem id="bysite" label="&bySite.label;"
                  accesskey="&bySite.accesskey;" type="radio"
                  oncommand="this.parentNode.parentNode.setAttribute('selectedsort', 'site'); GroupBy('site');"/>
        <menuitem id="byday" label="&byDate.label;"
                  accesskey="&byDate.accesskey;"
                  type="radio"
                  oncommand="this.parentNode.parentNode.setAttribute('selectedsort', 'day'); GroupBy('day');"/>
        <menuitem id="byvisited" label="&byMostVisited.label;"
                  accesskey="&byMostVisited.accesskey;"
                  type="radio"
                  oncommand="this.parentNode.parentNode.setAttribute('selectedsort', 'visited'); GroupBy('visited');"/>
        <menuitem id="bylastvisited" label="&byLastVisited.label;"
                  accesskey="&byLastVisited.accesskey;"
                  type="radio"
                  oncommand="this.parentNode.parentNode.setAttribute('selectedsort', 'lastvisited'); GroupBy('lastvisited');"/>
      </menupopup>
    </button>
  </hbox>

  <tree id="historyTree"
        class="sidebar-placesTree"
        flex="1"
        type="places"
        context="placesContext"
        hidecolumnpicker="true"
        onkeypress="SidebarUtils.handleTreeKeyPress(event);"
        onclick="SidebarUtils.handleTreeClick(this, event, true);"
        onmousemove="SidebarUtils.handleTreeMouseMove(event);"
        onmouseout="SidebarUtils.setMouseoverURL('');">
    <treecols>
      <treecol id="title" flex="1" primary="true" hideheader="true"/>
    </treecols>
    <treechildren class="sidebar-placesTreechildren" flex="1" tooltip="bhTooltip"/>
  </tree>
</page>