All pastes #896728 Raw Edit

Stuff

public text v1 · immutable
·published 2008-02-08 22:22 UTC
rendered paste body
Index: app/content/scripts/searchHandler.js
===================================================================
--- app/content/scripts/searchHandler.js	(revision 8149)
+++ app/content/scripts/searchHandler.js	(working copy)
@@ -72,9 +72,12 @@
                               false);
     
     // Listen for tab change events
-    gBrowser.addEventListener('TabContentChanged', 
+    gBrowser.addEventListener('TabContentChange', 
                               function (event) { gSearchHandler.onTabChanged(event); },
                               false);
+    gBrowser.addEventListener('TabPropertyChange', 
+                              function (event) { gSearchHandler.onTabChanged(event); },
+                              false);
     
     // Listen for search events
     document.addEventListener("search", 
Index: app/content/xul/mediapages/playlistPage.xul
===================================================================
--- app/content/xul/mediapages/playlistPage.xul	(revision 8149)
+++ app/content/xul/mediapages/playlistPage.xul	(working copy)
@@ -129,7 +129,6 @@
    * Note that to simplify page creation mediaListView may only be set once.
    */
   set mediaListView(value)  {
-    dump("MATT: mediaPage.set mediaListView!\n");
     
     if (!this._mediaListView) {
       this._mediaListView = value;
@@ -145,7 +144,6 @@
    * been externally set.  
    */
   onLoad:  function(e) {
-    dump("MATT: mediaPage.onLoad()!\n");
 
     // Make sure we have the javascript modules we're going to use
     if (!window.SBProperties) 
@@ -182,7 +180,6 @@
    * Called as the window is about to unload
    */
   onUnload:  function(e) {
-    dump("MATT: mediaPage.onUnload()!\n");
     if (this._playlist) {
       this._playlist.destroy();
       this._playlist = null;
Index: app/content/bindings/sbTabBrowser.xml
===================================================================
--- app/content/bindings/sbTabBrowser.xml	(revision 8149)
+++ app/content/bindings/sbTabBrowser.xml	(working copy)
@@ -204,7 +204,6 @@
         this._servicePaneService.addListener(this);
       ]]></constructor>
       <destructor><![CDATA[
-        dump("MATT: tab browser destructor\n");
 
         // remove service pane listener        
         this._servicePaneService.removeListener(this);
@@ -245,7 +244,6 @@
       </method>
       <method name="saveTabState">
         <body><![CDATA[
-          dump('MATT: tabBrowser.saveTabState\n');
 
           var tab = this.mTabContainer.firstChild;
           var urls = [];
@@ -272,8 +270,6 @@
             tab = tab.nextSibling;
           }
           
-          // TODO remove
-          dump("MATT: tabBrowser.saveTabState = " + urls.toSource() + "\n");
           this._tabState = urls;
         ]]></body>
       </method>
@@ -316,7 +312,7 @@
       </method>
       
       
-      <!-- Override tabBrowser.setTabeTitle in order to support
+      <!-- Override tabBrowser.setTabTitle in order to support
            service pane icons and titles for chrome URLs -->
       <method name="setTabTitle">
         <parameter name="aTab"/>
@@ -539,8 +535,6 @@
         <parameter name="aPageURL"/>
         <body>
           <![CDATA[
-            dump("MATT: tabBrowser.loadMediaListGUID " + aLibraryGUID
-                    + " -  " + aListGUID + "\n");
             var libraryManager = 
               Components.classes["@songbirdnest.com/Songbird/library/Manager;1"]
                         .getService(Components.interfaces.sbILibraryManager);
@@ -586,8 +580,6 @@
             
             // Not already visible.  Load and highlight.
             } else {
-              this.loadMediaList(gPPS.playingView.mediaList, null, null, 
-                                    gPPS.playingView);
               var tab = this.loadMediaList(aMediaListView.mediaList, null, 
                                            null, aMediaListView);
               tab._highlightViewIndexOnLoad = aHighlightIndex;
@@ -708,11 +700,8 @@
             SBDataSetBoolValue('browser.cansubscription',
                                this.mCurrentTab.outerPlaylistShowing);
                                
-            // TODO remove dump
-            dump("MATT: browser.onLocationChange - sending TabContentChanged\n");
-
             // Let listeners know that the tab location has changed
-            this.notifyTabContentChanged();                            
+            this.notifyTabContentChange();                            
           }
           catch ( err )
           {
@@ -764,12 +753,9 @@
           else if (aState & nsIWebProgressListener.STATE_STOP) {
             // Stop the spinner if necessary
             this.loading = false;
-            
-            // TODO remove dump
-            dump("MATT: browser.onStateChange - sending TabContentChanged\n");
-            
+                        
             // Let listeners know that the tab has finished loading
-            this.notifyTabContentChanged();
+            this.notifyTabContentChange();
             
             // Save the tab state after every page load, just in case we crash
             if (this.tabStateRestored) {
@@ -790,7 +776,7 @@
       </method>
 
 
-      <!-- Sends a "TabContentChanged" event from the current tab. 
+      <!-- Sends a "TabContentChange" event from the current tab. 
            Called when the user switches tabs, and before and after
            a new page is loaded in the current tab.
            
@@ -804,11 +790,11 @@
              * "TabSelect" is dispatched only on tab change, not on 
                 new content
        -->
-      <method name="notifyTabContentChanged">
+      <method name="notifyTabContentChange">
         <body>
         <![CDATA[
           var event = document.createEvent("Events");
-          event.initEvent("TabContentChanged", true, false);
+          event.initEvent("TabContentChange", true, false);
           this.dispatchEvent(event);
         ]]></body>
       </method>
@@ -830,7 +816,7 @@
             <![CDATA[
 
           // figure out if the url is in the webplaylist
-          var currentPlaylist = this.outerPlaylist;
+          var currentPlaylist = this.currentOuterPlaylist;
           
           if (aTryWeb && currentPlaylist)
           {
@@ -1429,7 +1415,7 @@
     </implementation>
 
     <handlers>
-      <handler event="click"><![CDATA[
+      <handler event="click" phase="capturing" ><![CDATA[
         // inspired by contentAreaClick in ffox browser.js
         if (!event.isTrusted || event.getPreventDefault()) {
           return true;
@@ -1560,7 +1546,6 @@
     </content>
     <implementation implements="nsIWebProgressListener,sbITabBrowserTab">
       <constructor><![CDATA[
-        dump("MATT: tab CONSTRUCTOR\n");
         // right after all the constructors run...
         var self = this;
         window.setTimeout(function () { self.createOuterPlaylist(); }, 0);
@@ -1591,7 +1576,6 @@
         
       ]]></constructor>
      <destructor><![CDATA[
-        dump("MATT: tab DESTRUCTOR\n");
         this.closeBalloonTip();
         
         // Remove the browser DOM loaded event listener.
@@ -1712,7 +1696,6 @@
           this.browserDOMLoadedEventListener = {
             tabbrowser: this,
             handleEvent: function(event) {
-              dump("MATT: tabBrowser.DOMContentLoaded\n");
               this.tabbrowser.setUpMediaPage();
               this.tabbrowser.scanWebPage();
             }
@@ -1907,11 +1890,14 @@
             // the service pane info
             if (servicePaneNode) {
               if (servicePaneNode.image) {
-                this.setIcon(this.mCurrentTab, servicePaneNode.image);
+                gBrowser.setIcon(this, servicePaneNode.image);
               } 
               if (servicePaneNode.properties) {
                 properties = servicePaneNode.properties;
-              }  
+              }
+              if (servicePaneNode.name) {
+                this.label = servicePaneNode.name;
+              }
             }
 
             // Reflect the service pane properties for this URL (if any) onto the 
@@ -2043,7 +2029,6 @@
       <method name="setUpMediaPage">
         <body><![CDATA[
         if (!this.mediaPage) {
-          dump("MATT: setUpMediaPage - NO PAGE FOUND \n");
           
           // The loaded page is not a MediaPage, so we can't
           // do anything with the view we were given.  
@@ -2053,7 +2038,6 @@
           this._highlightViewIndexOnLoad = null;
           return;
         }
-        dump("MATT: setUpMediaPage \n");
         
         try {          
           
@@ -2094,7 +2078,6 @@
            is removed from the system -->
       <method name="onMediaListRemoved">
         <body><![CDATA[
-          dump("\nMATT: list removed!\n");
           this._viewForPage = null;
           this.backWithDefault();
         ]]></body>
@@ -2261,7 +2244,6 @@
 
           this.applyPropertiesFromServicePaneNode();
           
-          dump("MATT: onLocationChange + " + aLocation.spec + "\n");
         ]]></body>
       </method>
 
@@ -2294,8 +2276,6 @@
             return;
           }
 
-          dump("MATT: tab.onStateChange\n");
-
           const nsIWebProgressListener =
             Components.interfaces.nsIWebProgressListener;
           if (aState & nsIWebProgressListener.STATE_STOP) {
@@ -2343,7 +2323,6 @@
         <parameter name="evt"/>
         <body>
         <![CDATA[
-          dump("MATT: tab.onBrowserUnload\n");                    
            
           // For now only save view history for chrome media pages
           if (!this.linkedBrowser.currentURI.schemeIs("chrome") ||
Index: app/content/bindings/mediaPages.xml
===================================================================
--- app/content/bindings/mediaPages.xml	(revision 8149)
+++ app/content/bindings/mediaPages.xml	(working copy)
@@ -238,10 +238,10 @@
             button.setAttribute("disabled", "true");
           }
         };
-        gBrowser.addEventListener('TabContentChanged', this.disabler, false); 
+        gBrowser.addEventListener('TabContentChange', this.disabler, false); 
       ]]></constructor>
       <destructor><![CDATA[
-        gBrowser.removeEventListener('TabContentChanged', this.disabler, false);
+        gBrowser.removeEventListener('TabContentChange', this.disabler, false);
       ]]></destructor>
     </implementation>
   </binding>
Index: app/content/bindings/playlist.xml
===================================================================
--- app/content/bindings/playlist.xml	(revision 8149)
+++ app/content/bindings/playlist.xml	(working copy)
@@ -477,7 +477,6 @@
         <parameter name="collapse"/>
         <body>
 <![CDATA[
-  dump("MATT: playlist.bind() \n");
 
   // Make sure we save the column spec
   // for the existing view
@@ -544,8 +543,6 @@
 <![CDATA[
   if (!this._destroyed) {
   
-    dump("MATT: playlist.destroy();\n");
-    
     if (this._columnSpecIsDirty) {
       this._saveColumnSpec();
     }
Index: app/content/bindings/servicePane.xml
===================================================================
--- app/content/bindings/servicePane.xml	(revision 8149)
+++ app/content/bindings/servicePane.xml	(working copy)
@@ -217,7 +217,7 @@
             sp.onBrowserTabChange(e);
           }
           function windowOnLoad() {
-            sp.browser.addEventListener("TabContentChanged", 
+            sp.browser.addEventListener("TabContentChange", 
                   sp._onBrowserTabChangeListener, false);            
 
             gServicePane.doneInit = true;
@@ -242,7 +242,7 @@
 
         // Remove the browser event listener
         if (this.browser) {
-          this.browser.removeEventListener("TabContentChanged",
+          this.browser.removeEventListener("TabContentChange",
             this._onBrowserTabChangeListener, false);
         }
 
@@ -383,8 +383,6 @@
         <body><![CDATA[
           try {
             var url = this._browser.currentURI.spec;
-            // TODO remove
-            dump("MATT: servicepane.onBrowserTabChange: " + url + "\n");
           
             // Is there a servicepane node for the current tab?
             var node = this._browser.selectedTab.servicePaneNode;
Index: components/mediapages/test/test-extension/chrome/content/testMediaPage.xul
===================================================================
--- components/mediapages/test/test-extension/chrome/content/testMediaPage.xul	(revision 8149)
+++ components/mediapages/test/test-extension/chrome/content/testMediaPage.xul	(working copy)
@@ -69,7 +69,6 @@
 window.mediaPage = {
 
   onLoad:  function(e) {
-    dump("MATT: mediaPage.onLoad()!\n");
     
     // TODO Move this rule out into the page manager
     // If we're a library, set our desired filterlists
@@ -102,7 +101,6 @@
   },
 
   onUnload:  function(e) {
-    dump("MATT: mediaPage.onUnload()!\n");
   },
 
   _mediaListView: null,
@@ -114,7 +112,6 @@
   },
 
   set mediaListView(value)  {
-    dump("MATT: mediaPage.set mediaListView!\n");
     this._mediaListView = value;
   },
 
@@ -125,11 +122,11 @@
   // TODO Drag and drop
 }
 ]]></script>
-
-    <p>
-      This is an Add-On Media Page. To learn more about how to make your own 
-      <a href="javascript:openLink('http://www.songbirdnest.com/add-on-api/articles/media-pages');">Display Panes</a>, 
-      go <a href="javascript:openLink('http://www.songbirdnest.com/add-on-api/articles/media-pages');">here</a>.
-    </p>
 
+    <p>
+      This is an Add-On Media Page. To learn more about how to make your own 
+      <a href="javascript:openLink('http://www.songbirdnest.com/add-on-api/articles/media-pages');">Display Panes</a>, 
+      go <a href="javascript:openLink('http://www.songbirdnest.com/add-on-api/articles/media-pages');">here</a>.
+    </p>
+
 </window>
\ No newline at end of file