* rename NOTIFICATION_* to FT_NOTIFICATION_* for disambiguation

* declare Cc,Ci,Cu locally instead of exporting them from common.js
  THIS BREAKS THE JS CONSOLE ! (among other things) as of Gecko-8 at least
This commit is contained in:
foudfou 2011-12-11 05:17:18 +01:00
parent 0acd053155
commit cced2289f6
5 changed files with 20 additions and 16 deletions

View File

@ -92,13 +92,13 @@ firetray.UIOptions = {
_disableNotificationMaybe: function(notificationSetting) {
let iconTextColor = document.getElementById("icon_text_color");
this.disableGroup(iconTextColor,
(notificationSetting !== NOTIFICATION_UNREAD_MESSAGE_COUNT));
(notificationSetting !== FT_NOTIFICATION_UNREAD_MESSAGE_COUNT));
let customIconGroup = document.getElementById("custom_mail_icon");
this.disableGroup(customIconGroup,
(notificationSetting !== NOTIFICATION_CUSTOM_ICON));
(notificationSetting !== FT_NOTIFICATION_CUSTOM_ICON));
let isNotificationDisabled = (notificationSetting === NOTIFICATION_DISABLED);
let isNotificationDisabled = (notificationSetting === FT_NOTIFICATION_DISABLED);
if (isNotificationDisabled) {
document.getElementById("broadcaster-notification-disabled")

View File

@ -3,6 +3,10 @@
Components.utils.import("resource://firetray/commons.js");
Components.utils.import("resource://firetray/FiretrayHandler.jsm");
if ("undefined" == typeof(Cc)) var Cc = Components.classes;
if ("undefined" == typeof(Ci)) var Ci = Components.interfaces;
if ("undefined" == typeof(Cu)) var Cu = Components.utils;
/**
* firetray namespace.
*/

View File

@ -79,7 +79,7 @@ firetray.Handler = {
try {
Cu.import("resource://firetray/FiretrayMessaging.jsm");
let prefMailNotification = firetray.Utils.prefService.getIntPref("mail_notification");
if (prefMailNotification !== NOTIFICATION_DISABLED) {
if (prefMailNotification !== FT_NOTIFICATION_DISABLED) {
firetray.Messaging.init();
firetray.Messaging.updateUnreadMsgCount();
}

View File

@ -83,7 +83,7 @@ firetray.Messaging = {
updateUnreadMsgCount: function() {
LOG("unreadMsgCount");
let prefMailNotification = firetray.Utils.prefService.getIntPref("mail_notification");
if (prefMailNotification === NOTIFICATION_DISABLED)
if (prefMailNotification === FT_NOTIFICATION_DISABLED)
return;
let mailAccounts = firetray.Utils.getObjPref('mail_accounts');
@ -127,14 +127,14 @@ firetray.Messaging = {
} else if (this._unreadMsgCount > 0) {
switch (prefMailNotification) {
case NOTIFICATION_UNREAD_MESSAGE_COUNT:
case FT_NOTIFICATION_UNREAD_MESSAGE_COUNT:
let prefIconTextColor = firetray.Utils.prefService.getCharPref("icon_text_color");
firetray.Handler.setText(this._unreadMsgCount.toString(), prefIconTextColor);
break;
case NOTIFICATION_NEWMAIL_ICON:
case FT_NOTIFICATION_NEWMAIL_ICON:
firetray.Handler.setImage(firetray.Handler.FILENAME_NEWMAIL);
break;
case NOTIFICATION_CUSTOM_ICON:
case FT_NOTIFICATION_CUSTOM_ICON:
let prefCustomIconPath = firetray.Utils.prefService.getCharPref("custom_mail_icon");
firetray.Handler.setImage(prefCustomIconPath);
break;

View File

@ -1,10 +1,10 @@
/* -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
var EXPORTED_SYMBOLS =
[ "firetray", "Cc", "Ci", "Cu", "LOG", "WARN", "ERROR", "FIREFOX_ID",
"THUNDERBIRD_ID", "SEAMONKEY_ID", "XPath", "isArray", "isEmpty",
"NOTIFICATION_DISABLED", "NOTIFICATION_UNREAD_MESSAGE_COUNT",
"NOTIFICATION_NEWMAIL_ICON", "NOTIFICATION_CUSTOM_ICON" ];
[ "firetray", "LOG", "WARN", "ERROR", "FIREFOX_ID",
"THUNDERBIRD_ID", "SEAMONKEY_ID", "isArray", "isEmpty",
"FT_NOTIFICATION_DISABLED", "FT_NOTIFICATION_UNREAD_MESSAGE_COUNT",
"FT_NOTIFICATION_NEWMAIL_ICON", "FT_NOTIFICATION_CUSTOM_ICON" ];
const Cc = Components.classes;
const Ci = Components.interfaces;
@ -19,10 +19,10 @@ const SUNBIRD_ID = "{718e30fb-e89b-41dd-9da7-e25a45638b28}";
const SEAMONKEY_ID = "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}";
const CHATZILLA_ID = "{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}";
const NOTIFICATION_DISABLED = 0;
const NOTIFICATION_UNREAD_MESSAGE_COUNT = 1;
const NOTIFICATION_NEWMAIL_ICON = 2;
const NOTIFICATION_CUSTOM_ICON = 3;
const FT_NOTIFICATION_DISABLED = 0;
const FT_NOTIFICATION_UNREAD_MESSAGE_COUNT = 1;
const FT_NOTIFICATION_NEWMAIL_ICON = 2;
const FT_NOTIFICATION_CUSTOM_ICON = 3;
/**
* firetray namespace.