]> err.no Git - scalable-opengroupware.org/commitdiff
fixed OGo bug #970 (works without refresh now)
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 8 Feb 2005 15:00:23 +0000 (15:00 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 8 Feb 2005 15:00:23 +0000 (15:00 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@532 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/UI/Mailer/ChangeLog
SOGo/UI/Mailer/UIxMailListView.m
SOGo/UI/Mailer/UIxMailListView.wox
SOGo/UI/Mailer/UIxMailView.wox
SOGo/UI/Mailer/Version
SOGo/UI/Mailer/mailer.js

index c8418d55c70e0f95ae8c04ad330ceb1677a1340d..52d64f36c033cad530d5fd3431005ba1961b64b1 100644 (file)
@@ -1,3 +1,15 @@
+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
index 8b36b5d6123e94474d01a4ef14dc51aa07f61b19..917edaf35d66966feca298f781cf9536b6671063 100644 (file)
@@ -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", 
index 134fe1726fc289e883861200c8a41c970ffeb6fd..2255b4f9f416e805f91744ec1adb131a51ec87a0 100644 (file)
             </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">
index eb2cae6333565332aa5ed014d6e839b9a4ed3203..381d69b0db0e82a1e07149769696d35c46ab0cd8 100644 (file)
@@ -74,5 +74,8 @@
                    bodyInfo="clientObject.bodyStructure" />
   </div>
 
-  <script language="JavaScript">triggerOpenerCallback();</script>
+  <script language="JavaScript">
+    markMailReadInWindow(window.opener, 
+      '<var:string value="clientObject.nameInContainer"/>');
+  </script>
 </var:component>
index e7ef8c160ce2dba24a24884c705003daa493f886..3cdf3491de5cce0ae51afa6314dab000442e4a37 100644 (file)
@@ -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
index b8ddaced094ad3cfe0956b7c35df8f3e8e675299..a902debaf7c688c4c5570707f6fca17b6cd0c326 100644 (file)
@@ -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;
 }