Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Does not work on Windows 10 64-bit #244

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c83dc41
Update maxVersion to 60.0
CubicF-SO Aug 18, 2018
db78af0
Use "0o"-prefixed octal literals
CubicF-SO Aug 18, 2018
4989330
Remove javascript version because not supported any more since mozilla57
CubicF-SO Aug 18, 2018
7049495
Replace `for each` by `for (... of ...) because E4X/ECMA-357 is depre…
CubicF-SO Aug 18, 2018
1c84557
Define variables before using them
CubicF-SO Aug 18, 2018
a39feb9
Use `ChromeUtils.import()` because it's faster than `Components.utils…
CubicF-SO Aug 18, 2018
53a8486
Mention CubicF as developer
CubicF-SO Aug 18, 2018
6698ae2
Delete unused property addonRootDir which was set by a failing function
CubicF-SO Aug 19, 2018
8ea9a44
Replace legacy iterators with generators
firetray-updates Sep 8, 2018
d5dce60
Declare some variables
firetray-updates Sep 8, 2018
6ca5920
Drop the no longer supported try...catch syntax
firetray-updates Sep 8, 2018
7844f9d
Fix the preferences dialog
firetray-updates Sep 8, 2018
3fabbfb
Don't use nsIDOMXPathResult
firetray-updates Sep 9, 2018
de3145c
Do not rely on StopIteration for the fade animation
firetray-updates Sep 9, 2018
5d1940d
Mark Firefox < 57 (ie, all) and TB < 57 as unsupported.
kilobyte Sep 11, 2018
15a4d3e
Mark SeaMonkey, ChatZilla and Zotero as unsupported as well.
kilobyte Sep 19, 2018
acbfa29
Make it compatible with 60.*
firetray-updates Oct 13, 2018
b7fe5c3
draw mail count background with cairo
indigoxela Nov 3, 2018
07d3027
reordered icon creation, better re-use of variable, updated comment
indigoxela Nov 4, 2018
00eff4b
Merge pull request #3 from indigoxela/thunderbird-57
firetray-updates Nov 4, 2018
5a4afed
update Russian translation
vantu5z Nov 16, 2018
4def1ff
Merge pull request #6 from vantu5z/thunderbird-57
firetray-updates Nov 17, 2018
3fd8a8c
Update zh-TW locale.
Nov 22, 2018
8e45fae
AppIndicator: Actually use custom icons
firetray-updates Nov 24, 2018
60ecfbb
Merge pull request #8 from cbsghost/thunderbird-57
firetray-updates Nov 24, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/chrome/content/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cu = ChromeUtils;

Cu.import("resource://firetray/FiretrayHandler.jsm");
Cu.import("resource://firetray/commons.js");
Expand Down
1 change: 1 addition & 0 deletions src/chrome/content/options.xul
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://firetray/skin/overlay.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/preferences/preferences.css" type="text/css"?>
<!DOCTYPE prefwindow SYSTEM "chrome://firetray/locale/options.dtd">
<prefwindow id="firetray-preferences"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
Expand Down
2 changes: 1 addition & 1 deletion src/chrome/content/overlay.xul
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-stylesheet href="chrome://firetray/skin/overlay.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://firetray/locale/overlay.dtd">
<overlay id="firetray-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript;version=1.8" src="overlay.js"/>
<script type="application/javascript" src="overlay.js"/>

<stringbundleset id="stringbundleset">
<stringbundle id="firetray-strings" src="chrome://firetray/locale/overlay.properties"/>
Expand Down
20 changes: 10 additions & 10 deletions src/chrome/locale/ru-RU/options.dtd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- if you need multiline/carriage return, use a .properties -->
<!ENTITY prefwindow.title "Настройки FireTray">

<!ENTITY NOT_IMPLEMENTED_YET "ЕЩЕ НЕ РЕАЛИЗОВАНО">
<!ENTITY NOT_IMPLEMENTED_YET "ЕЩЁ НЕ РЕАЛИЗОВАНО">

<!ENTITY windows_options "Окна">
<!ENTITY icon_options "Значок">
Expand All @@ -18,7 +18,7 @@
<!ENTITY hides_last_only.label "Скрывать только последнее окно">
<!ENTITY hides_last_only.tooltip "другие окна будут закрыты (уничтожены)">
<!ENTITY hides_last_only.accesskey "O">
<!ENTITY start_hidden.label "При запуске программы сворачивать ее в трей">
<!ENTITY start_hidden.label "При запуске программы сворачивать её в трей">
<!ENTITY start_hidden.accesskey "S">
<!ENTITY show_activates.label "Включать восстановленные окна">
<!ENTITY show_activates.accesskey "e">
Expand All @@ -43,18 +43,18 @@
<!ENTITY down "↓" >
<!ENTITY hide "скрыть" >
<!ENTITY restore "показать" >
<!ENTITY middle_click.label "Mouse middle click action :" >
<!ENTITY middle_click.label "Действие по нажатию средней кнопки мыши :" >
<!ENTITY middle_click.accesskey "k" >
<!ENTITY show_hide "Show/hide" >
<!ENTITY activate_last "Activate last window" >
<!ENTITY show_hide "Показать/Скрыть" >
<!ENTITY activate_last "Сделать активным последнее окно" >

<!ENTITY mail_notification_enabled.label "Включить оповещение о новых сообщениях">
<!ENTITY mail_notification_enabled.accesskey "a">
<!ENTITY message_count_type.label "уведомлять о :">
<!ENTITY message_count_type.accesskey "m">
<!ENTITY message_count_type_unread "непрочитанных сообщениях">
<!ENTITY message_count_type_new "новых сообщениях">
<!ENTITY message_count_type_new.tooltip "новых сообщениях с последнего просмотра папки.">
<!ENTITY message_count_type_new.tooltip "новых сообщениях с последнего просмотра папки">
<!ENTITY mail_notification_type.label "Тип оповещения">
<!ENTITY mail_notification_type.tooltip "aka. Biff">
<!ENTITY mail_notification_unread_count.label "показать количество новых сообщений">
Expand All @@ -69,16 +69,16 @@
<!ENTITY choose.accesskey "O">

<!ENTITY unread_count_folder_exceptions.label "Включать особые папки">
<!ENTITY unread_count_folder_exceptions.tooltip "Включать особые папки для подсчета количества новых сообщений">
<!ENTITY unread_count_folder_exceptions.tooltip "Включать особые папки для подсчёта количества новых сообщений">
<!ENTITY excluded_folders_list.tooltip "Используйте CTRL + ЛКМ для множественного выбора">

<!ENTITY unread_count_account_exceptions.label "Включаемые почтовые ящики">
<!ENTITY unread_count_account_exceptions.tooltip "Почтовые ящик для подсчета непрочитанных сообщений">
<!ENTITY unread_count_account_exceptions.tooltip "Почтовые ящик для подсчёта непрочитанных сообщений">
<!ENTITY folder_count_recursive.label "Включая подпапки">
<!ENTITY folder_count_recursive.accesskey "f">
<!ENTITY only_favorite_folders.label "Только избранные папки">
<!ENTITY only_favorite_folders.accesskey "v">
<!ENTITY only_favorite_folders.tooltip "Within included folder types and included accounts, only count messages in favorite folders">
<!ENTITY only_favorite_folders.tooltip "Во включённых типах папок и аккаутах, только количество сообщений в избранных папках">

<!ENTITY account_or_server_type_name "Почтовый ящик">
<!ENTITY account_or_server_type_name.tooltip "Имя почтового ящика или протокола">
Expand All @@ -93,7 +93,7 @@
<!ENTITY mail_change_trigger.tooltip "Абсолютный путь к программе. В качестве первого аргумента будет передано количество сообщений">
<!ENTITY mail_get_attention.label "Установить срочное оповещение X11">
<!ENTITY mail_get_attention.accesskey "X">
<!ENTITY nomail_hides_icon.label "Hide icon when no mail">
<!ENTITY nomail_hides_icon.label "Прятать значок, если нет писем">
<!ENTITY nomail_hides_icon.accesskey "H">

<!ENTITY chat_icon_enable.label "Включить значок чата">
Expand Down
2 changes: 1 addition & 1 deletion src/chrome/locale/ru-RU/options.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Archive=Архив
Drafts=Черновики
Junk=Junk
Junk=Спам
Queue=Очередь
SentMail=Отправленные
Templates=Черновики
Expand Down
2 changes: 2 additions & 0 deletions src/chrome/locale/zh-TW/options.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
<!ENTITY mail_change_trigger.tooltip "要在訊息數改變時執行程式的絕對路徑。程式會將新的訊息數作為第一個參數。">
<!ENTITY mail_get_attention.label "有新訊息時視窗發出提醒信號">
<!ENTITY mail_get_attention.accesskey "g">
<!ENTITY nomail_hides_icon.label "有新郵件時顯示系統列圖示">
<!ENTITY nomail_hides_icon.accesskey "t">
<!ENTITY chat_icon_enable.label "啟用聊天圖示">
<!ENTITY chat_icon_enable.accesskey "E">
<!ENTITY chat_icon_blink.label "有新訊息時閃爍聊天圖示">
Expand Down
2 changes: 1 addition & 1 deletion src/components/firetray-clhandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cu = ChromeUtils;

Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://firetray/logging.jsm");
Expand Down
37 changes: 3 additions & 34 deletions src/install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -19,48 +19,17 @@
<em:targetPlatform>Linux</em:targetPlatform>
<em:targetPlatform>WINNT</em:targetPlatform>

<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- Firefox -->
<em:minVersion>7.0</em:minVersion>
<em:maxVersion>38.0</em:maxVersion>
</Description>
</em:targetApplication>

<em:targetApplication> <!-- Thunderbird -->
<Description>
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
<em:minVersion>7.0</em:minVersion>
<em:maxVersion>38.0</em:maxVersion>
</Description>
</em:targetApplication>

<em:targetApplication> <!-- SeaMonkey -->
<Description>
<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
<em:minVersion>2.4</em:minVersion>
<em:maxVersion>2.35</em:maxVersion>
</Description>
</em:targetApplication>

<em:targetApplication> <!-- ChatZilla -->
<Description>
<em:id>{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}</em:id>
<em:minVersion>0.8</em:minVersion>
<em:maxVersion>0.9.*</em:maxVersion>
</Description>
</em:targetApplication>

<em:targetApplication> <!-- Zotero -->
<Description>
<em:id>[email protected]</em:id>
<em:minVersion>2.1a1</em:minVersion>
<em:maxVersion>4.*</em:maxVersion>
<em:minVersion>57.0</em:minVersion>
<em:maxVersion>60.*</em:maxVersion>
</Description>
</em:targetApplication>

<em:developer>Jared Forsyth</em:developer>
<em:developer>Glen Winters</em:developer>
<em:developer>CubicF</em:developer>

<em:contributor>Simone 'Underpass'</em:contributor>
<em:contributor>Diego Rodriguez</em:contributor>
Expand Down
15 changes: 4 additions & 11 deletions src/modules/FiretrayHandler.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var EXPORTED_SYMBOLS = [ "firetray" ];

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cu = ChromeUtils;

Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/ctypes.jsm");
Expand Down Expand Up @@ -59,14 +59,7 @@ firetray.Handler = {
OS: Services.appinfo.OS.toLowerCase(), // "WINNT", "Linux", "Darwin"
widgetTk: Services.appinfo.widgetToolkit,
};})(),
addonRootDir: (function(){
let uri = Services.io.newURI(Components.stack.filename, null, null);
if (uri instanceof Ci.nsIFileURL) {
log.debug("_directory="+uri.file.parent.parent.path);
return uri.file.parent.parent;
}
throw new Error("not resolved");
})(),

support: {chat: false, winnt: false},

init: function() { // does creates icon
Expand Down Expand Up @@ -254,8 +247,8 @@ firetray.Handler = {
// [nsISimpleEnumerator::hasMoreElements]"), and we're unsure if we should
// initAccounts() ourselves...
existsChatAccount: function() {
let accounts = new firetray.Messaging.Accounts();
for (let accountServer in accounts)
let accounts = firetray.Messaging.Accounts();
for (let accountServer of accounts)
if (accountServer.type === FIRETRAY_ACCOUNT_SERVER_TYPE_IM) {
log.debug("found im server: "+accountServer.prettyName);
return true;
Expand Down
29 changes: 12 additions & 17 deletions src/modules/FiretrayMessaging.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var EXPORTED_SYMBOLS = [ "firetray", "FLDRS_UNINTERESTING" ];

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cu = ChromeUtils;

Cu.import("resource:///modules/iteratorUtils.jsm");
Cu.import("resource:///modules/mailServices.js");
Expand Down Expand Up @@ -263,8 +263,8 @@ firetray.Messaging = {
let excludedAccounts = mailAccounts["excludedAccounts"];

this.newMsgCount = 0;
let accounts = new this.Accounts();
for (let accountServer in accounts) { // nsIMsgIncomingServer
let accounts = firetray.Messaging.Accounts();
for (let accountServer of accounts) { // nsIMsgIncomingServer

if (accountServer.type === FIRETRAY_ACCOUNT_SERVER_TYPE_IM) {
continue; // IM messages are counted elsewhere
Expand Down Expand Up @@ -365,32 +365,27 @@ firetray.Messaging = {
* @param sortByTypeAndName: boolean
* @return a generator over all nsIMsgIncomingServer including hidden and IM ones
*/
firetray.Messaging.Accounts = function(sortByTypeAndName) {
firetray.Messaging.Accounts = function*(sortByTypeAndName) {
if (typeof(sortByTypeAndName) == "undefined") {
this.sortByTypeAndName = false;
return;
}
if (typeof(sortByTypeAndName) !== "boolean")
sortByTypeAndName = false;
} else if (typeof(sortByTypeAndName) !== "boolean") {
throw new TypeError();
}

this.sortByTypeAndName = sortByTypeAndName;
};

firetray.Messaging.Accounts.prototype.__iterator__ = function() {
log.debug("sortByTypeAndName="+this.sortByTypeAndName);
log.debug("sortByTypeAndName=" + sortByTypeAndName);

/* NOTE: sort() not provided by nsIMsgAccountManager.accounts
(nsISupportsArray or nsIArray if xulrunner >= 20.0). Should be OK to
re-build a JS-Array for few accounts */
let accountServers = [];
for (let accountServer in fixIterator(MailServices.accounts.accounts,
for (let accountServer of fixIterator(MailServices.accounts.accounts,
Ci.nsIMsgAccount)) {
accountServers.push(accountServer.incomingServer);
}

let mailAccounts = firetray.Utils.getObjPref('mail_accounts');
let serverTypes = mailAccounts["serverTypes"];
if (this.sortByTypeAndName) {
if (sortByTypeAndName) {
accountServers.sort(function(a,b) {
if (serverTypes[a.type].order
< serverTypes[b.type].order)
Expand Down Expand Up @@ -419,8 +414,8 @@ firetray.Messaging.Accounts.prototype.__iterator__ = function() {
*/
firetray.Messaging.accountsByServerType = function() {
let accountsByServerType = {};
let accounts = new firetray.Messaging.Accounts(false);
for (let accountServer in accounts) {
let accounts = firetray.Messaging.Accounts(false);
for (let accountServer of accounts) {
let accountServerKey = accountServer.key.toString();
let accountServerName = accountServer.prettyName;
let accountServerType = accountServer.type;
Expand Down
2 changes: 1 addition & 1 deletion src/modules/FiretrayWindow.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var EXPORTED_SYMBOLS = [ "FiretrayWindow" ];

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cu = ChromeUtils;

Cu.import("resource://firetray/commons.js");

Expand Down
2 changes: 1 addition & 1 deletion src/modules/PrefListener.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var EXPORTED_SYMBOLS = [ "PrefListener" ];

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cu = ChromeUtils;


/**
Expand Down
2 changes: 1 addition & 1 deletion src/modules/VersionChange.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var EXPORTED_SYMBOLS = [ "VersionChange" ];

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cu = ChromeUtils;

Cu.import("resource://gre/modules/AddonManager.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Expand Down
13 changes: 6 additions & 7 deletions src/modules/commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var EXPORTED_SYMBOLS =

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cu = ChromeUtils;

Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://firetray/logging.jsm");
Expand Down Expand Up @@ -183,7 +183,7 @@ firetray.Utils = {
},

QueryInterfaces: function(obj) {
for each (i in Components.interfaces)
for (i of Components.interfaces)
try {
if (obj instanceof i) log.debug (i);
} catch(x) {}
Expand Down Expand Up @@ -230,22 +230,21 @@ firetray.Utils = {
XPath: function(ref, xpath) {
var doc = ref.ownerDocument || ref;

const XPathResult = Ci.nsIDOMXPathResult;
try {
let that = this;
var result = doc.evaluate(xpath, ref, that._nsResolver,
XPathResult.ANY_TYPE, null);
0 /* XPathResult.ANY_TYPE */, null);
} catch (x) {
log.error(x);
}
log.debug("XPathResult="+result.resultType);

switch (result.resultType) {
case XPathResult.NUMBER_TYPE:
case result.NUMBER_TYPE:
return result.numberValue;
case XPathResult.BOOLEAN_TYPE:
case result.BOOLEAN_TYPE:
return result.booleanValue;
case XPathResult.STRING_TYPE:
case result.STRING_TYPE:
return result.stringValue;
} // else XPathResult.UNORDERED_NODE_ITERATOR_TYPE:

Expand Down
8 changes: 4 additions & 4 deletions src/modules/ctypes/ctypes-utils.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

var EXPORTED_SYMBOLS = [ "ctypes_library", "is64bit", "WinCbABI" ];

const Cu = Components.utils;
const Cu = ChromeUtils;

Cu.import("resource://gre/modules/ctypes.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Expand Down Expand Up @@ -117,7 +117,7 @@ function ctypes_library(aName, aABIs, aDefines, aGlobal) {

var library;
this.ABI = -1;
for each (let abi in aABIs) {
for (let abi of aABIs) {
// FIXME: ABI is in fact SO_VER. Now we're mixing .so versions and the
// .dll extension :(
let libname = abi === 'dll' ? aName :
Expand Down Expand Up @@ -161,15 +161,15 @@ function ctypes_library(aName, aABIs, aDefines, aGlobal) {
let lib = {
declare: function() {
try {
args = [];
let args = [];
args.push(arguments[0]);
// FIXME: ugly hack. We'll see when we need WinCbABI
if (this.ABI === 'dll') {
args.push(WinABI);
} else {
args.push(ctypes.default_abi);
}
for each (let arg in Array.prototype.slice.call(arguments, 1)) {
for (let arg of Array.prototype.slice.call(arguments, 1)) {
args.push(arg);
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/ctypes/ctypesMap.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var EXPORTED_SYMBOLS = [ "ctypesMap", "FIRETRAY_WINDOW_COUNT_MAX", "DeleteError"

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cu = ChromeUtils;

Cu.import("resource://gre/modules/ctypes.jsm");
Cu.import("resource://firetray/logging.jsm");
Expand Down
Loading