Bug 393546 Star-icon needs a tooltip with a description of what it's doing when clicking on it (r=sspitzer)
authordietrich@mozilla.com
Fri, 21 Sep 2007 11:18:34 -0700
changeset 6207 17982c0ea4c3faf96ee405921ad991a813a0fb3f
parent 6206 334f517924a09fe49b9fbc207f7f9631db971442
child 6208 3756170d9f4e9dcbdb12a1dea1e2e8ad75b984e9
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssspitzer
bugs393546
milestone1.9a8pre
Bug 393546 Star-icon needs a tooltip with a description of what it's doing when clicking on it (r=sspitzer)
browser/base/content/browser-places.js
browser/base/content/browser.xul
browser/locales/en-US/chrome/browser/browser.properties
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -764,23 +764,28 @@ var PlacesStarButton = {
   _starred: false,
   _batching: false,
 
   updateState: function PSB_updateState() {
     var starIcon = document.getElementById("star-button");
     if (!starIcon)
       return;
 
+    var browserBundle = document.getElementById("bundle_browser");
     var uri = getBrowser().currentURI;
     this._starred = uri && (PlacesUtils.getMostRecentBookmarkForURI(uri) != -1 ||
                             PlacesUtils.getMostRecentFolderForFeedURI(uri) != -1);
-    if (this._starred)
+    if (this._starred) {
       starIcon.setAttribute("starred", "true");
-    else
+      starIcon.setAttribute("tooltiptext", browserBundle.getString("starButtonOn.tooltip"));
+    }
+    else {
       starIcon.removeAttribute("starred");
+      starIcon.setAttribute("tooltiptext", browserBundle.getString("starButtonOff.tooltip"));
+    }
   },
 
   onClick: function PSB_onClick(aEvent) {
     PlacesCommandHook.bookmarkCurrentPage(this._starred);
   },
 
   // nsINavBookmarkObserver  
   onBeginUpdateBatch: function PSB_onBeginUpdateBatch() {
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -262,17 +262,18 @@
                      level="safe"
                      onclick="goDoCommand('safebrowsing-show-warning')"/>
 #endif
             </hbox>
           </textbox>
           <stack id="go-button-stack" class="endcap">
             <box class="endcap-box" chromedir="&locale.dir;"/>
             <hbox>
-              <toolbarbutton id="star-button" onclick="if (event.button == 0) PlacesStarButton.onClick(event);"/>
+              <toolbarbutton id="star-button"
+                             onclick="if (event.button == 0) PlacesStarButton.onClick(event);"/>
               <toolbarbutton id="go-button" chromedir="&locale.dir;"
                              label="&goEndCap.label;"
                              onclick="handleURLBarCommand(event);"
                              ondragover="nsDragAndDrop.dragOver(event, goButtonObserver);"
                              ondragdrop="nsDragAndDrop.drop(event, goButtonObserver);"
                              ondragexit="nsDragAndDrop.dragExit(event, goButtonObserver);"
                              tooltiptext="&goEndCap.tooltip;"/>
             </hbox>
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -92,8 +92,12 @@ refreshBlocked.goButton.accesskey=A
 refreshBlocked.refreshLabel=%S prevented this page from automatically reloading.
 refreshBlocked.redirectLabel=%S prevented this page from automatically redirecting to another page.
 
 # Chromeless popup handling
 chromelessWindow.warningMessage=The web site at %S has hidden your toolbars.
 chromelessWindow.warningNoLocation=This web site has hidden your toolbars.
 chromelessWindow.showToolbarsButton=Show Toolbars
 chromelessWindow.accessKey=S
+
+# Star button
+starButtonOn.tooltip=Edit this bookmark
+starButtonOff.tooltip=Bookmark this page