2
|
1 var nightlyApp = {
|
|
2
|
|
3 storedTitle: document.documentElement.getAttribute("titlemodifier"),
|
|
4
|
|
5 init: function()
|
|
6 {
|
|
7 // var brandbundle = document.getElementById("bundle_brand");
|
|
8 var bundleSvc = Components.classes["@mozilla.org/intl/stringbundle;1"]
|
|
9 .getService(Components.interfaces.nsIStringBundleService);
|
|
10 var brandbundle = bundleSvc.
|
|
11 createBundle("chrome://branding/locale/brand.properties");
|
|
12
|
|
13 if (nightly.variables.name==null)
|
|
14 {
|
|
15 nightly.variables.name=brandbundle.GetStringFromName("brandShortName");
|
|
16 }
|
|
17 nightly.variables.brandname=brandbundle.GetStringFromName("brandFullName");
|
|
18 nightly.variables.defaulttitle=nightlyApp.storedTitle;
|
|
19 },
|
|
20
|
|
21 detectLeaks: function(event)
|
|
22 {
|
|
23 var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
|
24 .getService(Components.interfaces.nsIWindowMediator);
|
|
25 var win = wm.getMostRecentWindow("Nightly:LeakReporter");
|
|
26 if (win)
|
|
27 win.focus();
|
|
28 else
|
|
29 window.openDialog("chrome://nightly/content/leaks/leaks.xul", "_blank", "chrome,all,dialog=no");
|
|
30 },
|
|
31
|
|
32 openURL: function(url, event)
|
|
33 {
|
|
34 openUILink(url, event, false, true);
|
|
35 },
|
|
36
|
|
37 setCustomTitle: function(title)
|
|
38 {
|
|
39 var titlebar = document.getElementsByTagName("sb-sys-titlebar")[0];
|
|
40 titlebar.setAttribute("value", title);
|
|
41 },
|
|
42
|
|
43 setBlankTitle: function()
|
|
44 {
|
|
45 var titlebar = document.getElementsByTagName("sb-sys-titlebar")[0];
|
|
46 titlebar.setAttribute("value", "");
|
|
47 },
|
|
48
|
|
49 setStandardTitle: function()
|
|
50 {
|
|
51 var titlebar = document.getElementsByTagName("sb-sys-titlebar")[0];
|
|
52 titlebar.setAttribute("value", nightlyApp.storedTitle);
|
|
53 }
|
|
54
|
|
55 }
|