Bug 586149 - Some strings in the XBL Bindings viewer are hard to read, r=neil SEAMONKEY_2_1a3_BUILD1 SEAMONKEY_2_1a3_BUILD2 SEAMONKEY_2_1a3_RELEASE
authorColby Russell <sevenspade@gmail.com>
Fri, 13 Aug 2010 20:33:29 -0500
changeset 962 eef568e4ee05b819869103117f2c3798d7bed9a5
parent 961 d940b5d29da3be929d1a8628543cd241d5ab3988
child 963 2efab61f45d63c96179e3baebdeb49f8f743bf65
child 965 b9ee3bc74ad7dabe49615c8e36641b2e3c0d09cc
push id216
push usersevenspade@gmail.com
push dateSat, 14 Aug 2010 01:35:48 +0000
reviewersneil
bugs586149
Bug 586149 - Some strings in the XBL Bindings viewer are hard to read, r=neil
resources/content/viewers/xblBindings/xblBindings.js
resources/content/viewers/xblBindings/xblBindings.xul
--- a/resources/content/viewers/xblBindings/xblBindings.js
+++ b/resources/content/viewers/xblBindings/xblBindings.js
@@ -70,16 +70,18 @@ function XBLBindingsViewer_initialize()
 //// Class XBLBindingsViewer
 
 function XBLBindingsViewer()
 {
   this.mURL = window.location;
   this.mObsMan = new ObserverManager(this);
   this.mDOMUtils = XPCU.getService(kDOMUtilsContractID, "inIDOMUtils");
 
+  this.mBindingsList = document.getElementById("mlBindings");
+
   this.mContentTree = document.getElementById("olContent");
   this.mMethodTree = document.getElementById("olMethods");
   this.mPropTree = document.getElementById("olProps");
   this.mHandlerTree = document.getElementById("olHandlers");
   this.mResourceTree = document.getElementById("olResources");
 
   // prepare and attach the content DOM datasource
   this.mContentView = XPCU.createInstance(kDOMViewContractID, "inIDOMView");
@@ -114,18 +116,17 @@ XBLBindingsViewer.prototype =
   },
 
   set subject(aObject)
   {
     this.mSubject = aObject;
 
     this.populateBindings();
 
-    var menulist = document.getElementById("mlBindings");
-    this.displayBinding(menulist.value);
+    this.displayBinding(this.mBindingsList.value);
 
     this.mObsMan.dispatchEvent("subjectChange", { subject: aObject });
   },
 
   initialize: function XBLBVr_Initialize(aPane)
   {
     this.mPane = aPane;
 
@@ -165,33 +166,32 @@ XBLBindingsViewer.prototype =
   },
 
   ////////////////////////////////////////////////////////////////////////////
   //// Displaying Binding Info
 
   populateBindings: function XBLBVr_PopulateBindings()
   {
     var urls = this.mDOMUtils.getBindingURLs(this.mSubject);
-    var menulist = document.getElementById("mlBindings");
 
-    menulist.removeAllItems();
+    this.mBindingsList.removeAllItems();
 
-    var urlCount = urls.length;
-    var i;
-
-    for (i = 0; i < urlCount; ++i) {
+    for (let i = 0, n = urls.length; i < n; ++i) {
       var url = urls.queryElementAt(i, Components.interfaces.nsIURI).spec;
-      menulist.appendItem(url, url);
+      var currentItem = this.mBindingsList.appendItem(url, url);
+      currentItem.crop = "center";
+      currentItem.tooltipText = url;
     }
 
-    menulist.selectedIndex = 0;
+    this.mBindingsList.selectedIndex = 0;
   },
 
   displayBinding: function XBLBVr_DisplayBinding(aURL)
   {
+    this.mBindingsList.tooltipText = aURL;
     this.mBindingURL = aURL;
     if (aURL) {
       var req = new XMLHttpRequest();
       req.addEventListener("load", gDocLoadListener, true);
       req.open("GET", aURL);
       req.overrideMimeType("application/xml");
       req.send(null);
     }
@@ -233,17 +233,17 @@ XBLBindingsViewer.prototype =
       for (let i = 0; i < tabbox.tabs.childNodes.length; ++i) {
          if (!tabbox.tabs.childNodes[i].disabled) {
            tabbox.selectedTab = tabbox.tabs.childNodes[i];
            break;
          }
       }
     }
 
-    document.getElementById("mlBindings").disabled = !this.mBinding;
+    this.mBindingsList.disabled = !this.mBinding;
   },
 
   displayContent: function XBLBVr_DisplayContent()
   {
     this.mContentView.rootNode = this.mBinding &&
       this.mBinding.getElementsByTagNameNS(kXBLNSURI, "content").item(0);
     this.mContentTree.disabled = !this.mContentView.rootNode;
     document.getElementById("tbContent").disabled =
@@ -339,17 +339,17 @@ XBLBindingsViewer.prototype =
     }
 
     // display text
     var et = rgroup.value;
     var text = "";
     if (et && aProp) {
       text = aProp.getAttribute("on" + et);
       if (!text) {
-        kids = aProp.getElementsByTagNameNS(kXBLNSURI, et + "ter");
+        let kids = aProp.getElementsByTagNameNS(kXBLNSURI, et + "ter");
         text = this.readDOMText(kids.item(0));
       }
     }
     document.getElementById("txbPropCode").value = this.justifySource(text);
   },
 
   displayHandler: function XBLBVr_DisplayHandler(aHandler)
   {
--- a/resources/content/viewers/xblBindings/xblBindings.xul
+++ b/resources/content/viewers/xblBindings/xblBindings.xul
@@ -17,17 +17,22 @@
           src="chrome://inspector/content/utils.js"/>
   <script type="application/javascript"
           src="chrome://inspector/content/hooks.js"/>
   <script type="application/javascript"
           src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
   <script type="application/javascript"
           src="chrome://inspector/content/jsutil/events/ObserverManager.js"/>
 
-  <menulist id="mlBindings" oncommand="viewer.displayBinding(this.value)">
+  <popupset>
+    <tooltip id="ttBindings"/>
+  </popupset>
+
+  <menulist id="mlBindings" oncommand="viewer.displayBinding(this.value)"
+            crop="center" tooltip="ttBindings">
     <menupopup id="mpBindings"/>
   </menulist>
 
   <tabbox id="bxBindingAspects" flex="1">
     <tabs>
       <tab id="tbContent" label="&bindingContent.label;"
            disabled="true"/>
       <tab id="tbMethods" label="&bindingMethods.label;"