Monotone-Parent: 20842c7bedd067f662544c3f0ea6480a9e8bfef3

Monotone-Revision: 5aaf09a46fc504e57187524d01cb8ccb8d9c8e1e

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-08-15T01:48:07
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2008-08-15 01:48:07 +00:00
parent 802d45fd69
commit 128d5bb3ea
2 changed files with 32 additions and 8 deletions

View File

@@ -22,7 +22,8 @@ var Mailer = {
currentMessages: {},
maxCachedMessages: 20,
cachedMessages: new Array(),
foldersStateTimer: false
foldersStateTimer: false,
popups: new Array()
};
var usersRightsWindowHeight = 320;
@@ -39,11 +40,13 @@ var messageCheckTimer;
function openMessageWindow(msguid, url) {
var wId = '';
if (msguid) {
wId += "SOGo_msg_" + msguid;
wId += "SOGo_msg" + msguid;
markMailReadInWindow(window, msguid);
}
var msgWin = openMailComposeWindow(url, wId);
msgWin.messageUID = msguid;
msgWin.focus();
Mailer.popups.push(msgWin);
return false;
}
@@ -149,7 +152,7 @@ function openMessageWindowsForSelection(action, firstOnly) {
var rows = messageList.getSelectedRowsId();
if (rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
openMessageWindow(rows[i].substr(4),
openMessageWindow(Mailer.currentMailbox + "/" + rows[i].substr(4),
ApplicationBaseURL + Mailer.currentMailbox
+ "/" + rows[i].substr(4)
+ "/" + action);
@@ -823,9 +826,10 @@ function onICalendarButtonClick(event) {
var link = $("iCalendarAttachment").value;
if (link) {
var urlstr = link + "/" + this.action;
triggerAjaxRequest(urlstr, ICalendarButtonCallback,
Mailer.currentMailbox + "/"
+ Mailer.currentMessages[Mailer.currentMailbox]);
var currentMsg;
currentMsg = Mailer.currentMailbox + "/"
+ Mailer.currentMessages[Mailer.currentMailbox];
triggerAjaxRequest(urlstr, ICalendarButtonCallback, currentMsg);
}
else
log("no link");
@@ -835,10 +839,15 @@ function ICalendarButtonCallback(http) {
if (isHttpStatus204(http.status)) {
var oldMsg = http.callbackData;
var msg = Mailer.currentMailbox + "/" + Mailer.currentMessages[Mailer.currentMailbox];
deleteCachedMessage(oldMsg);
if (oldMsg == msg) {
deleteCachedMessage(oldMsg);
loadMessage(Mailer.currentMessages[Mailer.currentMailbox]);
}
for (var i = 0; i < Mailer.popups.length; i++)
if (Mailer.popups[i].messageUID == oldMsg) {
Mailer.popups[i].location.reload();
break;
}
}
else
window.alert("received code: " + http.status);

View File

@@ -9,8 +9,23 @@ function initPopupMailer(event) {
resizeMailContent();
}
function onMenuDeleteMessage(event) {
function onICalendarButtonClick(event) {
var link = $("iCalendarAttachment").value;
if (link) {
var urlstr = link + "/" + this.action;
var currentMsg;
if (window.opener && window.opener.open && !window.opener.closed && window.messageUID) {
var c = window.opener;
window.opener.triggerAjaxRequest(urlstr,
window.opener.ICalendarButtonCallback,
window.messageUID);
}
}
else
log("no link");
}
function onMenuDeleteMessage(event) {
if (window.opener && window.opener.open && !window.opener.closed) {
var rowId = window.name.substr(9);
var messageId = window.opener.Mailer.currentMailbox + "/" + rowId;