Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First step to TB60+ compatibility. #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Components.utils.import("resource://replymanager/modules/replyManagerUtils.jsm");
Components.utils.import("resource://replymanager/modules/calUtils.jsm");
Components.utils.import("resource:///modules/gloda/indexer.js");
Components.utils.import("resource://gre/modules/Preferences.jsm");
var { replyManagerUtils } = ChromeUtils.import("resource://replymanager/modules/replyManagerUtils.jsm");
var { calUtils } = ChromeUtils.import("resource://replymanager/modules/calUtils.jsm");
var { indexer } = ChromeUtils.import("resource:///modules/gloda/indexer.js");
var { Preferences } = ChromeUtils.import("resource://gre/modules/Preferences.jsm");

function onLoad() {
// We need both ReplyManager and Gloda indexer enabled to make this feature work.
Expand Down Expand Up @@ -75,7 +75,7 @@ replyManagerComposeStateListener.prototype = {
NotifyComposeBodyReady: function() {},

ComposeProcessDone: function(aResult) {
let folder = MailUtils.getFolderForURI(gMsgCompose.savedFolderURI);
let folder = MailUtils.getExistingFolder(gMsgCompose.savedFolderURI);
let msgDB = folder.msgDatabase;
let savedMsgHdr = msgDB.getMsgHdrForMessageID(this.msgID);
let toggle = document.getElementById("other-elements-toggle").checked;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://replymanager/skin/replyManager.css"?>
<?xml-stylesheet href="chrome://calendar/content/widgets/calendar-widget-bindings.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/content/datetimepickers/datetimepickers.css" type="text/css"?>
<?xml-stylesheet type="text/css" href="chrome://replymanager/skin/replyManager.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/content/widgets/calendar-widget-bindings.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/content/datetimepickers/datetimepickers.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar-common/skin/widgets/minimonth.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/content/widgets/calendar-widget-bindings.css"?>
<?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?>
<!DOCTYPE window [
<!ENTITY % replyManagerDTD SYSTEM "chrome://replymanager/locale/replyManager.dtd">
%replyManagerDTD;
Expand All @@ -16,6 +19,8 @@
<script type="application/javascript" src="chrome://replymanager/content/replyManagerComposeOverlay.js"/>
<script type="application/javascript" src="chrome://calendar/content/calendar-ui-utils.js"/>
<script type="application/javascript" src="chrome://calendar/content/calUtils.js"/>
<script src="chrome://messenger/content/customElements.js"/>
<script src="chrome://calendar/content/datetimepickers/datetimepickers.js"/>

<commandset>
<command id="cmd_toggle_other_replymanager_elements" oncommand="toggleOtherReplyManagerElements();"/>
Expand All @@ -28,7 +33,7 @@
<checkbox id="other-elements-toggle" label="&other-elements-toggle.label;" checked="false"
command="cmd_toggle_other_replymanager_elements"
class="expectReplyUnchecked"/>
<datepicker id="reminder-date" disabled="true"/>
<datetimepicker id="reminder-date" disabled="true"/>
</hbox>
</toolbox>
</overlay>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

Components.utils.import("resource://replymanager/modules/replyManagerUtils.jsm");
var { replyManagerUtils } = ChromeUtils.import("resource://replymanager/modules/replyManagerUtils.jsm");

/**
* If the message is expecting replies we need to set the datepicker
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?xml version="1.0"?>
<!--
TODO:
https://developer.thunderbird.net/add-ons/tb68/changes#less-than-dialog-greater-than-events-->
<!-- This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this file,
You can obtain one at http://mozilla.org/MPL/2.0/.-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
Components.utils.import("resource://replymanager/modules/replyManagerUtils.jsm");
Components.utils.import("resource://replymanager/modules/replyManagerCalendar.jsm");
Components.utils.import("resource://replymanager/modules/calUtils.jsm");
Components.utils.import("resource:///modules/gloda/public.js");
Components.utils.import("resource:///modules/gloda/indexer.js");
Components.utils.import("resource:///modules/mailServices.js");
Components.utils.import("resource:///modules/Services.jsm");
Components.utils.import("resource://gre/modules/Preferences.jsm");
var { replyManagerUtils } = ChromeUtils.import("resource://replymanager/modules/replyManagerUtils.jsm");
var { replyManagerCalendar } = ChromeUtils.import("resource://replymanager/modules/replyManagerCalendar.jsm");
var { calUtils } = ChromeUtils.import("resource://replymanager/modules/calUtils.jsm");
//var { public } = ChromeUtils.import("resource:///modules/gloda/public.js");
var { indexer } = ChromeUtils.import("resource:///modules/gloda/indexer.js");
var { mailServices } = ChromeUtils.import("resource:///modules/mailServices.js");
var { Services } = ChromeUtils.import("resource:///modules/Services.jsm");
var { Preferences } = ChromeUtils.import("resource://gre/modules/Preferences.jsm");

function onLoad() {
let replyManagerMenu = document.getElementById("replyManagerMailContextMenu");
Expand Down Expand Up @@ -210,8 +210,11 @@ var replyManagerMailListener = {
msgsDeleted: function(aItems) {
let mailEnumerator = aItems.enumerate();
while (mailEnumerator.hasMoreElements()) {
let msg = mailEnumerator.getNext()
.QueryInterface(Components.interfaces.nsIMsgDBHdr);
let msg = mailEnumerator.getNext();
try {
msg = msg.QueryInterface(Components.interfaces.nsIMsgDBHdr);
}
catch(x) {}
if (msg instanceof Components.interfaces.nsIMsgDBHdr &&
ReplyManagerUtils.isHdrExpectReply(msg)) {
ReplyManagerUtils.resetExpectReplyForHdr(msg);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
Components.utils.import("resource://replymanager/modules/replyManagerUtils.jsm");
Components.utils.import("resource://replymanager/modules/calUtils.jsm");
Components.utils.import("resource:///modules/StringBundle.js");
Components.utils.import("resource:///modules/Services.jsm");
Components.utils.import("resource:///modules/gloda/indexer.js");
Components.utils.import("resource://gre/modules/Preferences.jsm");
var { replyManagerUtils } = ChromeUtils.import("resource://replymanager/modules/replyManagerUtils.jsm");
var { calUtils } = ChromeUtils.import("resource://replymanager/modules/calUtils.jsm");
var { StringBundle } = ChromeUtils.import("resource:///modules/StringBundle.js");
var { Services } = ChromeUtils.import("resource:///modules/Services.jsm");
var { indexer } = ChromeUtils.import("resource:///modules/gloda/indexer.js");
var { Preferences } = ChromeUtils.import("resource://gre/modules/Preferences.jsm");

var replyManagerHdrViewListener = {
displayedMessage: null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/**
* TODO:
* https://developer.thunderbird.net/add-ons/tb68/changes#less-than-prefwindow-greater-than-less-than-prefpane-greater-than-less-than-preferences-greater-than-and-less-than-preference-greater-than
*/
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
Components.utils.import("resource://replymanager/modules/replyManagerUtils.jsm");
var { replyManagerUtils } = ChromeUtils.import("resource://replymanager/modules/replyManagerUtils.jsm");

/**
* Global Object to hold methods for the Reply Manager pref pane
Expand Down
72 changes: 33 additions & 39 deletions replymonitor@lin.han/chrome/content/replyManagerPreferences.xul
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,20 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://replymanager/skin/replyManager.css"?>
<!DOCTYPE window SYSTEM "chrome://replymanager/locale/replyManager.dtd">

<prefwindow id="ReplyManagerPaneOverlay"
title="Reply Monitor Preferences"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="ReplyManagerPrefPane"
label="Reply Monitor Options">
<vbox id="calPreferencesBoxReplyManager" class="replyManagerPrefpaneBox">
<script type="application/javascript"
src="chrome://replymanager/content/replyManagerPreferences.js"/>
<preferences>
<preference id="extensions.replymanager.enabled"
name="extensions.replymanager.enabled"
type="bool"
onchange="gReplyManagerPane.toggleReplyManagerEnabled();"/>
<preference id="extensions.replymanager.create_calendar_event_enabled"
name="extensions.replymanager.create_calendar_event_enabled"
type="bool"/>
<preference id="extensions.replymanager.boilerplate"
name="extensions.replymanager.boilerplate"
type="string"/>
<preference id="extensions.replymanager.includecc"
name="extensions.replymanager.includecc"
type="bool"
onchange="gReplyManagerPane.CcBccChanged();"/>
<preference id="extensions.replymanager.includebcc"
name="extensions.replymanager.includebcc"
type="bool"
onchange="gReplyManagerPane.CcBccChanged();"/>
</preferences>
<?xml-stylesheet type="text/css" href="chrome://global/skin/"?>
<?xml-stylesheet type="text/css" href="chrome://messenger/skin/messenger.css"?>
<?xml-stylesheet type="text/css" href="chrome://replymanager/skin/replyManager.css"?>
<!DOCTYPE dialog SYSTEM "chrome://replymanager/locale/replyManager.dtd">

<dialog
id="ReplyManagerPaneOverlay"
buttons="accept"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<vbox
id="calPreferencesBoxReplyManager"
class="replyManagerPrefpaneBox">

<checkbox id="enableReplyManagerCheckbox"
label="&enableReplyManagerGroupbox.label;"
Expand All @@ -52,11 +33,24 @@
label="&toggleReplyManagerIncludeBCC.label;"
preference="extensions.replymanager.includebcc"/>

<caption label="&prefReplyManagerBoilerplate.label;"/>
<textbox id="reminderBoilerplateTextbox" multiline="true"
newlines="pasteintact" flex="1"
height="300"
preference="extensions.replymanager.boilerplate"/>
<groupbox>
<hbox class="groupbox-title">
<label class="header">&prefReplyManagerBoilerplate.label;</label>
</hbox>
<html:textarea
id="reminderBoilerplateTextbox"
newlines="pasteintact" flex="1"
height="300"
preference="extensions.replymanager.boilerplate"/>
</groupbox>

</vbox>
</prefpane>
</prefwindow>

<script
src="chrome://global/content/preferencesBindings.js"
type="application/javascript"/>
<script
type="application/javascript"
src="chrome://replymanager/content/replyManagerPreferences.js"/>
</dialog>

Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?xml version="1.0"?>
<!--
TODO:
https://developer.thunderbird.net/add-ons/tb68/changes#less-than-dialog-greater-than-events-->
<!-- This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this file,
You can obtain one at http://mozilla.org/MPL/2.0/.-->
Expand Down
2 changes: 1 addition & 1 deletion replymonitor@lin.han/defaults/preferences/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pref("extensions.replymanager.create_calendar_event_enabled", true);
pref("extensions.replymanager.boilerplate", "");
pref("extensions.replymanager.lightning_installed", false);
pref("extensions.replymanager.includecc", true);
pref("extensions.replymanager.includebcc", true);
pref("extensions.replymanager.includebcc", true);
2 changes: 1 addition & 1 deletion replymonitor@lin.han/install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<!-- Thunderbird -->
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
<em:minVersion>38.*</em:minVersion>
<em:maxVersion>52.*</em:maxVersion>
<em:maxVersion>60.*</em:maxVersion>
</Description>
</em:targetApplication>

Expand Down
19 changes: 19 additions & 0 deletions replymonitor@lin.han/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"manifest_version": 2,
"applications": {
"gecko": {
"id": "replymonitor@lin.han",
"strict_min_version": "68.0"
}
},
"name": "Reply Monitor",
"description": "Keep track of your emails and replies",
"version": "2.0.0",

"legacy": {
"type": "xul",
"options": {
"page": "chrome://replymanager/content/replyManagerPreferences.xul",
}
}
}
16 changes: 8 additions & 8 deletions replymonitor@lin.han/modules/replyManagerCalendar.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

let EXPORTED_SYMBOLS = ["ReplyManagerCalendar"];

const Cu = Components.utils;
//const Cu = Components.utils;
const Cc = Components.classes;
const Ci = Components.interfaces;
const ReplyManager = "ReplyManager";

Cu.import("resource://gre/modules/errUtils.js");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource:///modules/gloda/public.js");
Cu.import("resource:///modules/gloda/index_msg.js");
Cu.import("resource:///modules/StringBundle.js");
Cu.import("resource://gre/modules/Preferences.jsm");
var { errUtils } = ChromeUtils.import("resource://gre/modules/errUtils.js");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
//var { public } = ChromeUtils.import("resource:///modules/gloda/public.js");
var { index_msg } = ChromeUtils.import("resource:///modules/gloda/index_msg.js");
var { StringBundle } = ChromeUtils.import("resource:///modules/StringBundle.js");
var { Preferences } = ChromeUtils.import("resource://gre/modules/Preferences.jsm");

/**
* ReplyManagerCalendar
Expand All @@ -29,7 +29,7 @@ let ReplyManagerCalendar = {
initCalendar: function()
{
try {
Cu.import("resource://calendar/modules/calUtils.jsm");
var { calUtils } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
} catch(e) {
// If Lightning is not installed, disable the feature
this.disableReplyManager();
Expand Down
16 changes: 8 additions & 8 deletions replymonitor@lin.han/modules/replyManagerUtils.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

let EXPORTED_SYMBOLS = ["ReplyManagerUtils"];

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

const consoleService = Cc["@mozilla.org/consoleservice;1"]
.getService(Ci.nsIConsoleService);

Cu.import("resource:///modules/gloda/public.js");
Cu.import("resource://replymanager/modules/replyManagerCalendar.jsm");
Cu.import("resource:///modules/mailServices.js");
Cu.import("resource:///modules/gloda/index_msg.js");
Cu.import("resource:///modules/StringBundle.js");
Cu.import("resource://gre/modules/Preferences.jsm");
//var { public } = ChromeUtils.import("resource:///modules/gloda/public.js");
var { replyManagerCalendar } = ChromeUtils.import("resource://replymanager/modules/replyManagerCalendar.jsm");
var { mailServices } = ChromeUtils.import("resource:///modules/mailServices.js");
var { index_msg } = ChromeUtils.import("resource:///modules/gloda/index_msg.js");
var { StringBundle } = ChromeUtils.import("resource:///modules/StringBundle.js");
var {Preferences } = ChromeUtils.import("resource://gre/modules/Preferences.jsm");
try {
Cu.import("resource://calendar/modules/calUtils.jsm");
var { calUtils } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
} catch(e) {
consoleService.logStringMessage('Lightning not installed');
}
Expand Down