mainOverlay.js
Go to the documentation of this file.
1 /*
2  //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2008 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25 */
26 
27 addEventListener("load", function() {
28  removeEventListener("load", arguments.callee, false);
29 
30  // switch to the Addons view if we're getting one installed
31  if ("arguments" in window &&
32  window.arguments[0] instanceof Components.interfaces.nsIDialogParamBlock &&
33  window.arguments[1] instanceof Components.interfaces.nsIObserver) {
34 
35  var paneAddons = document.getElementById("paneAddons");
36 
37  if (!paneAddons.loaded) {
38  // this is needed in case the pane hasn't loaded yet and the pref window
39  // loads it dynamically as we show it (in reality, this will happen all
40  // the time, since this is the initial load)
41  document.documentElement.showPane(paneAddons);
42  }
43  }
44 
45  // making the menus in the preference pane selector stack vertically to avoid multi-level tabs
46  var browserPreferences = document.getElementById("BrowserPreferences");
47  var selector = document.getAnonymousElementByAttribute(browserPreferences, 'anonid', 'selector');
48  selector.removeAttribute("orient");
49  if (getComputedStyle(selector, "").getPropertyPriority("visibility") == "") {
50  // reset the visibility style, _unless_ it was !important
51  selector.style.visibility = "visible";
52  }
53 
54  // making the menus in the preference pane selector stack vertically to avoid multi-level tabs
55  var browserPreferences = document.getElementById("BrowserPreferences");
56  var selector = document.getAnonymousElementByAttribute(browserPreferences, 'anonid', 'selector');
57  selector.removeAttribute("orient");
58  if (getComputedStyle(selector, "").getPropertyPriority("visibility") == "") {
59  // reset the visibility style, _unless_ it was !important
60  selector.style.visibility = "visible";
61  }
62 
63  // hide the CDRip prefpane if no cd-rip engines are installed
64  var catMan = Cc["@mozilla.org/categorymanager;1"]
65  .getService(Ci.nsICategoryManager);
66  var enum = catMan.enumerateCategory("cdrip-engine");
67  if (!enum.hasMoreElements()) {
68  var radio = document.getAnonymousElementByAttribute(browserPreferences,
69  'pane', 'paneCDRip');
70  radio.hidden = true;
71  }
72 }, false);
73 
74 
75 
76 /*********************************************************
77  HACK for Bug 13456 - document.loadOverlay is very buggy,
78  and crashes when pref panes are loaded too quickly.
79  This is a workaround to prevent multiple simultaneous
80  loadOverlay operations.
81 
82  This code can be removed when we update to trunk Mozilla.
83  ********************************************************/
84 
85 // Replace document.loadOverlay with a version that
86 // prevents multiple loads
87 document._loadOverlay = document.loadOverlay;
88 document._overlayLoading = false;
89 document.loadOverlay = function(overlay, observer) {
90  if (document._overlayLoading) {
91  throw new Error("HACK for Bug 13456 - Only one loadOverlay at a time!");
92  }
93  document._realLoadObserver = observer;
94  document._overlayLoading = true;
95  document._loadOverlay(overlay,
96  document._loadOverlayObserver);
97 }
98 document._loadOverlayObserver = {
99  observe: function() {
100  // We just finished a load, notify the original observer
101  if (document._realLoadObserver) {
102  document._realLoadObserver.observe();
103  document._realLoadObserver = null;
104  }
105  document._overlayLoading = false;
106  }
107 }
const Cc
let window
addEventListener("load", function(){removeEventListener("load", arguments.callee, false);if("arguments"in window &&window.arguments[0] instanceof Components.interfaces.nsIDialogParamBlock &&window.arguments[1] instanceof Components.interfaces.nsIObserver){var paneAddons=document.getElementById("paneAddons");if(!paneAddons.loaded){document.documentElement.showPane(paneAddons);}}var browserPreferences=document.getElementById("BrowserPreferences");var selector=document.getAnonymousElementByAttribute(browserPreferences, 'anonid', 'selector');selector.removeAttribute("orient");if(getComputedStyle(selector,"").getPropertyPriority("visibility")==""){selector.style.visibility="visible";}var browserPreferences=document.getElementById("BrowserPreferences");var selector=document.getAnonymousElementByAttribute(browserPreferences, 'anonid', 'selector');selector.removeAttribute("orient");if(getComputedStyle(selector,"").getPropertyPriority("visibility")==""){selector.style.visibility="visible";}var catMan=Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);var enum=catMan.enumerateCategory("cdrip-engine");if(!enum.hasMoreElements()){var radio=document.getAnonymousElementByAttribute(browserPreferences, 'pane', 'paneCDRip');radio.hidden=true;}}, false)
return null
Definition: FeedWriter.js:1143
return!aWindow arguments!aWindow arguments[0]
SimpleArrayEnumerator prototype hasMoreElements
const Ci
this removeEventListener("load", this.__SS_restore, true)
let observer
sbDeviceFirmwareAutoCheckForUpdate prototype observe