]> err.no Git - scalable-opengroupware.org/blobdiff - SOGo/UI/Mailer/mailer.js
fixed OGo bug #970 (works without refresh now)
[scalable-opengroupware.org] / SOGo / UI / Mailer / mailer.js
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;
 }