зеркало из https://github.com/mozilla/gecko-dev.git
Bug 334451 - Places Organizer: places-list tree should not list bookmark items. This also fixes the selectBookmark dialog bustage from bug 359462. r=sspitzer.
This commit is contained in:
Родитель
7499f5da48
Коммит
0d8114cb33
|
@ -112,13 +112,9 @@ InsertionPoint.prototype.toString = function IP_toString() {
|
|||
/**
|
||||
* A View Configuration
|
||||
*/
|
||||
function ViewConfig(peerDropTypes, childDropTypes, excludeItems, excludeQueries,
|
||||
expandQueries, peerDropIndex) {
|
||||
function ViewConfig(peerDropTypes, childDropTypes, peerDropIndex) {
|
||||
this.peerDropTypes = peerDropTypes;
|
||||
this.childDropTypes = childDropTypes;
|
||||
this.excludeItems = excludeItems;
|
||||
this.excludeQueries = excludeQueries;
|
||||
this.expandQueries = expandQueries;
|
||||
this.peerDropIndex = peerDropIndex;
|
||||
}
|
||||
ViewConfig.GENERIC_DROP_TYPES =
|
||||
|
@ -137,8 +133,7 @@ ViewConfig.GENERIC_DROP_TYPES =
|
|||
var ViewConfigurator = {
|
||||
rules: {
|
||||
"folder=1": new ViewConfig([TYPE_X_MOZ_PLACE_CONTAINER],
|
||||
ViewConfig.GENERIC_DROP_TYPES,
|
||||
true, false, false, 4)
|
||||
ViewConfig.GENERIC_DROP_TYPES, 4)
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -432,15 +432,6 @@
|
|||
<!-- nsIPlacesView -->
|
||||
<field name="childDropTypes">ViewConfig.GENERIC_DROP_TYPES</field>
|
||||
|
||||
<!-- nsIPlacesView -->
|
||||
<field name="excludeItems">false</field>
|
||||
|
||||
<!-- nsIPlacesView -->
|
||||
<field name="excludeQueries">false</field>
|
||||
|
||||
<!-- nsIPlacesView -->
|
||||
<field name="expandQueries">false</field>
|
||||
|
||||
<!-- nsIPlacesView -->
|
||||
<method name="selectAll">
|
||||
<body><![CDATA[
|
||||
|
|
|
@ -185,8 +185,12 @@ var PlacesOrganizer = {
|
|||
var node = asQuery(this._places.selectedNode);
|
||||
LOG("Node URI: " + node.uri);
|
||||
var queries = node.getQueries({});
|
||||
|
||||
// Items are only excluded on the left pane
|
||||
var options = node.queryOptions.clone();
|
||||
options.excludeItems = false;
|
||||
this._content.load(queries,
|
||||
OptionsFilter.filter(queries, node.queryOptions, null));
|
||||
OptionsFilter.filter(queries, options, null));
|
||||
|
||||
// Make sure the query builder is hidden.
|
||||
PlacesQueryBuilder.hide();
|
||||
|
|
|
@ -442,15 +442,6 @@
|
|||
<!-- nsIPlacesView -->
|
||||
<field name="childDropTypes">ViewConfig.GENERIC_DROP_TYPES</field>
|
||||
|
||||
<!-- nsIPlacesView -->
|
||||
<field name="excludeItems">false</field>
|
||||
|
||||
<!-- nsIPlacesView -->
|
||||
<field name="excludeQueries">false</field>
|
||||
|
||||
<!-- nsIPlacesView -->
|
||||
<field name="expandQueries">false</field>
|
||||
|
||||
<!-- nsIPlacesView -->
|
||||
<method name="selectAll">
|
||||
<body><![CDATA[
|
||||
|
|
|
@ -128,10 +128,6 @@
|
|||
<parameter name="queries"/>
|
||||
<parameter name="options"/>
|
||||
<body><![CDATA[
|
||||
// override with our local options
|
||||
options.excludeItems = this.excludeItems;
|
||||
options.excludeQueries = this.excludeQueries;
|
||||
options.expandQueries = this.expandQueries;
|
||||
var result = PlacesUtils.history.executeQueries(queries, queries.length,
|
||||
options);
|
||||
|
||||
|
@ -515,15 +511,6 @@
|
|||
<!-- nsIPlacesView -->
|
||||
<field name="childDropTypes">ViewConfig.GENERIC_DROP_TYPES</field>
|
||||
|
||||
<!-- nsIPlacesView -->
|
||||
<field name="excludeItems">false</field>
|
||||
|
||||
<!-- nsIPlacesView -->
|
||||
<field name="excludeQueries">false</field>
|
||||
|
||||
<!-- nsIPlacesView -->
|
||||
<field name="expandQueries">false</field>
|
||||
|
||||
<!-- nsIPlacesView -->
|
||||
<method name="selectAll">
|
||||
<body><![CDATA[
|
||||
|
@ -731,15 +718,11 @@
|
|||
Gets the nsINavHistoryResultNode adjacent to the specified InsertionPoint.
|
||||
@param insertionPoint
|
||||
The InsertionPoint where items are being inserted
|
||||
@param excludeItems
|
||||
true if leaf nodes should be excluded for this view, false
|
||||
otherwise.
|
||||
@returns a nsINavHistoryResultNode that is adjacent to the specified
|
||||
InsertionPoint
|
||||
-->
|
||||
<method name="_getInsertionNode">
|
||||
<parameter name="insertionPoint"/>
|
||||
<parameter name="excludeItems"/>
|
||||
<body><![CDATA[
|
||||
// The InsertionPoint defines a place within the view hierarchy where
|
||||
// items may be inserted. This function returns the node adjacent to
|
||||
|
@ -808,13 +791,7 @@
|
|||
<method name="_getInsertionIndex">
|
||||
<parameter name="insertionPoint"/>
|
||||
<body><![CDATA[
|
||||
// Insert index of insertion and number of rows to insert
|
||||
var excludeItems = this.excludeItems;
|
||||
// This is a bit of a hack. Assume any container you drop into is
|
||||
// itself showing all item types, not just folders or items.
|
||||
if (insertionPoint.orientation == NHRVO.DROP_ON)
|
||||
excludeItems = false;
|
||||
var node = this._getInsertionNode(insertionPoint, excludeItems);
|
||||
var node = this._getInsertionNode(insertionPoint);
|
||||
// This is the insertion index of the pivot.
|
||||
if (node)
|
||||
return this.getResultView().treeIndexForNode(node);
|
||||
|
|
|
@ -50,11 +50,6 @@ var SelectBookmarkDialog = {
|
|||
init: function SBD_init() {
|
||||
// Initial update of the OK button.
|
||||
this.selectionChanged();
|
||||
|
||||
var bookmarks = document.getElementById("bookmarks");
|
||||
bookmarks.excludeItems = false;
|
||||
bookmarks.excludeQueries = true;
|
||||
bookmarks.place = bookmarks.place;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -74,7 +69,7 @@ var SelectBookmarkDialog = {
|
|||
linkChosen: function SBD_linkChosen() {
|
||||
var bookmarks = document.getElementById("bookmarks");
|
||||
if (bookmarks.hasSingleSelection &&
|
||||
PlacesController.nodeIsURI(bookmarks.selectedNode))
|
||||
PlacesUtils.nodeIsURI(bookmarks.selectedNode))
|
||||
document.documentElement.getButton("accept").click();
|
||||
},
|
||||
|
||||
|
@ -90,12 +85,12 @@ var SelectBookmarkDialog = {
|
|||
var names = [];
|
||||
var selectedNode = bookmarks.selectedNode;
|
||||
if (bookmarks.hasSingleSelection &&
|
||||
PlacesController.nodeIsFolder(selectedNode)) {
|
||||
var contents = PlacesController.getFolderContents(asFolder(selectedNode).folderId);
|
||||
PlacesUtils.nodeIsFolder(selectedNode)) {
|
||||
var contents = PlacesUtils.getFolderContents(asFolder(selectedNode).folderId);
|
||||
var cc = contents.childCount;
|
||||
for (var i = 0; i < cc; ++i) {
|
||||
var node = contents.getChild(i);
|
||||
if (PlacesController.nodeIsURI(node)) {
|
||||
if (PlacesUtils.nodeIsURI(node)) {
|
||||
urls.push(node.uri);
|
||||
names.push(node.title);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,11 @@
|
|||
onload="SelectBookmarkDialog.init();"
|
||||
ondialogaccept="SelectBookmarkDialog.accept();">
|
||||
|
||||
|
||||
<script type="application/x-javascript"
|
||||
src="chrome://global/content/places/globalOverlay.js"/>
|
||||
<script type="application/x-javascript"
|
||||
src="chrome://browser/content/places/utils.js"/>
|
||||
<script type="application/x-javascript"
|
||||
src="chrome://browser/content/places/controller.js"/>
|
||||
<script type="application/x-javascript"
|
||||
|
@ -25,8 +30,9 @@
|
|||
|
||||
<tree id="bookmarks" flex="1" type="places"
|
||||
style="height: 15em;"
|
||||
place="place:&folder=1&group=3"
|
||||
hidecolumnpicker="true" seltype="single"
|
||||
place="place:&folder=1&group=3&excludeQueries=1"
|
||||
hidecolumnpicker="true"
|
||||
seltype="single"
|
||||
ondblclick="SelectBookmarkDialog.linkChosen();"
|
||||
onselect="SelectBookmarkDialog.selectionChanged();">
|
||||
<treecols>
|
||||
|
|
Загрузка…
Ссылка в новой задаче