Fixed a typo for Bug 576408 - Implement the downgraded tab triage experience
authorRaymond Lee <raymond@raysquare.com>
Sat, 07 Aug 2010 03:52:14 +0800
changeset 50256 5ff313be6adbe682cd0d5c18b95c88d0df68e8f1
parent 50255 1bab6d09fbc9021a54784388e1d82994ee8bcca3
child 50257 403b159f0b7bb7b8bb172d5365c88903d713f16a
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs576408
milestone2.0b4pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Fixed a typo for Bug 576408 - Implement the downgraded tab triage experience
browser/base/content/browser-tabview.js
browser/base/content/browser.xul
browser/locales/en-US/chrome/browser/browser.dtd
browser/locales/en-US/chrome/browser/browser.properties
--- a/browser/base/content/browser-tabview.js
+++ b/browser/base/content/browser-tabview.js
@@ -53,61 +53,49 @@ let TabView = {
 
   getWindowTitle: function() {
     let brandBundle = document.getElementById("bundle_brand");
     let brandShortName = brandBundle.getString("brandShortName");
     return gNavigatorBundle.getFormattedString("tabView.title", [brandShortName]);
   },
 
   updateContextMenu: function(tab, popup) {
-    while(popup.lastChild && popup.lastChild.id != "context_namedGroup") {
+    while(popup.lastChild && popup.lastChild.id != "context_namedGroups")
       popup.removeChild(popup.lastChild);
-    }
 
     let tabViewWindow = document.getElementById("tab-view").contentWindow;
-    let showEmpty = true;
+    let isEmpty = true;
 
     if (tabViewWindow) {
       let activeGroup = tab.tabItem.parent;
       let groups = tabViewWindow.Groups.groups;
       let self = this;
 
       groups.forEach(function(group) { 
         if (group.getTitle().length > 0 && 
             (!activeGroup || activeGroup.id != group.id)) {
           let menuItem = self._createGroupMenuItem(group);
           popup.appendChild(menuItem);
-          showEmpty = false;
+          isEmpty = false;
         }
       });
     }
-    if (showEmpty) {
-      let menuItem = this._createGroupMenuItem(null);
-      popup.appendChild(menuItem);
-    }
+    document.getElementById("context_namedGroups").hidden = isEmpty;
   },
 
   _createGroupMenuItem : function(group) {
     let menuItem = document.createElement("menuitem")
     menuItem.setAttribute("class", "group");
-
-    if (group) {
-      menuItem.setAttribute("label", group.getTitle());
-      menuItem.setAttribute(
-        "oncommand", 
-        "TabView.moveTabTo(TabContextMenu.contextTab,'" + group.id + "')");
-    } else {
-      menuItem.setAttribute(
-        "label", gNavigatorBundle.getString("tabView.noNamedGroup"));
-      menuItem.setAttribute("disabled", "true");
-    }
+    menuItem.setAttribute("label", group.getTitle());
+    menuItem.setAttribute(
+      "oncommand", 
+      "TabView.moveTabTo(TabContextMenu.contextTab,'" + group.id + "')");
 
     return menuItem;
   },
 
   moveTabTo: function(tab, groupId) {
     let tabViewWindow = document.getElementById("tab-view").contentWindow;
 
-    if (tabViewWindow) {
+    if (tabViewWindow)
       tabViewWindow.Groups.moveTabToGroup(tab, groupId);
-    }
   }
 };
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -115,17 +115,17 @@
                onpopuphidden="if (event.target == this) TabContextMenu.contextTab = null;">
       <menu id="context_tabViewMenu" class="menu-iconic" label="&moveTabTo.label;..." 
             accesskey="&moveTabTo.accesskey;">
         <menupopup id="context_tabViewMenuPopup" 
                    onpopupshowing="if (event.target == this) TabView.updateContextMenu(TabContextMenu.contextTab, this);">
           <menuitem label="&createNewGroup.label;" 
                     accesskey="&createNewGroup.accesskey;" 
                     oncommand="TabView.moveTabTo(TabContextMenu.contextTab, null);" />
-          <menuitem id="context_namedGroup" label="&namedGroup.label;" 
+          <menuitem id="context_namedGroups" label="&namedGroups.label;" 
                     disabled="true" />
         </menupopup>
       </menu>
       <menuseparator/>
       <menuitem id="context_reloadTab" label="&reloadTab.label;" accesskey="&reloadTab.accesskey;"
                 oncommand="gBrowser.reloadTab(TabContextMenu.contextTab);"/>
       <menuitem id="context_reloadAllTabs" label="&reloadAllTabs.label;" accesskey="&reloadAllTabs.accesskey;"
                 tbattr="tabbrowser-multiple"
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -11,17 +11,17 @@
                                                                 inside the private browsing mode -->
 <!ENTITY mainWindow.titlePrivateBrowsingSuffix "(Private Browsing)">
 
 <!-- Tab context menu -->
 <!ENTITY  moveTabTo.label                    "Move This Tab To">
 <!ENTITY  moveTabTo.accesskey                "M">
 <!ENTITY  createNewGroup.label               "Create New Group">
 <!ENTITY  createNewGroup.accesskey           "C">
-<!ENTITY  namedGroup.label                   "Named Group">
+<!ENTITY  namedGroups.label                  "Named Groups">
 <!ENTITY  reloadTab.label                    "Reload Tab">
 <!ENTITY  reloadTab.accesskey                "R">
 <!ENTITY  reloadAllTabs.label                "Reload All Tabs">
 <!ENTITY  reloadAllTabs.accesskey            "A">
 <!ENTITY  closeOtherTabs.label               "Close Other Tabs">
 <!ENTITY  closeOtherTabs.accesskey           "o">
 <!ENTITY  openTabInNewWindow.label           "Open in a New Window">
 <!ENTITY  openTabInNewWindow.accesskey       "W">
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -272,12 +272,11 @@ privateBrowsingNeverAsk=&Do not show thi
 ctrlTab.showAll.label=;Show all #1 tabs
 
 # LOCALIZATION NOTE (addKeywordTitleAutoFill): %S will be replaced by the page's title
 # Used as the bookmark name when saving a keyword for a search field.
 addKeywordTitleAutoFill=Search %S
 
 # TabView
 tabView.title=%S Tab Sets
-tabView.noNamedGroup=(Empty)
 
 extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name=Default
 extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description=The default theme.