Bug 459438 - Support bulk tagging for multiple history items (r=dietrich)

This commit is contained in:
highmind63@gmail.com 2008-11-01 19:57:07 -07:00
parent 2563c4acf5
commit b0258596ee
2 changed files with 11 additions and 4 deletions

View File

@ -195,8 +195,13 @@ var gEditItemOverlay = {
this._allTags = [];
this._itemIds = aItemIdList;
var nodeToCheck = 0;
for (var i = 0; i < this._itemIds.length; i++) {
this._uris[i] = PlacesUtils.bookmarks.getBookmarkURI(this._itemIds[i], {});
for (var i = 0; i < aItemIdList.length; i++) {
if (aItemIdList[i] instanceof Ci.nsIURI) {
this._uris[i] = aItemIdList[i];
this._itemIds[i] = -1;
}
else
this._uris[i] = PlacesUtils.bookmarks.getBookmarkURI(this._itemIds[i], {});
this._tags[i] = PlacesUtils.tagging.getTagsForURI(this._uris[i], {});
if (this._tags[i].length < this._tags[nodeToCheck].length)
nodeToCheck = i;

View File

@ -683,7 +683,8 @@ var PlacesOrganizer = {
else if (!aSelectedNode && aNodeList[0]) {
var itemIds = [];
for (var i = 0; i < aNodeList.length; i++) {
if (!PlacesUtils.nodeIsBookmark(aNodeList[i])) {
if (!PlacesUtils.nodeIsBookmark(aNodeList[i]) &&
!PlacesUtils.nodeIsURI(aNodeList[i])) {
detailsDeck.selectedIndex = 0;
var selectItemDesc = document.getElementById("selectItemDescription");
var itemsCountLabel = document.getElementById("itemsCountText");
@ -693,7 +694,8 @@ var PlacesOrganizer = {
[aNodeList.length]);
return;
}
itemIds[i] = PlacesUtils.getConcreteItemId(aNodeList[i]);
itemIds[i] = aNodeList[i].itemId != -1 ? aNodeList[i].itemId :
PlacesUtils._uri(aNodeList[i].uri);
}
detailsDeck.selectedIndex = 1;
gEditItemOverlay.initPanel(itemIds,