]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1204 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 29 Oct 2007 15:45:52 +0000 (15:45 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 29 Oct 2007 15:45:52 +0000 (15:45 +0000)
SOPE/GDLContentStore/GNUmakefile
SOPE/NGCards/CardElement.m
SOPE/NGCards/ChangeLog
UI/Templates/MailerUI/UIxMailMainFrame.wox
UI/Templates/MailerUI/UIxMailPopupView.wox
UI/Templates/MailerUI/UIxMailView.wox
UI/WebServerResources/MailerUI.css
UI/WebServerResources/MailerUI.js
UI/WebServerResources/UIxMailPopupView.js

index 85b394e8c179bba1b315f52d75045703785e3dab..5de4624370c241e772905515b885daffd3be5047 100644 (file)
@@ -1,6 +1,6 @@
 # GNUstep makefiles
 
-include ../../../config.make
+include ../../config.make
 include $(GNUSTEP_MAKEFILES)/common.make
 include ./Version
 
index 45c9180f1c598105fe394968b47d85d5cb2d6133..cc36975564a1f2ddc886e530d33f206e22edbc55 100644 (file)
 #import <Foundation/NSRange.h>
 #import <Foundation/NSString.h>
 
+#import <NGExtensions/NGBase64Coding.h>
+#import <NGExtensions/NSObject+Logs.h>
+#import <NGExtensions/NGQuotedPrintableCoding.h>
+
 #import "NSArray+NGCards.h"
 #import "NSDictionary+NGCards.h"
 #import "CardVersitRenderer.h"
 
 - (NSString *) value: (unsigned int) anInt
 {
-  NSString *value;
+  NSString *realValue, *value, *encoding;
 
   if ([values count] <= anInt)
     value = @"";
   else
-    value = [values objectAtIndex: anInt];
+    {
+      realValue = [values objectAtIndex: anInt];
+      encoding = [[self value: 0 ofAttribute: @"encoding"] lowercaseString];
+      if ([encoding length])
+       {
+         if ([encoding isEqualToString: @"quoted-printable"])
+           value = [realValue stringByDecodingQuotedPrintable];
+         else if ([encoding isEqualToString: @"base64"])
+           value = [realValue stringByDecodingBase64];
+         else
+           {
+             value = realValue;
+             if (![encoding isEqualToString: @"8bit"])
+               [self logWithFormat: @"unknown encoding '%@'", encoding];
+           }
+       }
+      else
+       value = realValue;
+    }
 
   return value;
 }
index 679c350ae2bec2694bd3928d835d8c6ab0653377..09ec6734bef5339f21335d95cd725d6f1d57d239 100644 (file)
@@ -1,3 +1,8 @@
+2007-10-29  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * CardElement.m ([CardElement -value:anInt]): added handling for
+       quoted-printable, base64 and 8bit encoding attributes.
+
 2007-08-07  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * iCalRecurrenceRule.m ([iCalRecurrenceRule
index d222204db084fe49e9d04978e48cf74ea7c017a6..2356d37b5ae75f32dc484ab39660387af4b02b2a 100644 (file)
     </ul>
   </div>
   
-  <div class="menu" id="addressMenu">
-    <ul>
-      <li id="add_to_addressbook"><var:string label:value="Add to Address Book..."/></li>
-      <li id="compose_mailto"><var:string label:value="Compose Mail To"/></li>
-      <li id="create_filter"><var:string label:value="Create Filter From Message..."/></li>
-    </ul>
-  </div>
-
   <div class="menu" id="messageListMenu">
     <ul>
       <li><var:string label:value="Open Message In New Window"/></li>
index 6b892b56aa8fbbec67b0063b22fe272187c78a7e..2f7f01b4d05f2d92c947819248f843888f9e3c46 100644 (file)
@@ -7,5 +7,7 @@
     className="UIxPageFrame"
     title="title"
     const:popup="YES">
-    <var:component className="UIxMailView" />
-  </var:component>
+    <span id="messageContent">
+      <var:component className="UIxMailView" />
+    </span>
+   </var:component>
index 8ae114005d8d73de8a5e5745da0857bbd1d2f191..68d3e7434a1676369ecf96f4368b0ab2002ecc11 100644 (file)
       <var:component value="contentViewerComponent"
         bodyInfo="clientObject.bodyStructure" />
     </div>
+
+    <div class="menu" id="addressMenu">
+      <ul>
+        <li id="add_to_addressbook"><var:string label:value="Add to Address Book..."/></li>
+        <li id="compose_mailto"><var:string label:value="Compose Mail To"/></li>
+        <li id="create_filter"><var:string label:value="Create Filter From Message..."/></li>
+      </ul>
+    </div>
   </container>
index fcf07c2e155e686d589d32b22dbc5a31df4c1174..a5cd1c5af1a88fd0c7714c985601dc2ef094415d 100644 (file)
@@ -400,6 +400,9 @@ TD.mailer_fieldvalue a
   vertical-align: top;
 }
 
+TR.deleted TD
+{ text-decoration: line-through; }
+
 img.mailer_imagecontent
 {
   border: 0px;
index ddc8f027b7e424e93e82cfef694dfb2108ba1f44..f9a708dd0c3ae9114c36bd3eb7bccf794ad19370 100644 (file)
@@ -144,17 +144,14 @@ function openMessageWindowsForSelection(action, firstOnly) {
     var messageList = $("messageList");
     var rows = messageList.getSelectedRowsId();
     if (rows.length > 0) {
-      if (firstOnly)
-       openMessageWindow(rows[0].substr(4),
+      for (var i = 0; i < rows.length; i++) {
+       openMessageWindow(rows[i].substr(4),
                          ApplicationBaseURL + currentMailbox
-                         + "/" + rows[0].substr(4)
+                         + "/" + rows[i].substr(4)
                          + "/" + action);
-      else
-       for (var i = 0; i < rows.length; i++)
-         openMessageWindow(rows[i].substr(4),
-                           ApplicationBaseURL + currentMailbox
-                           + "/" + rows[i].substr(4)
-                           + "/" + action);
+       if (firstOnly)
+         break;
+      }
     } else {
       window.alert(labels["Please select a message."]);
     }
@@ -240,6 +237,7 @@ function deleteSelectedMessagesCallback(http) {
 
        var row = $("row_" + data["id"]);
        row.parentNode.removeChild(row);
+//     row.addClassName("deleted"); // when we'll offer "mark as deleted"
 
        deleteMessageRequestCount--;
       }
@@ -417,6 +415,7 @@ function openMailbox(mailbox, reload, idx) {
              + "&asc=" + sorting["ascending"]);
     if (idx)
       url += "&idx=" + idx;
+
     if (document.messageListAjaxRequest) {
       document.messageListAjaxRequest.aborted = true;
       document.messageListAjaxRequest.abort();
@@ -704,8 +703,9 @@ function configureLinksInMessage() {
   var messageDiv = $('messageContent');
   var mailContentDiv = document.getElementsByClassName('mailer_mailcontent',
                                                       messageDiv)[0];
-  Event.observe(mailContentDiv, "contextmenu",
-               onMessageContentMenu.bindAsEventListener(mailContentDiv));
+  if (!document.body.hasClassName("popup"))
+    Event.observe(mailContentDiv, "contextmenu",
+                 onMessageContentMenu.bindAsEventListener(mailContentDiv));
   var anchors = messageDiv.getElementsByTagName('a');
   for (var i = 0; i < anchors.length; i++)
     if (anchors[i].href.substring(0,7) == "mailto:") {
@@ -823,9 +823,6 @@ function moveTo(uri) {
   alert("MoveTo: " + uri);
 }
 
-function deleteSelectedMails() {
-}
-
 /* message menu entries */
 function onMenuOpenMessage(event) {
   return openMessageWindowsForSelection('popupview');
@@ -1332,7 +1329,7 @@ function buildMailboxes(accountName, encoded) {
   return account;
 }
 
-function onMenuCreateFolder(event) { log ("onMenuCreateFolder " + document.menuTarget);
+function onMenuCreateFolder(event) {
   var name = window.prompt(labels["Name :"], "");
   if (name && name.length > 0) {
     var folderID = document.menuTarget.getAttribute("dataname");
@@ -1505,16 +1502,15 @@ function messageFlagCallback(http) {
 
 function onLabelMenuPrepareVisibility() {
   var messageList = $("messageList");
-  var rows = messageList.getSelectedRows();
-
   var flags = {};
-  for (var i = 1; i < 6; i++)
-    flags["label" + i] = true;
-  for (var i = 0; i < rows.length; i++) {
-    var rowFlags = rows[i].getAttribute("labels").split(" ");
-    for (var flag in flags)
-      if (flags[flag] && rowFlags.indexOf(flag) == -1)
-       flags[flag] = false;
+
+  if (messageList) {
+    var rows = messageList.getSelectedRows();
+    for (var i = 0; i < rows.length; i++) {
+      $w(rows[i].getAttribute("labels")).each(function(flag) {
+       flags[flag] = true;
+       });
+    }
   }
 
   var lis = this.childNodesWithTag("ul")[0].childNodesWithTag("li")
index bfbed7db04ac34cf4d6d62f7f6a7ab37525327b6..b9cb5946c7b00331d0ad372512f07abaf2d813c2 100644 (file)
@@ -4,4 +4,9 @@ function onPrintCurrentMessage(event) {
   preventDefault(event);
 }
 
-addEvent(window, 'load', resizeMailContent);
+function initPopupMailer(event) {
+  configureLinksInMessage();
+  resizeMailContent();
+}
+
+addEvent(window, 'load', initPopupMailer);