From ad719d40377917ba3d39195510cd636366234b92 Mon Sep 17 00:00:00 2001 From: helge Date: Sun, 13 Feb 2005 00:39:39 +0000 Subject: [PATCH] implemented bulk reply/forward git-svn-id: http://svn.opengroupware.org/SOGo/trunk@550 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/UI/Mailer/ChangeLog | 5 ++ SOGo/UI/Mailer/UIxMailEditor.m | 2 + SOGo/UI/Mailer/UIxMailEditorAction.m | 2 +- SOGo/UI/Mailer/UIxMailListView.wox | 15 ++--- SOGo/UI/Mailer/UIxSieveEditor.m | 2 + SOGo/UI/Mailer/Version | 2 +- SOGo/UI/Mailer/mailer.js | 86 ++++++++++++++++++++++++++-- SOGo/UI/Mailer/product.plist | 8 ++- 8 files changed, 101 insertions(+), 21 deletions(-) diff --git a/SOGo/UI/Mailer/ChangeLog b/SOGo/UI/Mailer/ChangeLog index 1219022f..092e698c 100644 --- a/SOGo/UI/Mailer/ChangeLog +++ b/SOGo/UI/Mailer/ChangeLog @@ -1,3 +1,8 @@ +2005-02-13 Helge Hess + + * product.plist, UIxMailListView.wox, mailer.js: added bulk + reply/replyall/forward (v0.9.102) + 2005-02-12 Helge Hess * UIxMailMainFrame.m: fixed page form processing if the active URL diff --git a/SOGo/UI/Mailer/UIxMailEditor.m b/SOGo/UI/Mailer/UIxMailEditor.m index 89dbeacd..571bb62c 100644 --- a/SOGo/UI/Mailer/UIxMailEditor.m +++ b/SOGo/UI/Mailer/UIxMailEditor.m @@ -275,8 +275,10 @@ static NSArray *infoKeys = nil; } - (id)editAction { +#if 0 [self logWithFormat:@"edit action, load content from: %@", [self clientObject]]; +#endif [self loadInfo:[[self clientObject] fetchInfo]]; return self; diff --git a/SOGo/UI/Mailer/UIxMailEditorAction.m b/SOGo/UI/Mailer/UIxMailEditorAction.m index 9cc8f2a0..5d1c7470 100644 --- a/SOGo/UI/Mailer/UIxMailEditorAction.m +++ b/SOGo/UI/Mailer/UIxMailEditorAction.m @@ -129,7 +129,7 @@ } ASSIGN(self->newDraft, tmp); - [self logWithFormat:@"NEW DRAFT: %@", self->newDraft]; + //[self debugWithFormat:@"NEW DRAFT: %@", self->newDraft]; return nil; } diff --git a/SOGo/UI/Mailer/UIxMailListView.wox b/SOGo/UI/Mailer/UIxMailListView.wox index a4e87025..16abefd0 100644 --- a/SOGo/UI/Mailer/UIxMailListView.wox +++ b/SOGo/UI/Mailer/UIxMailListView.wox @@ -101,20 +101,15 @@ - + +
- + diff --git a/SOGo/UI/Mailer/UIxSieveEditor.m b/SOGo/UI/Mailer/UIxSieveEditor.m index ddd8ca9e..d50fa412 100644 --- a/SOGo/UI/Mailer/UIxSieveEditor.m +++ b/SOGo/UI/Mailer/UIxSieveEditor.m @@ -81,8 +81,10 @@ } - (id)editAction { +#if 0 [self logWithFormat:@"edit action, load content from: %@", [self clientObject]]; +#endif [self setScriptName:[[self clientObject] nameInContainer]]; [self setScriptText:[[self clientObject] contentAsString]]; diff --git a/SOGo/UI/Mailer/Version b/SOGo/UI/Mailer/Version index 529aca4c..ceaa66e5 100644 --- a/SOGo/UI/Mailer/Version +++ b/SOGo/UI/Mailer/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=101 +SUBMINOR_VERSION:=102 # v0.9.100 requires libNGMime v4.5.213 # v0.9.99 requires libNGMime v4.5.212 diff --git a/SOGo/UI/Mailer/mailer.js b/SOGo/UI/Mailer/mailer.js index 2163872f..a01927a9 100644 --- a/SOGo/UI/Mailer/mailer.js +++ b/SOGo/UI/Mailer/mailer.js @@ -15,13 +15,15 @@ /* mail list */ +function openMessageWindow(sender, msguid, url) { + return window.open(url, "SOGo_msg_" + msguid, + "width=640,height=480,resizable=1,scrollbars=1,toolbar=0," + + "location=0,directories=0,status=0,menubar=0,copyhistory=0") +} + function clickedUid(sender, msguid) { - var urlstr; - - urlstr = msguid + "/view"; - window.open(urlstr, "SOGo_msg_" + msguid, - "width=640,height=480,resizable=1,scrollbars=1,toolbar=0," + - "location=0,directories=0,status=0,menubar=0,copyhistory=0") + resetSelection(window); + openMessageWindow(sender, msguid, msguid + "/view"); return true; } function doubleClickedUid(sender, msguid) { @@ -41,6 +43,46 @@ function lowlightUid(sender, msguid) { return true; } +function singleClickedTableRow(clickEvent, sender) { + var rowid = sender.id; + var field; + + field = document.forms['pageform'].elements[rowid]; + if (field.value == "1") { + field.value = "0"; + sender.className = "tableview"; + } + else { + field.value = "1"; + sender.className = "tableview_selected"; + } +} +function doubleClickedTableRow(clickEvent, sender) { + var rowid = sender.id; + resetSelection(window); +} + +function toggleMailSelect(sender) { + var row; + row = document.getElementById(sender.name); + row.className = sender.checked ? "tableview_selected" : "tableview"; +} +function collectSelectedRows() { + var pageform = document.forms['pageform']; + var rows = new Array(); + + for (key in pageform) { + if (key.indexOf("row_") != 0) + continue; + + if (!pageform[key].checked) + continue; + + rows[rows.length] = key.substring(4, key.length); + } + return rows; +} + function clearSearch(sender) { var searchField = window.document.getElementById("searchtext"); if (searchField) searchField.value=""; @@ -161,6 +203,27 @@ function clickedNewFilter(sender) { /* generic stuff */ +function getHTTPClient() { + // http://developer.apple.com/internet/webcontent/xmlhttpreq.html + if (typeof XMLHttpRequest != "undefined") + return new XMLHttpRequest(); + + try { return new ActiveXObject("Msxml2.XMLHTTP"); } + catch (e) { } + try { return new ActiveXObject("Microsoft.XMLHTTP"); } + catch (e) { } + return null; +} + +function resetSelection(win) { + var t = ""; + if (win && win.getSelection) { + t = win.getSelection().toString(); + win.getSelection().removeAllRanges(); + } + return t; +} + function refreshOpener() { if (window.opener && !window.opener.closed) { window.opener.location.reload(); @@ -225,6 +288,7 @@ function markMailReadInWindow(win, msguid) { /* main window */ function reopenToRemoveLocationBar() { + // we cannot really use this, see below at the close comment if (window.locationbar && window.locationbar.visible) { newwin = window.open(window.location.href, "SOGo", "width=800,height=600,resizable=1,scrollbars=1," + @@ -239,3 +303,13 @@ function reopenToRemoveLocationBar() { } return true; } + +/* mail list reply */ + +function openMessageWindowsForSelection(sender, action) { + var rows = collectSelectedRows(); + var idset = ""; + + for (var i = 0; i < rows.length; i++) + win = openMessageWindow(sender, rows[i], rows[i] + "/" + action); +} diff --git a/SOGo/UI/Mailer/product.plist b/SOGo/UI/Mailer/product.plist index e2c6c826..f95ac7a4 100644 --- a/SOGo/UI/Mailer/product.plist +++ b/SOGo/UI/Mailer/product.plist @@ -94,15 +94,17 @@ cssClass = "tbicon_compose"; label = "Write"; }, ), -/* TODO: enable when implemented ( // second group { link = "#"; + onclick="openMessageWindowsForSelection(this, 'reply'); return false;"; cssClass = "tbicon_reply"; label = "Reply"; }, { link = "#"; + onclick="openMessageWindowsForSelection(this, 'replyall'); return false;"; cssClass = "tbicon_replyall"; label = "Reply All"; }, - { link = "#"; cssClass = "tbicon_forward"; label = "Forward"; }, + { link = "#"; + onclick="openMessageWindowsForSelection(this, 'forward'); return false;"; + cssClass = "tbicon_forward"; label = "Forward"; }, ), -*/ ( // third group { link = "expunge"; cssClass = "tbicon_delete"; label = "Expunge"; }, -- 2.39.5