+2005-02-08 Helge Hess <helge.hess@opengroupware.org>
+
+ * 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 <helge.hess@opengroupware.org>
* v0.9.92
}
if (len < r.location) {
-#warning CHECK CONDITION (< vs <=)
+ // TODO: CHECK CONDITION (< vs <=)
/* out of range, recover at first block */
r.location = 0;
return r;
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",
</td>
<td>
- <var:if condition="isMessageRead">
- <div class="mailer_readicon">
- <a href="markMessageUnread" var:_uid="message.uid"
- label:title="Mark Unread"> </a>
- </div>
- </var:if>
- <var:if condition="isMessageRead" const:negate="YES">
- <div class="mailer_unreadicon">
- <a href="markMessageRead" var:_uid="message.uid"
- label:title="Mark Read"> </a>
- </div>
- </var:if>
+ <div class="mailer_readicon"
+ var:style="msgIconReadVisibility"
+ var:id="msgIconReadDivID">
+ <a href="markMessageUnread" var:_uid="message.uid"
+ label:title="Mark Unread"> </a>
+ </div>
+ <div class="mailer_unreadicon"
+ var:style="msgIconUnreadVisibility"
+ var:id="msgIconUnreadDivID">
+ <a href="markMessageRead" var:_uid="message.uid"
+ label:title="Mark Read"> </a>
+ </div>
</td>
<td>
<var:if condition="hasMessageAttachment">
bodyInfo="clientObject.bodyStructure" />
</div>
- <script language="JavaScript">triggerOpenerCallback();</script>
+ <script language="JavaScript">
+ markMailReadInWindow(window.opener,
+ '<var:string value="clientObject.nameInContainer"/>');
+ </script>
</var:component>
# 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
/* JavaScript for SOGo Mailer */
+/*
+ DOM ids available in mail list view:
+ row_$msgid
+ div_$msgid
+ readdiv_$msgid
+ unreaddiv_$msgid
+*/
+
/*
Window Properties:
width, height
*/
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")
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;
}