diff --git a/mozilla/browser/components/places/content/toolbar.xml b/mozilla/browser/components/places/content/toolbar.xml index ed9f501c4b3..017788347ec 100755 --- a/mozilla/browser/components/places/content/toolbar.xml +++ b/mozilla/browser/components/places/content/toolbar.xml @@ -101,7 +101,6 @@ ]]> @@ -203,74 +202,15 @@ if (this._DNDObserver._overFolder.node) this._DNDObserver._clearOverFolder(); this._openedMenuButton = null; - this._currentURIs = {}; - + while (this.hasChildNodes()) this.removeChild(this.firstChild); const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; this._result.root.containerOpen = true; var cc = this._result.root.childCount; - for (var i = 0; i < cc; ++i) { - var child = this._result.root.getChild(i); - var title = child.title; - var button = null; - if (PlacesUtils.nodeIsURI(child)) { - button = document.createElementNS(XULNS, "toolbarbutton"); - button.setAttribute("url", child.uri); + for (var i = 0; i < cc; ++i) + this.insertNewItem(this._result.root.getChild(i), null); - // Add the URI to the list of URIs currently in the view. - this._currentURIs[child.uri] = true; - - if (PlacesUtils.nodeIsBookmark(child)) { - // If the item has a generated title, use that instead. - var placeURI = PlacesUtils.bookmarks.getItemURI(child.bookmarkId); - if (this._generatedTitles[placeURI.spec]) - title = this._generatedTitles[placeURI.spec]; - } - } else if (PlacesUtils.nodeIsSeparator(child)) { - button = document.createElementNS(XULNS, "toolbarseparator"); - } else if (PlacesUtils.nodeIsContainer(child)) { - button = document.createElementNS(XULNS, "toolbarbutton"); - button.setAttribute("type", "menu"); - button.setAttribute("container", "true"); - if (PlacesUtils.nodeIsLivemarkContainer(child)) { - button.setAttribute("livemark", "true"); - var folder = asFolder(child).folderId; - - // duplicate nsLivemarkService.getSiteURI to avoid instantiating - // the service on startup. - var containerURI = PlacesUtils.bookmarks.getFolderURI(folder); - var siteURIString; - try { - siteURIString = - this._anno.getAnnotationString(containerURI, "livemark/siteURI"); - } - catch (ex) {} - // end duplication - - if (siteURIString) - button.setAttribute("siteURI", siteURIString); - } - var popup = document.createElementNS(XULNS, "menupopup"); - popup.setAttribute("type", "places"); - // This is set here and not in the XBL constructor for the menu because - // it doesn't get initialized properly in the constructor. -#ifndef XP_MACOSX - // No context menus on menuitems on Mac - popup.setAttribute("context", "placesContext"); -#endif - button.appendChild(popup); - popup._result = this._result; - popup._resultNode = child; - } - button.setAttribute("label", title); - if (child.icon) - button.setAttribute("image", child.icon.spec); - button.className = "menuitem-iconic bookmark-item"; - button.node = child; - this.appendChild(button); - } - var popup = this._chevron.firstChild; popup.setAttribute("type", "places"); // This is set here and not in the XBL constructor for the menu because @@ -289,8 +229,88 @@ var self = this; setTimeout(function() { self.updateChevron(); }, 0); ]]> - + + + + + + + + + + + + + - + - - + +