From 72d7a8d51792a1fed2e39489e02b09efcd3b98fb Mon Sep 17 00:00:00 2001 From: helge Date: Tue, 8 Feb 2005 15:00:23 +0000 Subject: [PATCH] fixed OGo bug #970 (works without refresh now) git-svn-id: http://svn.opengroupware.org/SOGo/trunk@532 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/UI/Mailer/ChangeLog | 12 ++++++++++ SOGo/UI/Mailer/UIxMailListView.m | 15 +++++++++++- SOGo/UI/Mailer/UIxMailListView.wox | 24 +++++++++---------- SOGo/UI/Mailer/UIxMailView.wox | 5 +++- SOGo/UI/Mailer/Version | 2 +- SOGo/UI/Mailer/mailer.js | 37 ++++++++++++++++++++++++++---- 6 files changed, 75 insertions(+), 20 deletions(-) diff --git a/SOGo/UI/Mailer/ChangeLog b/SOGo/UI/Mailer/ChangeLog index c8418d55..52d64f36 100644 --- a/SOGo/UI/Mailer/ChangeLog +++ b/SOGo/UI/Mailer/ChangeLog @@ -1,3 +1,15 @@ +2005-02-08 Helge Hess + + * v0.9.93 + + * mailer.js: work on the read-mail marking code, properly change the + icon div + + * UIxMailListView.m: changed handling of unread mail flags + + * UIxMailView.wox: use the new markMailReadInWindow function to mark + a mail read in the mail list + 2005-02-07 Helge Hess * v0.9.92 diff --git a/SOGo/UI/Mailer/UIxMailListView.m b/SOGo/UI/Mailer/UIxMailListView.m index 8b36b5d6..917edaf3 100644 --- a/SOGo/UI/Mailer/UIxMailListView.m +++ b/SOGo/UI/Mailer/UIxMailListView.m @@ -219,7 +219,7 @@ static int attachmentFlagSize = 8096; } if (len < r.location) { -#warning CHECK CONDITION (< vs <=) + // TODO: CHECK CONDITION (< vs <=) /* out of range, recover at first block */ r.location = 0; return r; @@ -312,6 +312,19 @@ static int attachmentFlagSize = 8096; return [@"div_" stringByAppendingString:[self messageUidString]]; } +- (NSString *)msgIconReadDivID { + return [@"readdiv_" stringByAppendingString:[self messageUidString]]; +} +- (NSString *)msgIconUnreadDivID { + return [@"unreaddiv_" stringByAppendingString:[self messageUidString]]; +} +- (NSString *)msgIconReadVisibility { + return [self isMessageRead] ? nil : @"display: none;"; +} +- (NSString *)msgIconUnreadVisibility { + return [self isMessageRead] ? @"display: none;" : nil; +} + - (NSString *)clickedMsgJS { /* return 'false' aborts processing */ return [NSString stringWithFormat:@"clickedUid(this, '%@'); return false", diff --git a/SOGo/UI/Mailer/UIxMailListView.wox b/SOGo/UI/Mailer/UIxMailListView.wox index 134fe172..2255b4f9 100644 --- a/SOGo/UI/Mailer/UIxMailListView.wox +++ b/SOGo/UI/Mailer/UIxMailListView.wox @@ -147,18 +147,18 @@ - -
- -
-
- -
- -
-
+
+ +
+
+ +
diff --git a/SOGo/UI/Mailer/UIxMailView.wox b/SOGo/UI/Mailer/UIxMailView.wox index eb2cae63..381d69b0 100644 --- a/SOGo/UI/Mailer/UIxMailView.wox +++ b/SOGo/UI/Mailer/UIxMailView.wox @@ -74,5 +74,8 @@ bodyInfo="clientObject.bodyStructure" /> - + diff --git a/SOGo/UI/Mailer/Version b/SOGo/UI/Mailer/Version index e7ef8c16..3cdf3491 100644 --- a/SOGo/UI/Mailer/Version +++ b/SOGo/UI/Mailer/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=92 +SUBMINOR_VERSION:=93 # v0.9.91 requires SoObjects/Mailer v0.9.68 # v0.9.89 requires SoObjects/Mailer v0.9.67 diff --git a/SOGo/UI/Mailer/mailer.js b/SOGo/UI/Mailer/mailer.js index b8ddaced..a902deba 100644 --- a/SOGo/UI/Mailer/mailer.js +++ b/SOGo/UI/Mailer/mailer.js @@ -1,5 +1,13 @@ /* JavaScript for SOGo Mailer */ +/* + DOM ids available in mail list view: + row_$msgid + div_$msgid + readdiv_$msgid + unreaddiv_$msgid +*/ + /* Window Properties: width, height @@ -8,10 +16,9 @@ */ function clickedUid(sender, msguid) { - var urlstr, cburl; + var urlstr; - cburl = "markMessageRead?uid=" + msguid; - urlstr = msguid + "/view?openerurl=" + encodeURIComponent(cburl); + 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") @@ -176,11 +183,31 @@ function triggerOpenerCallback() { var t, cburl; t = getQueryParaValue(window.location.search, "openerurl="); - cburl = window.opener.window.location.href; + cburl = window.opener.location.href; if (cburl[cburl.length - 1] != "/") { cburl = cburl.substr(0, cburl.lastIndexOf("/") + 1); } cburl = cburl + t; - window.opener.window.location.href = cburl; + window.opener.location.href = cburl; + } +} + +/* mail list DOM changes */ + +function markMailReadInWindow(win, msguid) { + var msgDiv; + + msgDiv = win.document.getElementById("div_" + msguid); + if (msgDiv) { + msgDiv.className = "mailer_readmailsubject"; + + msgDiv = win.document.getElementById("unreaddiv_" + msguid); + if (msgDiv) msgDiv.style.display = "none"; + msgDiv = win.document.getElementById("readdiv_" + msguid); + if (msgDiv) msgDiv.style.display = "block"; + + return true; } + else + return false; } -- 2.39.5