Bug 571752 - Add History to the Firefox button menu. r=dao

This commit is contained in:
Marco Bonardo 2010-06-16 12:00:31 +02:00
parent 08afd68fed
commit 285ced8a7b
5 changed files with 36 additions and 10 deletions

View File

@ -455,15 +455,15 @@
</menu>
<menu id="history-menu"
oncommand="this._placesView._onCommand(event);"
onclick="checkForMiddleClick(this, event);"
label="&historyMenu.label;"
accesskey="&historyMenu.accesskey;">
<menupopup id="goPopup"
#ifndef XP_MACOSX
placespopup="true"
#endif
onpopupshowing="if (!document.getElementById('history-menu')._placesView)
oncommand="this.parentNode._placesView._onCommand(event);"
onclick="checkForMiddleClick(this, event);"
onpopupshowing="if (!this.parentNode._placesView)
new HistoryMenu(event);"
tooltip="bhTooltip"
popupsinherittooltip="true">
@ -497,7 +497,9 @@
#endif
command="Browser:ShowAllHistory"/>
<menuseparator id="startHistorySeparator"/>
<menuseparator id="endHistorySeparator" builder="end"/>
<menuseparator id="endHistorySeparator"
class="hide-if-empty-places-result"
builder="end"/>
<menu id="historyUndoMenu"
label="&historyUndoMenu.label;"
disabled="true">
@ -533,7 +535,7 @@
openInTabs="children"
oncommand="BookmarksEventHandler.onCommand(event);"
onclick="BookmarksEventHandler.onClick(event);"
onpopupshowing="if (!document.getElementById('bookmarksMenu')._placesView)
onpopupshowing="if (!this.parentNode._placesView)
new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');"
tooltip="bhTooltip" popupsinherittooltip="true">
<menuitem id="menu_bookmarkThisPage"

View File

@ -749,11 +749,6 @@ HistoryMenu.prototype = {
if (aEvent.target != aEvent.currentTarget)
return;
let resultNode = this.result.root;
resultNode.containerOpen = true;
document.getElementById("endHistorySeparator").hidden =
resultNode.childCount == 0;
this.toggleRecentlyClosedTabs();
this.toggleRecentlyClosedWindows();
},

View File

@ -192,6 +192,10 @@ toolbarbutton.bookmark-item {
width: auto;
}
menupopup[emptyplacesresult="true"] > .hide-if-empty-places-result {
display: none;
}
menuitem.spell-suggestion {
font-weight: bold;
}

View File

@ -421,6 +421,29 @@
key="key_find"
command="cmd_find"/>
<menuseparator/>
<menu id="appmenu_history"
label="&historyMenu.label;">
<menupopup id="appmenu_history_popup"
placespopup="true"
oncommand="this.parentNode._placesView._onCommand(event);"
onclick="checkForMiddleClick(this, event);"
onpopupshowing="if (!this.parentNode._placesView)
new HistoryMenu(event);"
tooltip="bhTooltip"
popupsinherittooltip="true">
<menuitem id="appmenu_sanitizeHistory"
label="&clearRecentHistory.label;"
key="key_sanitize"
command="Tools:Sanitize"/>
<menuseparator/>
<menuitem id="appmenu_showAllHistory"
label="&showAllHistoryCmd2.label;"
key="showAllHistoryKb"
command="Browser:ShowAllHistory"/>
<menuseparator class="hide-if-empty-places-result"/>
</menupopup>
</menu>
<menuseparator/>
<menu id="appmenu_customize"
label="&appMenuCustomize.label;">
<menupopup id="appmenu_customizeMenu"

View File

@ -256,6 +256,7 @@ PlacesViewBase.prototype = {
let cc = resultNode.childCount;
if (cc > 0) {
aPopup.removeAttribute("emptyplacesresult");
if (aPopup._emptyMenuItem)
aPopup._emptyMenuItem.hidden = true;
@ -265,6 +266,7 @@ PlacesViewBase.prototype = {
}
}
else {
aPopup.setAttribute("emptyplacesresult", "true");
// This menu is empty. If there is no static content, add
// an element to show it is empty.
if (aPopup._startMarker == -1 && aPopup._endMarker == -1)