329269 various improvements to view initialization r=annie.sullivan@gmail.com 330736 - bug in query serialization r=brettw@gmail.com
git-svn-id: svn://10.0.0.236/trunk@192511 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -441,7 +441,7 @@
|
||||
label="&bookmarksMenu.label;" accesskey="&bookmarksMenu.accesskey;"
|
||||
ondragover="BookmarksEventHandler.onDragOver(event);">
|
||||
<menupopup id="bookmarksMenuPopup"
|
||||
type="places"
|
||||
type="places" asyncinit="true"
|
||||
place="place:&folder=2&group=3&expandQueries=1"
|
||||
context="placesContext"
|
||||
openInTabs="children"
|
||||
|
||||
@@ -172,8 +172,10 @@
|
||||
<command id="Tools:Sanitize" oncommand="gBrowserGlue.sanitize(window || null);"/>
|
||||
#ifdef MOZ_PLACES
|
||||
#include ../../components/places/content/commands.inc
|
||||
<command id="Browser:ShowBookmarks" oncommand="PlacesCommandHook.showPlacesOrganizer('bookmarks');"/>
|
||||
<command id="Browser:ShowHistory" oncommand="PlacesCommandHook.showPlacesOrganizer('history');"/>
|
||||
<command id="Browser:ShowBookmarks"
|
||||
oncommand="PlacesCommandHook.showPlacesOrganizer(ORGANIZER_ROOT_BOOKMARKS);"/>
|
||||
<command id="Browser:ShowHistory"
|
||||
oncommand="PlacesCommandHook.showPlacesOrganizer(ORGANIZER_ROOT_HISTORY);"/>
|
||||
<command id="Browser:SearchHistory" oncommand="HistoryMenu.showPlacesSearch();"/>
|
||||
<command id="Browser:ClearHistory" oncommand="HistoryMenu.clearHistory();"/>
|
||||
#endif
|
||||
|
||||
@@ -865,10 +865,6 @@ function delayedStartup()
|
||||
document.getElementById("PersonalToolbar")
|
||||
.controllers.appendController(BookmarksMenuController);
|
||||
#else
|
||||
var bookmarksBar = document.getElementById("bookmarksBarContent");
|
||||
bookmarksBar.init();
|
||||
var bookmarksMenuPopup = document.getElementById("bookmarksMenuPopup");
|
||||
bookmarksMenuPopup.init();
|
||||
window.controllers.appendController(PlacesController);
|
||||
#endif
|
||||
|
||||
@@ -6376,13 +6372,24 @@ var PlacesCommandHook = {
|
||||
|
||||
/**
|
||||
* Opens the Places Organizer.
|
||||
* @param mode
|
||||
* The mode to display the window with ("bookmarks" or "history").
|
||||
* @param place
|
||||
* The place to select in the organizer window (a place: URI)
|
||||
*/
|
||||
showPlacesOrganizer: function PCH_showPlacesOrganizer(mode) {
|
||||
// TODO: check for an existing one and focus it instead.
|
||||
openDialog("chrome://browser/content/places/places.xul",
|
||||
"", "dialog=no,resizable", mode);
|
||||
showPlacesOrganizer: function PCH_showPlacesOrganizer(place) {
|
||||
var wm =
|
||||
Cc["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(Ci.nsIWindowMediator);
|
||||
var organizer = wm.getMostRecentWindow("Places:Organizer");
|
||||
if (!organizer) {
|
||||
// No currently open places window, so open one with the specified mode.
|
||||
openDialog("chrome://browser/content/places/places.xul",
|
||||
"", "dialog=no,resizable", place);
|
||||
}
|
||||
else {
|
||||
// Set the mode on an existing places window.
|
||||
organizer.selectPlaceURI(place);
|
||||
organizer.focus();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -6434,7 +6441,7 @@ var HistoryMenu = {
|
||||
showPlacesSearch: function PHM_showPlacesSearch() {
|
||||
// XXX The places view needs to be updated before this
|
||||
// does something different than show history.
|
||||
PlacesCommandHook.showPlacesOrganizer("history");
|
||||
PlacesCommandHook.showPlacesOrganizer(ORGANIZER_ROOT_HISTORY);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -6442,8 +6449,9 @@ var HistoryMenu = {
|
||||
* (XXX This might be changed to show the Clear Private Data menu instead)
|
||||
*/
|
||||
clearHistory: function PHM_clearHistory() {
|
||||
var globalHistory = Components.classes["@mozilla.org/browser/global-history;2"]
|
||||
.getService(Components.interfaces.nsIBrowserHistory);
|
||||
var globalHistory =
|
||||
Cc["@mozilla.org/browser/global-history;2"].
|
||||
getService(Ci.nsIBrowserHistory);
|
||||
globalHistory.removeAllPages();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -280,11 +280,11 @@
|
||||
|
||||
#ifdef MOZ_PLACES
|
||||
<toolbarbutton id="bookmarksBarShowPlaces"
|
||||
oncommand="PlacesCommandHook.showPlacesOrganizer('history');"/>
|
||||
oncommand="PlacesCommandHook.showPlacesOrganizer(ORGANIZER_ROOT_HISTORY);"/>
|
||||
<toolbaritem flex="1" id="personal-bookmarks" title="&bookmarksItem.title;">
|
||||
<hbox id="bookmarksBarContent" flex="1" type="places"
|
||||
place="place:&folder=3&group=3&expandQueries=1"
|
||||
context="placesContext"
|
||||
context="placesContext" asyncinit="true"
|
||||
onclick="BookmarksEventHandler.onClick(event);"
|
||||
oncommand="BookmarksEventHandler.onCommand(event);"
|
||||
onpopupshowing="BookmarksEventHandler.onPopupShowing(event);"/>
|
||||
|
||||
Reference in New Issue
Block a user