5 function systray_onHideButtonClick() {
6 var trayIcon = document.getElementById(
"trayicon-mainwin");
7 trayIcon.minimizeWindow();
11 function systray_restore() {
12 var trayIcon = document.getElementById(
"trayicon-mainwin");
13 trayIcon.restoreWindow();
18 function systray_observe(aSubject, aTopic,
aData) {
19 if (aSubject instanceof Components.interfaces.nsIPrefBranch) {
26 function systray_observePref(aSubject, aTopic,
aData) {
29 this._doAlertNotification =
30 (aSubject.PREF_BOOL == aSubject.getPrefType(
aData) &&
31 aSubject.getBoolPref(
aData));
36 _doAlertNotification:
false,
37 _dataremote_timer:
null,
39 function systray_observeRemote(aSubject, aTopic,
aData) {
43 function showAlert(aSystray) {
45 Components.classes[
"@mozilla.org/alerts-service;1"]
46 .getService(Components.interfaces.nsIAlertsService);
52 if (title + artist + album + position + length ==
"") {
56 trayIcon.title = title +
'\n' + artist +
'\n' + album +
'\n' + position +
'/' + length;
57 if (aSystray._doAlertNotification) {
58 alsertsSvc.showAlertNotification(
"chrome://branding/content/nightingale-64.png",
59 title, artist +
" : " + album +
" - " + position +
'/' + length,
63 clearTimeout(
systray._dataremote_timer);
65 var trayIcon = document.getElementById(
"trayicon-mainwin");
80 _positionRemote:
null,
84 function systray_attachRemotes() {
100 function systray_detachRemotes() {
104 systray._artistRemote.unbind();
105 systray._positionRemote.unbind();
106 systray._lengthRemote.unbind();
110 function systray_destroy() {
126 "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
127 var
titlebar = document.getElementsByTagName(
"sb-sys-titlebar")[0];
129 Components.utils.reportError(
"systray: cannot find the title bar");
133 .getElementsByTagNameNS(NS_XUL,
"sb-sys-buttons")[0];
135 Components.utils.reportError(
"systray: cannot find the system buttons");
139 hideButton = document.getAnonymousElementByAttribute(sysButtons,
"sbid",
"hide");
141 Components.utils.reportError(
"systray: cannot find hide button");
146 hideButton.setAttribute(
"hidden",
"false");
150 systray._prefBranch = Components.classes[
"@mozilla.org/preferences-service;1"]
151 .getService(Components.interfaces.nsIPrefService)
152 .getBranch(
"extensions.minimizetotray.")
153 .QueryInterface(Components.interfaces.nsIPrefBranch2);
156 systray.observePref(
systray._prefBranch,
"nsPref:changed",
"sb.notify");
systray observePref(systray._prefBranch,"nsPref:changed","sb.notify")
addEventListener("unload", systray.destroy, false)
function SBDataGetStringValue(aKey)
Get the value of the data in string format.
var getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow('Songbird SBProperties artist
aWindow setTimeout(function(){_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap);}, 0)
return!aWindow arguments!aWindow arguments[0]
this removeEventListener("load", this.__SS_restore, true)
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe