Bug 588807 - Add Unsorted Bookmarks to Bookmarks menu and rename Personal Toolbar to Bookmarks Toolbar. r=Neil
authorJens Hatlak <jh@junetz.de>
Sat, 14 Jan 2012 15:57:59 +0100
changeset 10419 d29573dcbadb6a1e01aa88e648339d71d93b30bd
parent 10418 81c392144bebfb017c254a3fad992de049dbd081
child 10420 f1d6a28d03963a71fe9ea8302c8914937bc32834
push id402
push userbugzilla@standard8.plus.com
push dateTue, 13 Mar 2012 21:17:18 +0000
treeherdercomm-beta@d080a8ebf16a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil
bugs588807
Bug 588807 - Add Unsorted Bookmarks to Bookmarks menu and rename Personal Toolbar to Bookmarks Toolbar. r=Neil
suite/browser/navigator.xul
suite/browser/navigatorOverlay.xul
suite/common/bookmarks/browser-places.js
suite/locales/en-US/chrome/browser/navigator.dtd
--- a/suite/browser/navigator.xul
+++ b/suite/browser/navigator.xul
@@ -205,21 +205,21 @@
                        tooltiptext="&closeWindow.label;"
                        oncommand="BrowserTryToCloseWindow();"/>
       </hbox>
     </toolbar>
 
     <toolbarset id="customToolbars" context="toolbar-context-menu"/>
 
     <toolbar id="PersonalToolbar"
-             accesskey="&personalbarCmd.accesskey;"
+             accesskey="&bookmarksToolbarCmd.accesskey;"
              class="chromeclass-directories"
              persist="collapsed"
-             grippytooltiptext="&personalToolbar.tooltip;"
-             toolbarname="&personalbarCmd.label;"
+             grippytooltiptext="&bookmarksToolbar.tooltip;"
+             toolbarname="&bookmarksToolbarCmd.label;"
              nowindowdrag="true"
              customizable="true"
              defaultset="home-button,separator,bookmarks-button,personal-bookmarks"
              mode="full"
              iconsize="small"
              labelalign="end"
              defaultmode="full"
              defaulticonsize="small"
@@ -378,48 +378,48 @@
 
       <toolbaritem id="throbber-box" align="center">
         <button id="navigator-throbber"
                 oncommand="goClickThrobber('browser.throbber.url', event)"
                 onclick="checkForMiddleClick(this, event);"
                 tooltiptext="&throbber.tooltip;"/>
       </toolbaritem>
 
-      <!-- "Bookmarks" button on personal toolbar -->
+      <!-- "Bookmarks" button on Bookmarks Toolbar -->
       <toolbarbutton type="menu" id="bookmarks-button"
                      class="bookmark-item" container="true"
                      label="&bookmarksButton.label;"
                      ondragenter="PlacesMenuDNDHandler.onDragEnter(event);"
                      ondragover="PlacesMenuDNDHandler.onDragOver(event);"
                      ondragexit="PlacesMenuDNDHandler.onDragExit(event);"
                      ondrop="PlacesMenuDNDHandler.onDrop(event);">
         <menupopup id="BMB_bookmarksPopup"
                    placespopup="true"
                    context="placesContext"
                    openInTabs="children"
                    oncommand="BookmarksEventHandler.onCommand(event);"
                    onclick="BookmarksEventHandler.onClick(event);"
-                   onpopupshowing="BookmarksMenuButton.onPopupShowing(event);
+                   onpopupshowing="BookmarksMenu.onPopupShowing(event, 'BMB_');
                                    BookmarksEventHandler.onPopupShowing(event);"
                    tooltip="bhTooltip" popupsinherittooltip="true">
           <menuitem command="Browser:AddBookmark"/>
           <menuitem command="Browser:AddBookmarkAs"/>
           <menuitem command="Browser:BookmarkAllTabs"/>
           <menuitem command="Browser:ManageBookmark"/>
           <menuseparator/>
           <menu id="BMB_feedsMenu" class="menu-iconic feedsMenu" command="feedsMenu"
                 label="&feedsMenu.label;" accesskey="&feedsMenu.accesskey;">
             <menupopup onpopupshowing="window.XULBrowserWindow.populateFeeds(this);"
                        oncommand="subscribeToFeed(event.target.statusText, event);"
                        onclick="checkForMiddleClick(this, event);"/>
           </menu>
           <menuseparator/>
           <menu id="BMB_bookmarksToolbarFolderMenu"
                 class="menu-iconic bookmark-item"
-                label="&personalbarCmd.label;"
+                label="&bookmarksToolbarCmd.label;"
                 container="true">
             <menupopup id="BMB_bookmarksToolbarFolderPopup"
                        placespopup="true"
                        context="placesContext"
                        onpopupshowing="if (!this.parentNode._placesView)
                                          new PlacesMenu(event, 'place:folder=TOOLBAR');"/>
           </menu>
           <menu id="BMB_unsortedBookmarksFolderMenu"
--- a/suite/browser/navigatorOverlay.xul
+++ b/suite/browser/navigatorOverlay.xul
@@ -257,23 +257,16 @@
     <broadcaster id="cmd_viewtaskbar"
                  checked="true"
                  oncommand="goToggleToolbar('status-bar', 'cmd_viewtaskbar');
                             updateWindowState();"/>
     <broadcaster id="cmd_viewcomponentbar" oncommand="goToggleToolbar('component-bar', 'cmd_viewcomponentbar');" checked="true"/>
     <broadcaster id="isImage"/>
   </broadcasterset>
          
-  <!-- bookmarks context menu -->
-  <popupset id="bookmarksPopupset">
-    <menupopup id="bookmarks-context-menu" 
-           onpopupshowing="return BookmarksMenu.createContextMenu(event);"
-           onpopuphidden ="BookmarksMenu.destroyContextMenu(event);"/>
-  </popupset>
-
   <!-- Menu -->
   <menubar id="main-menubar" class="chromeclass-menubar">
     <menu id="menu_File">
       <menupopup id="menu_FilePopup" onpopupshowing="updateCloseItems();getContentAreaFrameCount();updateSavePageItems();updateFileUploadItem();">
         <menu id="menu_New">
           <menupopup id="menu_NewPopup">
             <!-- From utilityOverlay.xul -->
             <menuitem id="menu_newNavigator" command="cmd_newNavigator"/>
@@ -472,17 +465,18 @@
           ondragover="PlacesMenuDNDHandler.onDragOver(event);"
           ondrop="PlacesMenuDNDHandler.onDrop(event);">
       <menupopup id="bookmarksMenuPopup"
                  placespopup="true"
                  context="placesContext"
                  openInTabs="children"
                  oncommand="BookmarksEventHandler.onCommand(event);"
                  onclick="BookmarksEventHandler.onClick(event);"
-                 onpopupshowing="BookmarksEventHandler.onPopupShowing(event);"
+                 onpopupshowing="BookmarksMenu.onPopupShowing(event, '');
+                                 BookmarksEventHandler.onPopupShowing(event);"
                  tooltip="bhTooltip" popupsinherittooltip="true">
         <menuitem id="menu_bookmarkThisPage"
                   command="Browser:AddBookmark"
                   key="addBookmarkKb"/>
         <menuitem id="menu_bookmarkThisPageAs"
                   command="Browser:AddBookmarkAs"
                   key="addBookmarkAsKb"/>
         <menuitem id="menu_bookmarkAllTabs"
@@ -495,24 +489,33 @@
               label="&feedsMenu.label;" accesskey="&feedsMenu.accesskey;">
           <menupopup onpopupshowing="window.XULBrowserWindow.populateFeeds(this);"
                      oncommand="subscribeToFeed(event.target.statusText, event);"
                      onclick="checkForMiddleClick(this, event);"/>
         </menu>
         <menuseparator/>
         <menu id="bookmarksToolbarFolderMenu"
               class="menu-iconic bookmark-item"
-              label="&personalbarCmd.label;"
+              label="&bookmarksToolbarCmd.label;"
               container="true">
           <menupopup id="bookmarksToolbarFolderPopup"
                      placespopup="true"
                      context="placesContext"
                      onpopupshowing="if (!this.parentNode._placesView)
                                        new PlacesMenu(event, 'place:folder=TOOLBAR');"/>
         </menu>
+        <menu id="unsortedBookmarksFolderMenu"
+              class="menu-iconic bookmark-item"
+              container="true">
+          <menupopup id="unsortedBookmarksFolderPopup"
+                     placespopup="true"
+                     context="placesContext"
+                     onpopupshowing="if (!this.parentNode._placesView)
+                                       new PlacesMenu(event, 'place:folder=UNFILED_BOOKMARKS');"/>
+        </menu>
         <menuseparator/>
       </menupopup>
     </menu>
 
     <menu id="tasksMenu">
       <menupopup id="taskPopup">
         <menuitem id="menu_searchWeb"
                   label="&searchInternetCmd.label;"
--- a/suite/common/bookmarks/browser-places.js
+++ b/suite/common/bookmarks/browser-places.js
@@ -885,24 +885,24 @@ let PlacesToolbarHelper = {
   },
 
   customizeDone: function PTH_customizeDone() {
     this.init();
   }
 };
 
 
-// Handles the bookmarks menu button shown when the main menubar is hidden.
-let BookmarksMenuButton = {
-  _popupInitialized: false,
-  onPopupShowing: function BMB_onPopupShowing(event) {
-    if (!this._popupInitialized) {
+// Handles the bookmarks menu popup
+let BookmarksMenu = {
+  _popupInitialized: {},
+  onPopupShowing: function BM_onPopupShowing(aEvent, aPrefix) {
+    if (!(aPrefix in this._popupInitialized)) {
       // First popupshowing event, initialize immutable attributes.
-      this._popupInitialized = true;
+      this._popupInitialized[aPrefix] = true;
 
       // Need to set the label on Unsorted Bookmarks menu.
       let unsortedBookmarksElt =
-        document.getElementById("BMB_unsortedBookmarksFolderMenu");
+        document.getElementById(aPrefix + "unsortedBookmarksFolderMenu");
       unsortedBookmarksElt.label =
         PlacesUtils.getString("UnsortedBookmarksFolderTitle");
     }
   },
 };
--- a/suite/locales/en-US/chrome/browser/navigator.dtd
+++ b/suite/locales/en-US/chrome/browser/navigator.dtd
@@ -11,30 +11,30 @@
 <!ENTITY mainWindow.titlemodifiermenuseparator " - ">
 
 <!ENTITY editPageCmd.label "Edit Page">
 <!ENTITY editPageCmd.accesskey "E">
 <!ENTITY editPageCmd.commandkey "e">
 
 <!ENTITY navbarCmd.label "Navigation Toolbar">
 <!ENTITY navbarCmd.accesskey "N">
-<!ENTITY personalbarCmd.label "Personal Toolbar">
-<!ENTITY personalbarCmd.accesskey "P">
+<!ENTITY bookmarksToolbarCmd.label     "Bookmarks Toolbar">
+<!ENTITY bookmarksToolbarCmd.accesskey "m">
 
 <!ENTITY closeWindow.label "Close Window">
 <!ENTITY closeWindow.accesskey "W">
 
 <!ENTITY minimizeButton.tooltip       "Minimize">
 <!ENTITY restoreButton.tooltip        "Restore">
 
 <!ENTITY feedsMenu.label "Subscribe to This Page">
 <!ENTITY feedsMenu.accesskey "S">
 
 <!ENTITY menuBar.tooltip                  "Menu Bar">
-<!ENTITY personalToolbar.tooltip          "Personal Toolbar">
+<!ENTITY bookmarksToolbar.tooltip         "Bookmarks Toolbar">
 <!ENTITY navigationToolbar.tooltip        "Navigation Toolbar">
 
 <!-- Toolbar items --> 
 <!ENTITY backButton.label             "Back">
 <!ENTITY backButton.tooltip           "Go back one page">
 <!ENTITY forwardButton.label          "Forward">
 <!ENTITY forwardButton.tooltip        "Go forward one page">
 <!ENTITY reloadButton.label           "Reload">