annotate chrome/content/songbird.js @ 4:8aa443d1e395 default tip

revised Makefile
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 02 Dec 2008 20:55:06 +0900
parents 472a16863ecc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
1 var nightlyApp = {
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
2
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
3 storedTitle: document.documentElement.getAttribute("titlemodifier"),
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
4
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
5 init: function()
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
6 {
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
7 // var brandbundle = document.getElementById("bundle_brand");
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
8 var bundleSvc = Components.classes["@mozilla.org/intl/stringbundle;1"]
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
9 .getService(Components.interfaces.nsIStringBundleService);
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
10 var brandbundle = bundleSvc.
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
11 createBundle("chrome://branding/locale/brand.properties");
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
12
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
13 if (nightly.variables.name==null)
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
14 {
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
15 nightly.variables.name=brandbundle.GetStringFromName("brandShortName");
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
16 }
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
17 nightly.variables.brandname=brandbundle.GetStringFromName("brandFullName");
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
18 nightly.variables.defaulttitle=nightlyApp.storedTitle;
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
19 },
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
20
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
21 detectLeaks: function(event)
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
22 {
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
23 var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
24 .getService(Components.interfaces.nsIWindowMediator);
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
25 var win = wm.getMostRecentWindow("Nightly:LeakReporter");
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
26 if (win)
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
27 win.focus();
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
28 else
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
29 window.openDialog("chrome://nightly/content/leaks/leaks.xul", "_blank", "chrome,all,dialog=no");
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
30 },
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
31
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
32 openURL: function(url, event)
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
33 {
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
34 openUILink(url, event, false, true);
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
35 },
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
36
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
37 setCustomTitle: function(title)
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
38 {
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
39 var titlebar = document.getElementsByTagName("sb-sys-titlebar")[0];
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
40 titlebar.setAttribute("value", title);
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
41 },
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
42
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
43 setBlankTitle: function()
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
44 {
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
45 var titlebar = document.getElementsByTagName("sb-sys-titlebar")[0];
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
46 titlebar.setAttribute("value", "");
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
47 },
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
48
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
49 setStandardTitle: function()
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
50 {
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
51 var titlebar = document.getElementsByTagName("sb-sys-titlebar")[0];
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
52 titlebar.setAttribute("value", nightlyApp.storedTitle);
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
53 }
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
54
472a16863ecc expanded nightly.jar
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
55 }