Browse Source

[NAVIGATOR] Hack in a places enabled history menu

custom-2020
Matt A. Tobin 3 years ago committed by Roy Tam
parent
commit
78264c472f
  1. 5
      navigator/base/content/navigator.css
  2. 11
      navigator/base/content/navigatorOverlay.xul
  3. 12
      navigator/components/bookmarks/content/browser-places.js

5
navigator/base/content/navigator.css

@ -125,3 +125,8 @@ popupnotification-centeritem {
display: -moz-box;
-moz-box-pack: center;
}
/* History Menu Seperator */
menupopup[emptyplacesresult="true"] > .hide-if-empty-places-result {
display: none;
}

11
navigator/base/content/navigatorOverlay.xul

@ -29,7 +29,7 @@
<script type="application/javascript"
src="chrome://navigator/content/navigator.js"/>
<!-- Places Bookmarks Utilities -->
<!-- Places Utilities -->
<script type="application/javascript"
src="chrome://communicator/content/places/browserPlacesViews.js"/>
<script type="application/javascript"
@ -417,7 +417,12 @@
label="&historyMenu.label;"
accesskey="&historyMenu.accesskey;">
<menupopup id="historyPopup"
onpopupshowing="updateRecentMenuItems();">
placespopup="true"
context="placescontext"
oncommand="BookmarksEventHandler.onCommand(event);"
onclick="BookmarksEventHandler.onClick(event);"
onpopupshowing="updateRecentMenuItems();
if (!this.parentNode._placesView) { new HistoryMenu(event); }">
<menuitem id="menu_showAllHistory"
label="&historyCmd.label;"
accesskey="&historyCmd.accesskey;"
@ -447,6 +452,8 @@
onpopupshowing="event.stopPropagation(); updateRecentWindows(this);"
oncommand="undoCloseWindow(event.target.value);"/>
</menu>
<menuseparator id="startHistorySeparator"
class="hide-if-empty-places-result"/>
</menupopup>
</menu>

12
navigator/components/bookmarks/content/browser-places.js

@ -892,3 +892,15 @@ var BookmarksMenu = {
}
},
};
// Handles the bookmarks menu popup
function HistoryMenu(aPopupShowingEvent) {
// Workaround for Bug 610187. The sidebar does not include all the Places
// views definitions, and we don't need them there.
// Defining the prototype inheritance in the prototype itself would cause
// browser.js to halt on "PlacesMenu is not defined" error.
this.__proto__.__proto__ = PlacesMenu.prototype;
PlacesMenu.call(this, aPopupShowingEvent, "place:queryType=0&sort=4&maxResults=15");
}
HistoryMenu.prototype = {};

Loading…
Cancel
Save