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

Event dialog: fix content editor and attendees dialog #11

Merged
merged 32 commits into from
Jun 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0fb095f
calendar-event-dialog: fix overlay of event dialog
Trim May 30, 2017
9f44d1a
lightning-item-iframe: hidde by default Exchange task informations
Trim May 31, 2017
1edf79c
calendar-event-dialog.js: update documentation and orgnanize code
Trim May 31, 2017
242a611
calendar-event-dialog.xul: add DTD locales back
Trim May 31, 2017
09407d4
calendar-event-dialog: remove editAttendees overlay
Trim Jun 2, 2017
c4a4c18
calendar-event-dialog.js: coding style
Trim Jun 2, 2017
40b8e4f
exchWebServiceEditor: fix indentation
Trim Jun 2, 2017
7c87bc1
exchWebServiceEditor: coding style
Trim Jun 2, 2017
36950d2
calendar-event-dialog.js: always update screen on window load
Trim Jun 2, 2017
41eb28c
calendar-event-dialog.js: conding style on the content editor display…
Trim Jun 2, 2017
9f0aacb
Use directly editor innerHTML to get exceptions
Trim Jun 2, 2017
d179acf
add a tested html converter
Trim Jun 2, 2017
db5ff36
mivFunctions: fromText2HTML uses now standard DOM Parser and XML Seri…
Trim Jun 4, 2017
7a96087
calendar-event-dialog.js: stop erase Lightning window load, but let it
Trim Jun 4, 2017
e7b5f21
Revert "Use directly editor innerHTML to get exceptions"
Trim Jun 4, 2017
a49f5de
calendar-event-dialog.js: Copy content from HTML editor only when Exc…
Trim Jun 6, 2017
4b462ee
calendar-event-dialog.js: add EventListener in the bubbling phase ins…
Trim Jun 7, 2017
5a66f0a
calendar-event-dialog.js: remove code already contained in updateScre…
Trim Jun 7, 2017
371176e
global functions: fromText2HTML insert blank instead of "null"
Trim Jun 7, 2017
25e0cf9
exchWebServiceEditor: always parse content to HTML on external set
Trim Jun 7, 2017
60ea79d
calendar-event-dialog.js: remove HTML content guess as editor correct…
Trim Jun 7, 2017
4276b2b
lightning-item-iframe: load only relevant CSS to avoid modify display…
Trim Jun 8, 2017
a23964c
attachment-view.js: update toolbar default items to latest Ligthning
Trim Jun 7, 2017
8039656
Fix code formatting
advancingu Jun 7, 2017
0a7a806
attachments-view.css: update icon to use the new svg toolbar icons
Trim Jun 8, 2017
6ebc2bf
attachments-view.dtd: update fr-FR locale for the attachment button
Trim Jun 8, 2017
f0a9f24
calendar-event-dialog.js/xul/dtd: replace all calendar-event-dialog
Trim Jun 8, 2017
ac88056
attachment-view.xul: overlay correctly updates window menu and contex…
Trim Jun 8, 2017
fdce77e
calendar-event-dialog.xul/.js: create again these files to manage win…
Trim Jun 9, 2017
25dcd7b
event-dialog: modify scripts inside the iframe to be able to receive …
Trim Jun 9, 2017
c2889a9
attachment-view: remove all code which update window menu and toolbar
Trim Jun 9, 2017
2132ce9
attachments-view: fix context menu on attachment list
Trim Jun 9, 2017
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
4 changes: 4 additions & 0 deletions chrome.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ overlay chrome://calendar/content/calendar-calendars-list.xul chrome://exchangec
overlay chrome://messenger/content/messenger.xul chrome://exchangecalendar/content/progress_panel.xul
overlay chrome://calendar/content/calendar-task-view.xul chrome://exchangecalendar/content/messenger_task_delegation.xul
overlay chrome://lightning/content/lightning-standalone.xul chrome://exchangecalendar/content/progress_panel.xul

overlay chrome://calendar/content/calendar-event-dialog.xul chrome://exchangecalendar/content/calendar-event-dialog.xul
overlay chrome://lightning/content/lightning-item-iframe.xul chrome://exchangecalendar/content/lightning-item-iframe.xul

overlay chrome://calendar/content/calendar-event-dialog-reminder.xul chrome://exchangecalendar/content/calendar-event-dialog-reminder.xul
overlay chrome://calendar/content/calendar-summary-dialog.xul chrome://exchangecalendar/content/calendar-summary-dialog.xul
overlay chrome://calendar/content/calendar-properties-dialog.xul chrome://exchangecalendar/content/calendar-properties-dialog.xul

overlay chrome://messenger/content/messenger.xul chrome://exchangecalendar/content/sharedCalendarParser.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6}
overlay chrome://messenger/content/messenger.xul chrome://exchangecalendar/content/check4lightning.xul
overlay chrome://messenger/content/preferences/preferences.xul chrome://exchangecalendar/content/messenger-overlay-preferences.xul
Expand Down
71 changes: 51 additions & 20 deletions chrome/content/attachments-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function exchAttachments(aDocument, aWindow)
}

exchAttachments.prototype = {
_initialized: false,

addAttachmentDialog: function _addAttachmentDialog()
{
Expand Down Expand Up @@ -227,45 +228,75 @@ exchAttachments.prototype = {
}
},

/**
* Receives asynchronous messages from the parent context that contains the iframe.
*
* @param {MessageEvent} aEvent Contains the message being received
*/
receiveMessage: function _receiveMessage(aEvent) {
let validOrigin = gTabmail ? "chrome://messenger" : "chrome://calendar";
if (aEvent.origin !== validOrigin) {
return;
}
switch (aEvent.data.command) {
case "exchWebService_addAttachmentDialog": this.addAttachmentDialog(); break;
}
},

onLoad: function _onLoad()
{
if(this._initialized){
return;
}

var self = this;

if (this._document.getElementById("calendar-task-tree")) {
this.globalFunctions.LOG(" -- calendar-task-tree --");
var self = this;
this._document.getElementById("calendar-task-tree").addEventListener("select", function(){ self.onSelectTask();}, true);
return;
}
}

var args = this._window.arguments[0];
var item = args.calendarEvent;

//this.globalFunctions.LOG(" -- onLoad 2 ("+this.globalFunctions.STACKshort()+")");
this.attachmentListboxVisible = false;

// We can't update toolbar from iframe
if ((item.calendar) && (item.calendar.type == "exchangecalendar")) {
this.globalFunctions.LOG(" -- It is an Exchange Calendar event:"+item.title);


try {
// Hide Lightning URL button
this._document.getElementById("button-url").hidden = true;
this._document.getElementById("event-toolbar").setAttribute("currentset", "button-save,button-attendees,button-privacy,button-url,exchWebService-add-attachment-button,button-delete");
this._document.getElementById("exchWebService-add-attachment-button").hidden = false;
if(this._document.getElementById("options-attachments-menuitem")){
this._document.getElementById("options-attachments-menuitem").setAttribute("label", this._document.getElementById("exchWebService-add-attachment-button").getAttribute("label"));
this._document.getElementById("options-attachments-menuitem").setAttribute("command", "exchWebService_addAttachmentDialog");
}
if (this._document.getElementById("event-grid-attachment-row")) {
this._document.getElementById("event-grid-attachment-row").collapsed = true;
}
catch (ex) {this.globalFunctions.LOG(" -- Could not add exchange attachment buttons:"+ex.toString());}

// calendar-event-dialog (hide existing attachment view)
try {
this._document.getElementById("event-grid-attachment-row").setAttribute("collapsed", "true");
}
catch (ex) {}
// Modify context menu for the attachment list inside the "Attachment" panel
let attachmentListbox = this._document.getElementById("attachment-link");

attachmentListbox.context = "exchWebService-attachment-popup" ;
attachmentListbox.onkeypress = function (aEvent) { self.onKeyPress(aEvent); };
attachmentListbox.onclick = function (aEvent) { self.onSelect(aEvent); };
attachmentListbox.ondblclick = function (aEvent) { self.onDblClick(aEvent); };

this.addAttachmentsFromItem(item);
} else {
if (this._document.getElementById("event-grid-attachment-row")) {
this._document.getElementById("event-grid-attachment-row").collapsed = false;
}

// Modify context menu for the attachment list inside the "Attachment" panel
let attachmentListbox = this._document.getElementById("attachment-link");

attachmentListbox.context = "attachment-popup" ;
attachmentListbox.onkeypress="attachmentLinkKeyPress(event)" ;
attachmentListbox.onclick="attachmentClick(event);" ;
attachmentListbox.ondblclick="attachmentDblClick(event)" ;
}

// Add message listener to be able to receive message from parent window or tab
window.addEventListener("message", function(aEvent) { self.receiveMessage(aEvent); }, false);

this._initialized = true;
},

addAttachmentsFromItem: function _addAttachmentsFromItem(aItem)
Expand Down Expand Up @@ -584,6 +615,6 @@ exchAttachments.prototype = {
}

var tmpAttachment = new exchAttachments(document, window);
window.addEventListener("load", function _onLoad() { window.removeEventListener("load",arguments.callee,false); tmpAttachment.onLoad(); }, true);
window.addEventListener("load", function _onLoad() { tmpAttachment.onLoad(); }, false);


32 changes: 7 additions & 25 deletions chrome/content/attachments-view.xul
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,19 @@
<overlay id="exchWebService-attachment-view"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script type="application/javascript" src="chrome://exchangecalendar/content/attachments-view.js"/>
<script type="application/javascript" src="chrome://exchangecalendar/content/attachments-view.js"/>

<!-- Commands -->
<commandset id="itemCommands">
<commandset>
<command id="exchWebService_openAttachment"
oncommand="tmpAttachment.openAttachment();"/>
oncommand="tmpAttachment.openAttachment();"/>
<command id="exchWebService_saveAttachment"
oncommand="tmpAttachment.saveAttachment();"/>
oncommand="tmpAttachment.saveAttachment();"/>
<command id="exchWebService_deleteAttachment"
oncommand="tmpAttachment.deleteAttachment();"/>
<command id="exchWebService_addAttachmentDialog"
oncommand="tmpAttachment.addAttachmentDialog();"/>
oncommand="tmpAttachment.deleteAttachment();"/>
</commandset>

<!-- Update context popup-->
<popupset id="event-dialog-popupset">
<menupopup id="exchWebService-attachment-popup">
<menuitem id="exchWebService-attachment-popup-open"
Expand All @@ -74,26 +73,9 @@
<menuitem id="exchWebService-attachment-popup-delete"
label="&event.menu.item.delete.label;"
accesskey="&event.menu.item.delete.accesskey;"
disable-on-readonly="true"
disable-on-readonly="true"
command="exchWebService_deleteAttachment"/>
</menupopup>
</popupset>

<toolbarpalette id="event-toolbarpalette">
<toolbarbutton id="exchWebService-add-attachment-button"
mode="dialog"
class="cal-event-toolbarbutton toolbarbutton-1"
label="&exchWebServie.add.attachment.button.label;"
disable-on-readonly="true"
removable="true"
command="exchWebService_addAttachmentDialog"
oncommand="tmpAttachment.addAttachmentDialog();"
hidden="true"/>
</toolbarpalette>
<toolbar id="event-toolbar" defaultset="button-save,button-attendees,button-privacy,button-url,exchWebService-add-attachment-button,button-delete">
</toolbar>


</overlay>


Loading