From 3618ce030e7cc681c8742c22edf55ddc686264c6 Mon Sep 17 00:00:00 2001 From: "beng%bengoodger.com" Date: Fri, 17 Mar 2006 02:01:06 +0000 Subject: [PATCH] 329269 various improvements to view initialization r=annie.sullivan@gmail.com 330736 - bug in query serialization r=brettw@gmail.com --- browser/base/content/browser-menubar.inc | 2 +- browser/base/content/browser-sets.inc | 6 +- browser/base/content/browser.js | 34 +- browser/base/content/browser.xul | 4 +- .../places/content/bookmarkProperties.js | 8 +- .../places/content/bookmarkProperties.xul | 1 + .../components/places/content/controller.js | 294 ++++-------------- browser/components/places/content/menu.xml | 93 ++++-- .../components/places/content/organizer.css | 5 + browser/components/places/content/places.js | 220 +++---------- browser/components/places/content/places.xul | 54 ++-- browser/components/places/content/toolbar.xml | 91 ++++-- browser/components/places/content/tree.xml | 282 +++++++++-------- .../places/src/nsNavHistoryQuery.cpp | 4 +- .../chrome/browser/places/default_places.html | 2 +- .../en-US/chrome/browser/places/places.dtd | 2 + browser/locales/en-US/profile/bookmarks.html | 2 +- .../winstripe/browser/places/places.css | 15 +- 18 files changed, 476 insertions(+), 643 deletions(-) diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc index cb171a57b475..89359cd31a5c 100644 --- a/browser/base/content/browser-menubar.inc +++ b/browser/base/content/browser-menubar.inc @@ -441,7 +441,7 @@ label="&bookmarksMenu.label;" accesskey="&bookmarksMenu.accesskey;" ondragover="BookmarksEventHandler.onDragOver(event);"> #ifdef MOZ_PLACES #include ../../components/places/content/commands.inc - - + + #endif diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index ba10ecc6b175..ed35a67d1ae2 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -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(); } }; diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 57c67e799e3b..57ade544379c 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -280,11 +280,11 @@ #ifdef MOZ_PLACES + oncommand="PlacesCommandHook.showPlacesOrganizer(ORGANIZER_ROOT_HISTORY);"/> diff --git a/browser/components/places/content/bookmarkProperties.js b/browser/components/places/content/bookmarkProperties.js index 6f1877bb8949..090a65c2fa6e 100755 --- a/browser/components/places/content/bookmarkProperties.js +++ b/browser/components/places/content/bookmarkProperties.js @@ -248,11 +248,9 @@ var BookmarkPropertiesPanel = { this._controller = controller; this.folderTree = this._dialogWindow.document.getElementById("folder-tree"); - this.folderTree.controllers.appendController(this._controller); - this.folderTree.init(new ViewConfig([TYPE_X_MOZ_PLACE_CONTAINER], - ViewConfig.GENERIC_DROP_TYPES, - true, false, 4, true)); - this.folderTree.loadFolder(this._bms.placesRoot); + this.folderTree.peerDropTypes = []; + this.folderTree.childDropTypes = []; + this.folderTree.excludeItems = true; this._initAssignableFolderResult(); this._populateProperties(); diff --git a/browser/components/places/content/bookmarkProperties.xul b/browser/components/places/content/bookmarkProperties.xul index a76bacad1279..791b3c78c89c 100755 --- a/browser/components/places/content/bookmarkProperties.xul +++ b/browser/components/places/content/bookmarkProperties.xul @@ -79,6 +79,7 @@ class="placesTree" flex="1" type="places" + place="place:&folder=1&group=3&excludeItems=1" hidecolumnpicker="true" seltype="multiple"> diff --git a/browser/components/places/content/controller.js b/browser/components/places/content/controller.js index c66fb7344fcb..5ce3d69e92d6 100755 --- a/browser/components/places/content/controller.js +++ b/browser/components/places/content/controller.js @@ -53,6 +53,11 @@ const SELECTION_IS_CHANGEABLE = 0x10; const SELECTION_IS_REMOVABLE = 0x20; const SELECTION_IS_MOVABLE = 0x40; +// These need to be kept in sync with the meaning of these roots in +// default_places.html! +const ORGANIZER_ROOT_HISTORY = "place:&beginTime=-2592000000000&beginTimeRef=1&endTime=7200000000&endTimeRef=2&sort=4&type=1"; +const ORGANIZER_ROOT_BOOKMARKS = "place:&folder=2&group=3&excludeItems=1"; + // Place entries that are containers, e.g. bookmark folders or queries. const TYPE_X_MOZ_PLACE_CONTAINER = "text/x-moz-place-container"; // Place entries that are bookmark separators. @@ -85,8 +90,6 @@ const NEWLINE= "\n"; const NEWLINE = "\r\n"; #endif -const MENU_URI = "chrome://browser/content/places/menu.xml#places-menupopup"; - function STACK(args) { var temp = arguments.callee.caller; while (temp) { @@ -115,23 +118,6 @@ function InsertionPoint(folderId, index, orientation) { this.orientation = orientation; } -/** - * Initialization Configuration for a View - * @constructor - */ -function ViewConfig(dropTypes, dropOnTypes, excludeItems, - expandQueries, firstDropIndex, filterTransactions) { - this.dropTypes = dropTypes; - this.dropOnTypes = dropOnTypes; - this.excludeItems = excludeItems; - this.expandQueries = expandQueries; - this.firstDropIndex = firstDropIndex; - this.filterTransactions = filterTransactions; -} -ViewConfig.GENERIC_DROP_TYPES = [TYPE_X_MOZ_PLACE_CONTAINER, - TYPE_X_MOZ_PLACE_SEPARATOR, TYPE_X_MOZ_PLACE, - TYPE_X_MOZ_URL]; - /** * Manages grouping options for a particular view type. * @param pref @@ -223,6 +209,64 @@ function asFullVisit(node){ return QI_node(node, Ci.nsINavHistoryFullVisitResult function asContainer(node){ return QI_node(node, Ci.nsINavHistoryContainerResultNode);} function asQuery(node) { return QI_node(node, Ci.nsINavHistoryQueryResultNode); } +/** + * A View Configuration + */ +function ViewConfig(peerDropTypes, childDropTypes, excludeItems, expandQueries, + peerDropIndex) { + this.peerDropTypes = peerDropTypes; + this.childDropTypes = childDropTypes; + this.excludeItems = excludeItems; + this.expandQueries = expandQueries; + this.peerDropIndex = peerDropIndex; +} +ViewConfig.GENERIC_DROP_TYPES = + [TYPE_X_MOZ_PLACE_CONTAINER, + TYPE_X_MOZ_PLACE_SEPARATOR, + TYPE_X_MOZ_PLACE, + TYPE_X_MOZ_URL]; + +/** + * Configures Views, applying some meta-model rules. These rules are model-like, + * e.g. must apply everwhere a model is instantiated, but are not actually stored + * in the data model itself. For example, you can't drag leaf items onto the + * places root. This needs to be enforced automatically everywhere a view of + * that model is instantiated. + */ +var ViewConfigurator = { + rules: { + "folder=1": new ViewConfig([TYPE_X_MOZ_PLACE_CONTAINER], + ViewConfig.GENERIC_DROP_TYPES, + true, false, 4) + }, + + /** + * Applies rules to a specific view. + */ + configure: function PC_configure(view) { + // Determine what place the view is showing. + var place = view.place; + + // Find a ruleset that matches the current place. + var rules = null; + for (var test in this.rules) { + if (place.indexOf(test) != -1) { + rules = this.rules[test]; + break; + } + } + + // If rules are found, apply them. + if (rules) { + view.peerDropTypes = rules.peerDropTypes; + view.childDropTypes = rules.childDropTypes; + view.excludeItems = rules.excludeItems; + view.expandQueries = rules.expandQueries; + view.peerDropIndex = rules.peerDropIndex; + } + } +}; + /** * The Master Places Controller */ @@ -292,16 +336,6 @@ var PlacesController = { return this._annotations; }, - /** UI Text Strings */ - - __strings: null, - get _strings() { - if (!this.__strings) { - this.__strings = document.getElementById("placeBundle"); - } - return this.__strings; - }, - /** * Generates a HistoryResultNode for the contents of a folder. * @param folderId @@ -328,20 +362,6 @@ var PlacesController = { return asContainer(result.root); }, - /** - * Gets a place: URI for the given queries and options. - * @param queries - * An array of NavHistoryQueries - * @param options - * A NavHistoryQueryOptions object - * @returns A place: URI encoding the parameters. - */ - getPlaceURI: function PC_getPlaceURI(queries, options) { - var queryString = this.history.queriesToQueryString(queries, queries.length, - options); - return this._uri(queryString); - }, - /** * The currently active Places view. */ @@ -367,20 +387,6 @@ var PlacesController = { return this._tm; }, - /** - * The current groupable Places view. This is tracked independently of the - * |activeView| because the activeView may change to something that isn't - * groupable, but clicking the Grouping buttons should still work. - */ - _groupableView: null, - get groupableView() { - return this._groupableView; - }, - set groupableView(groupableView) { - this._groupableView = groupableView; - return this._groupableView; - }, - isCommandEnabled: function PC_isCommandEnabled(command) { //LOG("isCommandEnabled: " + command); if (command == "cmd_undo") @@ -459,7 +465,7 @@ var PlacesController = { * view, false otherwise. */ _hasClipboardData: function PC__hasClipboardData() { - var types = this._activeView.supportedDropTypes; + var types = this._activeView.peerDropTypes; var flavors = Cc["@mozilla.org/supports-array;1"]. createInstance(Ci.nsISupportsArray); @@ -977,121 +983,6 @@ var PlacesController = { } }, - /** - * Loads the contents of a query node into a view with the specified grouping - * and sort options. - * @param view - * The tree view to load the contents of the node into - * @param node - * The node to load the contents of - * @param groupings - * Groupings to be applied to the displayed contents, [] for no - * grouping - * @param sortingMode - * The sorting mode to be applied to the displayed contents. - */ - loadNodeIntoView: function PC_loadQueries(view, node, groupings, sortingMode) { - NS_ASSERT(view, "Must have a view to load node contents into!"); - asQuery(node); - var queries = node.getQueries({ }); - var newQueries = []; - for (var i = 0; i < queries.length; ++i) { - var query = queries[i].clone(); - newQueries.push(query); - } - var newOptions = node.queryOptions.clone(); - - // Update the grouping mode only after persisting, so that the URI is not - // changed. - var e = new Error(); - newOptions.setGroupingMode(groupings, groupings.length); - - // Set the sort order of the results - newOptions.sortingMode = sortingMode; - - // Reload the view - view.load(newQueries, newOptions); - }, - - - /** - * A hash of groupers that supply grouping options for queries of a given - * type. This is an override of grouping options that might be encoded in - * a saved place: URI - */ - groupers: { }, - - /** - * Rebuilds the view using a new set of grouping options. - * @param groupings - * An array of grouping options, see nsINavHistoryQueryOptions - * for details. - * @param sortingMode - * The type of sort that should be applied to the results. - */ - setGroupingMode: function PC_setGroupingMode(groupings, sortingMode) { - if (!this._groupableView) - return; - var node = this._groupableView.getResult().root; - this.loadNodeIntoView(this._groupableView, node, groupings, sortingMode); - - // Persist this selection - if (this._groupableView.isBookmarks && "bookmark" in this.groupers) - this.groupers.bookmark.value = groupings; - else if ("generic" in this.groupers) - this.groupers.generic.value = groupings; - }, - - /** - * Group the current content view by domain - */ - groupBySite: function PC_groupBySite() { - var groupings = [Ci.nsINavHistoryQueryOptions.GROUP_BY_DOMAIN]; - var sortMode = Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_ASCENDING; - this.setGroupingMode(groupings, sortMode); - }, - - /** - * Group the current content view by folder - */ - groupByFolder: function PC_groupByFolder() { - var groupings = [Ci.nsINavHistoryQueryOptions.GROUP_BY_FOLDER]; - var sortMode = Ci.nsINavHistoryQueryOptions.SORT_BY_NONE; - this.setGroupingMode(groupings, sortMode); - }, - - /** - * Ungroup the current content view (i.e. show individual pages) - */ - groupByPage: function PC_groupByPage() { - this.setGroupingMode([], - Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING); - }, - - /** - * Loads all results matching a certain annotation, grouped and sorted as - * specified. - * @param annotation - * The annotation to match - * @param groupings - * The grouping to apply to the displayed results - * @param sortingMode - * The sorting to apply to the displayed results - */ - groupByAnnotation: - function PC_groupByAnnotation(annotation, groupings, sortingMode) { - NS_ASSERT(this._groupableView, "Need a groupable view to load!"); - if (!this._groupableView) - return; - var query = this.history.getNewQuery(); - var options = this.history.getNewQueryOptions(); - options.setGroupingMode(groupings, groupings.length); - options.sortingMode = sortingMode; - query.annotation = annotation; - this.groupableView.load([query], options); - LOG("CS: " + this.history.queriesToQueryString([query], 1, options)); - }, - /** * Create a new Bookmark folder somewhere. Prompts the user for the name * of the folder. @@ -1647,9 +1538,9 @@ var PlacesControllerDragHelper = { var session = this.getSession(); if (session) { if (orientation != NHRVO.DROP_ON) - var types = view.supportedDropTypes; + var types = view.peerDropTypes; else - types = view.supportedDropOnTypes; + types = view.childDropTypes; for (var i = 0; i < types.length; ++i) { if (session.isDataFlavorSupported(types[i])) return true; @@ -1674,9 +1565,9 @@ var PlacesControllerDragHelper = { Cc["@mozilla.org/widget/transferable;1"]. createInstance(Ci.nsITransferable); if (orientation != NHRVO.DROP_ON) - var types = view.supportedDropTypes; + var types = view.peerDropTypes; else - types = view.supportedDropOnTypes; + types = view.childDropTypes; for (var j = 0; j < types.length; ++j) xferable.addDataFlavor(types[j]); return xferable; @@ -1738,8 +1629,6 @@ PlacesBaseTransaction.prototype = { throw Cr.NS_ERROR_NOT_IMPLEMENTED; }, - pageTransaction: false, - get isTransient() { return false; }, @@ -1756,8 +1645,6 @@ function PlacesAggregateTransaction(name, transactions) { this._transactions = transactions; this._name = name; this.redoTransaction = this.doTransaction; - this.pageTransaction = PlacesController.activeView.filterTransactions; - NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); } PlacesAggregateTransaction.prototype = { __proto__: PlacesBaseTransaction.prototype, @@ -1791,8 +1678,6 @@ function PlacesCreateFolderTransaction(name, container, index) { this._index = index; this._id = null; this.redoTransaction = this.doTransaction; - this.pageTransaction = PlacesController.activeView.filterTransactions; - NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); } PlacesCreateFolderTransaction.prototype = { __proto__: PlacesBaseTransaction.prototype, @@ -1816,8 +1701,6 @@ function PlacesCreateItemTransaction(uri, container, index) { this._container = container; this._index = index; this.redoTransaction = this.doTransaction; - this.pageTransaction = PlacesController.activeView.filterTransactions; - NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); } PlacesCreateItemTransaction.prototype = { __proto__: PlacesBaseTransaction.prototype, @@ -1866,8 +1749,6 @@ function PlacesMoveFolderTransaction(id, oldContainer, oldIndex, newContainer, n this._newContainer = newContainer; this._newIndex = newIndex; this.redoTransaction = this.doTransaction; - this.pageTransaction = PlacesController.activeView.filterTransactions; - NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); } PlacesMoveFolderTransaction.prototype = { __proto__: PlacesBaseTransaction.prototype, @@ -1893,8 +1774,6 @@ function PlacesMoveItemTransaction(uri, oldContainer, oldIndex, newContainer, ne this._newContainer = newContainer; this._newIndex = newIndex; this.redoTransaction = this.doTransaction; - this.pageTransaction = PlacesController.activeView.filterTransactions; - NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); } PlacesMoveItemTransaction.prototype = { __proto__: PlacesBaseTransaction.prototype, @@ -1951,8 +1830,6 @@ function PlacesRemoveFolderTransaction(id, oldContainer, oldIndex) { this._oldFolderTitle = null; this._contents = null; // The encoded contents of this folder this.redoTransaction = this.doTransaction; - this.pageTransaction = PlacesController.activeView.filterTransactions; - NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); } PlacesRemoveFolderTransaction.prototype = { __proto__: PlacesBaseTransaction.prototype, @@ -2030,8 +1907,6 @@ function PlacesRemoveItemTransaction(uri, oldContainer, oldIndex) { this._oldContainer = oldContainer; this._oldIndex = oldIndex; this.redoTransaction = this.doTransaction; - this.pageTransaction = PlacesController.activeView.filterTransactions; - NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); } PlacesRemoveItemTransaction.prototype = { __proto__: PlacesBaseTransaction.prototype, @@ -2039,13 +1914,11 @@ PlacesRemoveItemTransaction.prototype = { doTransaction: function PRIT_doTransaction() { LOG("Remove Item: " + this._uri.spec + " from: " + this._oldContainer + "," + this._oldIndex); this.bookmarks.removeItem(this._oldContainer, this._uri); - LOG("DO: PAGETXN: " + this.pageTransaction); }, undoTransaction: function PRIT_undoTransaction() { LOG("UNRemove Item: " + this._uri.spec + " from: " + this._oldContainer + "," + this._oldIndex); this.bookmarks.insertItem(this._oldContainer, this._uri, this._oldIndex); - LOG("UNDO: PAGETXN: " + this.pageTransaction); } }; @@ -2078,8 +1951,6 @@ function PlacesEditFolderTransaction(id, oldAttributes, newAttributes) { this._oldAttributes = oldAttributes; this._newAttributes = newAttributes; this.redoTransaction = this.doTransaction; - this.pageTransaction = PlacesController.activeView.filterTransactions; - NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); } PlacesEditFolderTransaction.prototype = { __proto__: PlacesBaseTransaction.prototype, @@ -2103,8 +1974,6 @@ function PlacesEditItemTransaction(uri, newAttributes) { this._newAttributes = newAttributes; this._oldAttributes = { }; this.redoTransaction = this.doTransaction; - this.pageTransaction = PlacesController.activeView.filterTransactions; - NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); } PlacesEditItemTransaction.prototype = { __proto__: PlacesBaseTransaction.prototype, @@ -2133,31 +2002,4 @@ PlacesEditItemTransaction.prototype = { } } }; -/* - - AVI rules: - - readonly attribute boolean hasSelection; - readonly attribute boolean hasSingleSelection; - readonly attribute boolean selectionIsContainer; - readonly attribute boolean containerIsOpen; - void getSelectedNodes([retval, array, size_is(nodeCount)] out nodes, out nodeCount); - - selection flags - flags: - SELECTION_CONTAINS_URI - SELECTION_CONTAINS_CONTAINER_OPEN - SELECTION_CONTAINS_CONTAINER_CLOSED - SELECTION_CONTAINS_CHANGEABLE - SELECTION_CONTAINS_REMOVABLE - SELECTION_CONTAINS_MOVABLE - - Given a: - - view, via AVI - - query - - query options - - Determine the state of commands! - -*/ diff --git a/browser/components/places/content/menu.xml b/browser/components/places/content/menu.xml index 4e70fc041297..44bfb54ff420 100755 --- a/browser/components/places/content/menu.xml +++ b/browser/components/places/content/menu.xml @@ -10,39 +10,42 @@ extends="chrome://global/content/bindings/popup.xml#popup"> - + null + + + + - - + + + + + + + + + + + + - false + + 0 - - [TYPE_X_MOZ_PLACE_CONTAINER, TYPE_X_MOZ_PLACE_SEPARATOR, TYPE_X_MOZ_PLACE, TYPE_X_MOZ_URL] - - - - [TYPE_X_MOZ_PLACE_CONTAINER, TYPE_X_MOZ_PLACE_SEPARATOR, TYPE_X_MOZ_PLACE, TYPE_X_MOZ_URL] - + + ViewConfig.GENERIC_DROP_TYPES + + ViewConfig.GENERIC_DROP_TYPES + + + false + + + false + + - + #include commands.inc - + + + + + @@ -42,10 +47,10 @@ - - - - + + + + @@ -157,25 +162,19 @@ - - - - - - - - - - - + + + + + + - - + + #include advancedSearch.inc + flex="1" type="places" + ondblclick="PlacesController.mouseLoadURI(event);"> diff --git a/browser/components/places/content/toolbar.xml b/browser/components/places/content/toolbar.xml index 6836e1528aaa..42fb1e4a7b3e 100755 --- a/browser/components/places/content/toolbar.xml +++ b/browser/components/places/content/toolbar.xml @@ -48,14 +48,22 @@ - + @@ -89,6 +93,8 @@ null null + + - - - - + + + - - - - + return val; + ]]> + + + + + + + + + - false + + 0 - - [TYPE_X_MOZ_PLACE_CONTAINER, TYPE_X_MOZ_PLACE_SEPARATOR, TYPE_X_MOZ_PLACE, TYPE_X_MOZ_URL] - - - - [TYPE_X_MOZ_PLACE_CONTAINER, TYPE_X_MOZ_PLACE_SEPARATOR, TYPE_X_MOZ_PLACE, TYPE_X_MOZ_URL] - + + ViewConfig.GENERIC_DROP_TYPES + + ViewConfig.GENERIC_DROP_TYPES + + + false + + + false + + - - - - - - - - - - - - - - + null @@ -76,7 +42,7 @@ // existing ones or create new ones. var options = this.getResult().queryOptions; if (!options) - options = this._places.getNewQueryOptions(); + options = this.history.getNewQueryOptions(); return options; ]]> @@ -89,10 +55,10 @@ return null; ]]> @@ -105,90 +71,160 @@ // preserve grouping var options = this.getResult().queryOptions; if (!options) - options = this._places.getNewQueryOptions(); + options = this.history.getNewQueryOptions(); - var query = this._places.getNewQuery(); + var query = this.history.getNewQuery(); query.searchTerms = filterString; query.onlyBookmarked = onlyBookmarks; //if (onlyBookmarks) // query.setFolders(folderRestrict, folderRestrict.length); - this.load([query], this.getBestOptions()); + this._load([query], this.getBestOptions()); ]]> - - - - - - - - - - - + + - - + + + + + + + + + = 0; --i) { + var index = result.treeIndexForNode(parents[i]); + if (view.isContainer(index) && !view.isContainerOpen(index)) + view.toggleOpenState(index); + } + // Select the specified node... + index = result.treeIndexForNode(node); + view.selection.select(index); + // ... and ensure it's visible, not scrolled off somewhere. + this.treeBoxObject.ensureRowIsVisible(index); + ]]> + + + + + + + + + + + - - + + = 1; ]]> - + - + + - + + + - + - + - + - - true + + 0 - - 0 + + ViewConfig.GENERIC_DROP_TYPES - - null + + ViewConfig.GENERIC_DROP_TYPES - - null + + false - - null - - - null + + false - + @@ -544,7 +580,7 @@ var node = index != -1 ? result.nodeForTreeIndex(index) : result.root; // Cannot drop before fixed items in the list. if (node.parent == result.root && - PlacesController.getIndexOfNode(node) < this._self.firstDropIndex && + PlacesController.getIndexOfNode(node) < this._self.peerDropIndex && orientation != NHRVO.DROP_ON) return false; diff --git a/browser/components/places/src/nsNavHistoryQuery.cpp b/browser/components/places/src/nsNavHistoryQuery.cpp index 34aeba39c2ab..db80f937d7a7 100644 --- a/browser/components/places/src/nsNavHistoryQuery.cpp +++ b/browser/components/places/src/nsNavHistoryQuery.cpp @@ -1234,8 +1234,8 @@ AppendInt64KeyValueIfNonzero(nsACString& aString, NS_ASSERTION(NS_SUCCEEDED(rv), "Failure getting value"); if (value) { AppendAmpersandIfNonempty(aString); - nsCAutoString appendMe(aName); - appendMe.Append(aName); + aString += aName; + nsCAutoString appendMe("="); appendMe.AppendInt(value); aString.Append(appendMe); } diff --git a/browser/locales/en-US/chrome/browser/places/default_places.html b/browser/locales/en-US/chrome/browser/places/default_places.html index e62cc2cdcb93..bcf16342f8d2 100644 --- a/browser/locales/en-US/chrome/browser/places/default_places.html +++ b/browser/locales/en-US/chrome/browser/places/default_places.html @@ -6,7 +6,7 @@ Bookmarks and History

Bookmarks and History

-

History +
History
Shows all browsing history

Bookmarks Menu

Add bookmarks to this folder to see them displayed on the Bookmarks Menu diff --git a/browser/locales/en-US/chrome/browser/places/places.dtd b/browser/locales/en-US/chrome/browser/places/places.dtd index 2b722b143618..7d5a7ffd5e07 100644 --- a/browser/locales/en-US/chrome/browser/places/places.dtd +++ b/browser/locales/en-US/chrome/browser/places/places.dtd @@ -8,6 +8,8 @@ "Close"> + Bookmarks and History

Bookmarks and History

-

History +
History
Shows all browsing history

Bookmarks Menu

diff --git a/browser/themes/winstripe/browser/places/places.css b/browser/themes/winstripe/browser/places/places.css index a166ed1b67f5..0a8642ec205b 100755 --- a/browser/themes/winstripe/browser/places/places.css +++ b/browser/themes/winstripe/browser/places/places.css @@ -15,15 +15,9 @@ } #placesList { - -moz-appearance: none; - width: 160px; - margin: 0px; - border: 0px; -} - -#placesListContainer { -moz-appearance: listbox; margin: 6px 0px 7px 6px; + width: 160px; } #placeContent { @@ -31,14 +25,17 @@ border: 0px; } -#content { +#contentView { margin: 6px 6px 7px 0px; -moz-appearance: listbox; } -treechildren::-moz-tree-image(title, container) { +treechildren::-moz-tree-image { padding-right: 2px; margin: 0px 2px; +} + +treechildren::-moz-tree-image(title, container) { list-style-image: url("chrome://global/skin/icons/folder-item.png") !important; -moz-image-region: rect(0px, 16px, 16px, 0px); }