diff --git a/README.md b/README.md index fed1334..b1fcc13 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -Moztray +Firetray ======= Overview -------- -Rewrite attempt of **Firetray** with js-ctypes, with focus on unread message count display. +Js-ctypes rewrite of the binary XPCOM version of **Firetray**. Notes ----- -* Moztray unsets the `tabs.warnOnClose` built-in preference, which otherwise disrupts the handeling of the close event. +* Firetray unsets the `tabs.warnOnClose` built-in preference, which otherwise disrupts the handeling of the close event. * Experimental non-customizable keyboard shortcut for hiding all windows set to: `accel-shift-w` References @@ -34,4 +34,8 @@ Acknowledgment -------------- * Some code borrowed from [Mike Conley](http://mzl.la/messagingmenu "Thanks Mike"). +* Some code borrowed from + [Nils Mayer](https://addons.mozilla.org/fr/firefox/addon/minimizetotray-revived/ + "MinToTrayR addon page"). * kind support from Neil Deaking + diff --git a/src/Makefile b/src/Makefile index 05180ac..73af63f 100755 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,7 @@ help: @echo "BUILD/INSTALL INSTRUCTIONS" @echo - @echo "to build Moztray, just:" + @echo "to build Firetray, just:" @echo " make all" @echo @echo "by default, debug calls are stripped from js files and DEBUG_MODE" @@ -13,9 +13,11 @@ help: @echo " firefox -no-remote -P # then create '$(profile_id)'" @echo " thunderbird -no-remote -P # then create '$(profile_id)'" @echo - @echo "to deploy to dev profile:" - @echo " make clean" - @echo " make install" + @echo "to test the extension with the dev profile:" + @echo " cd ~/.mozilla/firefox/mozilla-dev/extensions" + @echo " ln -s ../../path/to/firetray/src '{9533f794-00b4-4354-aa15-c2bbda6989f8}'" + @echo " cd ~/.thunderbird/mozilla-dev/extensions" + @echo " ln -s ../path/to/firetray/src '{9533f794-00b4-4354-aa15-c2bbda6989f8}'" @echo @echo "to test with dev profile:" @echo " firefox -no-remote -P mozilla-dev" @@ -24,7 +26,7 @@ help: @echo "Have fun !" # The UUID of the extension. -extension_uuid := moztray@foudil.fr +extension_name := firetray # The name of the profile dir where the extension can be installed. profile_id := mozilla-dev @@ -52,10 +54,10 @@ VERSION := $(shell awk '// { version=$$1; \ print version }' $(install_rdf)) # The target XPI files. -xpi_file := $(extension_uuid)-$(VERSION).xpi +xpi_file := $(extension_name)-$(VERSION).xpi xpi_built := $(build_dir)/$(xpi_file) # Since we use false, we need the same name across versions -xpi_deployed := $(extension_uuid).xpi +xpi_deployed := $(extension_name).xpi # The chrome.manifest file. chrome_manifest := chrome.manifest @@ -110,20 +112,9 @@ all: $(xpi_built) # This cleans all temporary files and directories created by 'make'. .PHONY: clean -clean: clean_build clean_profile +clean: clean_build @echo "Cleanup is done." -# This builds everything except for the actual XPI, and then it copies it to the -# specified profile directory, allowing a quick update that requires no install. -.PHONY: install -install: $(xpi_built) $(profile_locations) - @echo "Installing in profile folder: $(profile_locations)" - @for p in $(profile_locations) ; do \ - cp -f $(xpi_built) $$p/$(xpi_deployed); \ - done - @echo "Installing in profile folder. Done!" - @echo - # Regex for 'no' YES_RE := yes|y|Y|true|on @@ -172,9 +163,3 @@ $(profile_locations): clean_build: @echo "Removing build dir: $(build_dir)" @rm -rf $(build_dir) - -clean_profile: - @echo "Removing extension from extension folders: $(profile_locations)" - @for p in $(profile_locations) ; do \ - rm -f $$p/$(xpi_deployed); \ - done diff --git a/src/chrome.manifest b/src/chrome.manifest index cc535b6..b1d609a 100644 --- a/src/chrome.manifest +++ b/src/chrome.manifest @@ -1,11 +1,11 @@ -content moztray chrome/content/ -skin moztray classic/1.0 chrome/skin/ -locale moztray en-US chrome/locale/en-US/ -resource moztray modules/ +content firetray chrome/content/ +skin firetray classic/1.0 chrome/skin/ +locale firetray en-US chrome/locale/en-US/ +resource firetray modules/ -overlay chrome://browser/content/browser.xul chrome://moztray/content/overlay.xul -overlay chrome://messenger/content/messenger.xul chrome://moztray/content/overlay.xul -overlay chrome://songbird/content/xul/mainScriptsOverlay.xul chrome://moztray/content/overlay.xul -overlay chrome://sunbird/content/calendar.xul chrome://moztray/content/overlay.xul -overlay chrome://navigator/content/navigator.xul chrome://moztray/content/overlay.xul -overlay chrome://chatzilla/content/chatzilla.xul chrome://moztray/content/overlay.xul +overlay chrome://browser/content/browser.xul chrome://firetray/content/overlay.xul +overlay chrome://messenger/content/messenger.xul chrome://firetray/content/overlay.xul +overlay chrome://songbird/content/xul/mainScriptsOverlay.xul chrome://firetray/content/overlay.xul +overlay chrome://sunbird/content/calendar.xul chrome://firetray/content/overlay.xul +overlay chrome://navigator/content/navigator.xul chrome://firetray/content/overlay.xul +overlay chrome://chatzilla/content/chatzilla.xul chrome://firetray/content/overlay.xul diff --git a/src/chrome/content/options.js b/src/chrome/content/options.js index ebe6582..91197e0 100644 --- a/src/chrome/content/options.js +++ b/src/chrome/content/options.js @@ -5,22 +5,22 @@ const Ci = Components.interfaces; const Cu = Components.utils; Cu.import("resource:///modules/mailServices.js"); -Cu.import("resource://moztray/MoztHandler.jsm"); -Cu.import("resource://moztray/commons.js"); +Cu.import("resource://firetray/FiretrayHandler.jsm"); +Cu.import("resource://firetray/commons.js"); /** - * mozt namespace. + * firetray namespace. */ -if ("undefined" == typeof(mozt)) { - var mozt = {}; +if ("undefined" == typeof(firetray)) { + var firetray = {}; }; -mozt.UIOptions = { +firetray.UIOptions = { accountBoxId: "accounts_box", onLoad: function() { - if(mozt.Handler.inMailApp) { - Cu.import("resource://moztray/MoztMessaging.jsm"); + if(firetray.Handler.inMailApp) { + Cu.import("resource://firetray/FiretrayMessaging.jsm"); this.insertMailAccountsExcluded(this.accountBoxId); } }, @@ -29,9 +29,9 @@ mozt.UIOptions = { // the DOM parent where we do appendChild let targetNode = document.getElementById(parentId); - let accounts = new mozt.Messaging.Accounts(true); + let accounts = new firetray.Messaging.Accounts(true); for (let accountServer in accounts) { - if (mozt.Messaging.SERVER_TYPES_EXCLUDED.indexOf(accountServer.type) >= 0) + if (firetray.Messaging.SERVER_TYPES_EXCLUDED.indexOf(accountServer.type) >= 0) continue; let nodeAccount = document.createElement("checkbox"); @@ -39,9 +39,9 @@ mozt.UIOptions = { nodeAccount.setAttribute('id', accountServerKey); nodeAccount.setAttribute('label', accountServer.rootFolder.name); nodeAccount.setAttribute('checked', - (mozt.Messaging.getPrefAccountsExcluded().indexOf(accountServerKey) >= 0)); + (firetray.Messaging.getPrefAccountsExcluded().indexOf(accountServerKey) >= 0)); nodeAccount.setAttribute('oncommand', - 'mozt.UIOptions.updateMailAccountsExcluded(mozt.UIOptions.accountBoxId)'); + 'firetray.UIOptions.updateMailAccountsExcluded(firetray.UIOptions.accountBoxId)'); targetNode.appendChild(nodeAccount); } @@ -59,9 +59,9 @@ mozt.UIOptions = { } LOG("accounts_to_exclude:"+prefValue); - mozt.Utils.prefService.setCharPref('accounts_to_exclude', prefValue.toString()); + firetray.Utils.prefService.setCharPref('accounts_to_exclude', prefValue.toString()); - mozt.Messaging.updateUnreadMsgCount(); + firetray.Messaging.updateUnreadMsgCount(); }, _disableGroup: function(group, disableval) { diff --git a/src/chrome/content/options.xul b/src/chrome/content/options.xul index c7afe08..c8a7c8d 100644 --- a/src/chrome/content/options.xul +++ b/src/chrome/content/options.xul @@ -1,10 +1,10 @@ - - + + onload="firetray.UIOptions.onLoad()">