Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit 6091ec3

Browse files
committed
Merge branch 'ec-4.0' of github.com:ExchangeCalendar/exchangecalendar into ec-4.0
2 parents 40a3415 + 4d9dc00 commit 6091ec3

7 files changed

+193
-144
lines changed

chrome.manifest

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ locale exchangecalendar de locale/exchangecalendar/de/
5050
locale exchangecalendar ja-JP locale/exchangecalendar/ja-JP/
5151
locale exchangecalendar sv locale/exchangecalendar/sv/
5252
locale exchangecalendar ru locale/exchangecalendar/ru/
53+
locale exchangecalendar it-IT locale/exchangecalendar/it-IT/
54+
locale exchangecalendar tr locale/exchangecalendar/tr/
5355

5456
manifest interfaces/exchangeCalendar/mivExchangeCalendar.manifest
5557

chrome/content/exchWebServiceEditor.xml

+56-35
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@
3636
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
3737
<binding id="exchWebServiceEditor">
3838

39-
<content>
39+
<!-- CSS needed to correctly display color buttons (font and background) -->
40+
<resources>
41+
<stylesheet src="chrome://messenger/skin/messengercompose/messengercompose.css" />
42+
</resources>
43+
44+
<content>
4045

4146
<xul:vbox flex="1">
4247
<xul:toolbox anonid="FormatToolbox" mode="icons">
@@ -105,7 +110,7 @@
105110
state="state_all"/>
106111
<xul:toolbarseparator class="toolbarseparator-standard"/>
107112
<xul:toolbaritem class="formatting-button">
108-
<xul:stack align="enter" state="rgb(102,102,102)">
113+
<xul:stack align="center" state="rgb(102,102,102)">
109114
<xul:box style="background-color:#FFFFFF"
110115
anonid="cmd_backgroundColor"
111116
class="color-button"
@@ -192,89 +197,105 @@
192197
flex="1"/>
193198
</xul:vbox>
194199

195-
</content>
200+
</content>
196201
<implementation>
197202
<constructor><![CDATA[
198-
this.editorElement = document.getAnonymousElementByAttribute(this, "anonid", "editor");
199203
var self=this;
204+
205+
// To be able to set correct HTML content
206+
this.globalFunctions = Components.classes["@1st-setup.nl/global/functions;1"]
207+
.getService(Components.interfaces.mivFunctions);
208+
209+
this.editorElement = document.getAnonymousElementByAttribute(this, "anonid", "editor");
200210
if (this.editorElement) {
201211
this.commandManager = this.editorElement.commandManager;
202212
this.editorClickFunction = function(aEvent) { self.onClickEditor(aEvent);};
203-
this.editorElement.addEventListener("click", this.editorClickFunction, true);
213+
this.editorElement.addEventListener("click", this.editorClickFunction, false);
204214
205215
this.editorDblClickFunction = function(aEvent) { self.onDblClickEditor(aEvent);};
206-
this.editorElement.addEventListener("dblclick", this.editorDblClickFunction, true);
216+
this.editorElement.addEventListener("dblclick", this.editorDblClickFunction, false);
207217
208218
this.editorKeyPressFunction = function(aEvent) { self.onKeyPressEditor(aEvent);};
209-
this.editorElement.addEventListener("keyup", this.editorKeyPressFunction, true);
219+
this.editorElement.addEventListener("keyup", this.editorKeyPressFunction, false);
210220
211221
this.editorMouseOver = function(aEvent) { self.onMouseOver(aEvent);};
212-
this.editorMouseOut = function(aEvent) { self.onMouseOut(aEvent);};
213-
214222
this.editorElement.addEventListener("mouseover", this.editorMouseOver , false);
223+
224+
this.editorMouseOut = function(aEvent) { self.onMouseOut(aEvent);};
215225
this.editorElement.addEventListener("mouseout", this.editorMouseOut, false);
216226
227+
// Set default document to empty HTML content
228+
this.editorElement.contentDocument.documentElement.innerHTML = this.globalFunctions.fromText2HTML(null);
217229
}
218230
219231
this.atomService = Components.classes["@mozilla.org/atom-service;1"]
220232
.getService(Components.interfaces.nsIAtomService);
221233
222-
// Set initial content to empty HTML body
223-
this.globalFunctions = Components.classes["@1st-setup.nl/global/functions;1"]
224-
.getService(Components.interfaces.mivFunctions);
225-
this.editorElement.contentDocument.documentElement.innerHTML = this.globalFunctions.fromText2HTML(null);
234+
this.connectAllCommandListenerToolbar("FormatToolbar");
226235
227-
this.connectButtons("FormatToolbar");
228236
// Connect color button
229237
this.bgColorFunction = function(){ self.selectColor("cmd_backgroundColor");};
230238
var bgColorElement = document.getAnonymousElementByAttribute(this, "anonid", "cmd_backgroundColor")
231-
bgColorElement.addEventListener("click", this.bgColorFunction, true);
239+
bgColorElement.addEventListener("click", this.bgColorFunction, false);
232240
233241
this.fontColorFunction = function(){ self.selectColor("cmd_fontColor");};
234242
var fontColorElement = document.getAnonymousElementByAttribute(this, "anonid", "cmd_fontColor")
235-
fontColorElement.addEventListener("click", this.fontColorFunction, true);
243+
fontColorElement.addEventListener("click", this.fontColorFunction, false);
236244
237245
this.highlightColor = "#FFFFFF";
238246
this.fontColor = "#000000";
239247
240-
// Fill fontfac popup menu
248+
// Connect FontFace popup menu
241249
this.menuPopupFunction = function(event){ self.selectFont("cmd_fontFace", event.target.value);};
242250
this.menuPopup = document.getAnonymousElementByAttribute(this, "anonid", "fontFaceSelect");
243-
this.menuPopup.addEventListener("command", this.menuPopupFunction, true);
251+
this.menuPopup.addEventListener("command", this.menuPopupFunction, false);
244252
this.fillFontFace();
245253
254+
// Connect HyperLink buttons
246255
this.addLinkFunction = function(){ self.addLink();};
247256
var addLinkElement = document.getAnonymousElementByAttribute(this, "anonid", "cmd_add_link")
248-
addLinkElement.addEventListener("click", this.addLinkFunction, true);
257+
addLinkElement.addEventListener("click", this.addLinkFunction, false);
249258
250259
this.removeLinkFunction = function(){ self.removeLink();};
251260
var removeLinkElement = document.getAnonymousElementByAttribute(this, "anonid", "cmd_remove_link")
252-
removeLinkElement.addEventListener("click", this.removeLinkFunction, true);
261+
removeLinkElement.addEventListener("click", this.removeLinkFunction, false);
253262
254263
this.editLinkFunction = function(){ self.editLink();};
255264
var editLinkElement = document.getAnonymousElementByAttribute(this, "anonid", "cmd_edit_link")
256-
editLinkElement.addEventListener("click", this.editLinkFunction, true);
265+
editLinkElement.addEventListener("click", this.editLinkFunction, false);
257266
]]></constructor>
258267

259268
<destructor><![CDATA[
260269
if (this.editorElement) {
261270
this.editorElement.removeEventListener("click", this.editorClickFunction, false);
262271
this.editorElement.removeEventListener("keyup", this.editorKeyPressFunction, false);
263272
264-
this.editorElement.removeEventListener("dblclick", this.editorDblClickFunction, true);
273+
this.editorElement.removeEventListener("dblclick", this.editorDblClickFunction, false);
265274
266275
this.editorElement.removeEventListener("mouseover", this.editorMouseOver , false);
267276
this.editorElement.removeEventListener("mouseout", this.editorMouseOut, false);
268277
}
269-
this.disconnectButtons("FormatToolbar");
270-
document.getAnonymousElementByAttribute(this, "anonid", "cmd_backgroundColor").removeEventListener("click", this.bgColorFunction, false);
271-
document.getAnonymousElementByAttribute(this, "anonid", "cmd_fontColor").removeEventListener("click", this.fontColorFunction, false);
278+
279+
this.removeAllCommandListenerToolbar("FormatToolbar");
280+
281+
// Disconnect color button
282+
document.getAnonymousElementByAttribute(this, "anonid", "cmd_backgroundColor")
283+
.removeEventListener("click", this.bgColorFunction, false);
284+
document.getAnonymousElementByAttribute(this, "anonid", "cmd_fontColor")
285+
.removeEventListener("click", this.fontColorFunction, false);
286+
287+
// Disconnect Font face button
272288
if (this.menuPopupFunction) {
273289
this.menuPopup.removeEventListener("command", this.menuPopupFunction, false);
274290
}
275-
document.getAnonymousElementByAttribute(this, "anonid", "cmd_add_link").removeEventListener("click", this.addLinkFunction, true);
276-
document.getAnonymousElementByAttribute(this, "anonid", "cmd_remove_link").removeEventListener("click", this.removeLinkFunction, true);
277-
document.getAnonymousElementByAttribute(this, "anonid", "cmd_edit_link").removeEventListener("click", this.editLinkFunction, true);
291+
292+
// Disconnect HyperLink buttons
293+
document.getAnonymousElementByAttribute(this, "anonid", "cmd_add_link")
294+
.removeEventListener("click", this.addLinkFunction, false);
295+
document.getAnonymousElementByAttribute(this, "anonid", "cmd_remove_link")
296+
.removeEventListener("click", this.removeLinkFunction, false);
297+
document.getAnonymousElementByAttribute(this, "anonid", "cmd_edit_link")
298+
.removeEventListener("click", this.editLinkFunction, false);
278299
]]></destructor>
279300

280301
<property name="content">
@@ -328,7 +349,7 @@
328349
]]></body>
329350
</method>
330351

331-
<method name="connectButtons">
352+
<method name="connectAllCommandListenerToolbar">
332353
<parameter name="aAnonId" />
333354
<body><![CDATA[
334355
var toolbar = document.getAnonymousElementByAttribute(this, "anonid", aAnonId);
@@ -341,14 +362,14 @@
341362
var toolbarButtons = toolbar.getElementsByTagName("xul:toolbarbutton");
342363
for (var i=0; i<toolbarButtons.length;i++) {
343364
if ((toolbarButtons[i].hasAttribute("connect")) && (toolbarButtons[i].getAttribute("connect") === "true")) {
344-
this.connectButton(toolbarButtons[i].getAttribute("anonid"), aAnonId);
365+
this.addCommandListener(toolbarButtons[i].getAttribute("anonid"), aAnonId);
345366
}
346367
}
347368
}
348369
]]></body>
349370
</method>
350371

351-
<method name="connectButton">
372+
<method name="addCommandListener">
352373
<parameter name="aAnonId" />
353374
<parameter name="aStore" />
354375
<body><![CDATA[
@@ -358,22 +379,22 @@
358379
this.functions[aStore] = {};
359380
}
360381
this.functions[aStore][aAnonId] = function() { self.toggleButton(aAnonId);};
361-
document.getAnonymousElementByAttribute(this, "anonid", aAnonId).addEventListener("command", this.functions[aStore][aAnonId], true);
382+
document.getAnonymousElementByAttribute(this, "anonid", aAnonId).addEventListener("command", this.functions[aStore][aAnonId], false);
362383
]]></body>
363384
</method>
364385

365-
<method name="disconnectButtons">
386+
<method name="removeAllCommandListenerToolbar">
366387
<parameter name="aAnonId" />
367388
<body><![CDATA[
368389
if ((this.functions) && (this.functions[aAnonId])) {
369390
for (var name in this.functions[aAnonId]) {
370-
this.disconnectButton(name, aAnonId);
391+
this.removeCommandListener(name, aAnonId);
371392
}
372393
}
373394
]]></body>
374395
</method>
375396

376-
<method name="disconnectButton">
397+
<method name="removeCommandListener">
377398
<parameter name="aAnonId" />
378399
<parameter name="aStore" />
379400
<body><![CDATA[

chrome/content/exchangeSettingsOverlay.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ exchSettingsOverlay.prototype = {
431431
{
432432
this.globalFunctions.LOG("exchWebServicesGetFolderOK: aFolderID:"+aFolderID+", aChangeKey:"+aChangeKey+", aFolderClass:"+aFolderClass);
433433

434-
if (aFolderClass == "IPF.Appointment") {
434+
if (aFolderClass == "IPF.Appointment" || aFolderClass == "IPF.Task") {
435435
this.exchWebServicesgFolderID = aFolderID;
436436
this.exchWebServicesgChangeKey = aChangeKey;
437437
this.gexchWebServicesDetailsChecked = true;

0 commit comments

Comments
 (0)