ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject [1/3] incubator-ponymail git commit: add attachments to email headers
Date Tue, 06 Sep 2016 08:53:37 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/coffee-and-cake 37f71028b -> 5ad48831f


add attachments to email headers


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/f36bafbf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/f36bafbf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/f36bafbf

Branch: refs/heads/coffee-and-cake
Commit: f36bafbfd9fd9b833bce8a3df8eb439ab8288c56
Parents: 37f7102
Author: Daniel Gruno <humbedooh@apache.org>
Authored: Tue Sep 6 10:49:52 2016 +0200
Committer: Daniel Gruno <humbedooh@apache.org>
Committed: Tue Sep 6 10:49:52 2016 +0200

----------------------------------------------------------------------
 site/css/ponymail2.css                    |  4 ++--
 site/js/coffee/email_display_basic.coffee | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/f36bafbf/site/css/ponymail2.css
----------------------------------------------------------------------
diff --git a/site/css/ponymail2.css b/site/css/ponymail2.css
index d92f12e..a51dd52 100644
--- a/site/css/ponymail2.css
+++ b/site/css/ponymail2.css
@@ -426,13 +426,13 @@ a {
 }
 .header_key {
     padding-top: 0px;
-    width: 80px;
+    width: 100px;
     float: left;
     font-weight: bold;
 }
 .header_value {
     padding-top: 0px;
-    width: calc(100% - 90px);
+    width: calc(100% - 110px);
     float: left;
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/f36bafbf/site/js/coffee/email_display_basic.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/email_display_basic.coffee b/site/js/coffee/email_display_basic.coffee
index c7a7756..3035835 100644
--- a/site/js/coffee/email_display_basic.coffee
+++ b/site/js/coffee/email_display_basic.coffee
@@ -119,6 +119,26 @@ class BasicEmailDisplay
             ])
         headers.inject(list_line)
         
+        ### Attachments, if any ###
+        if isArray(json.attachments) and json.attachments.length > 0
+            at = []
+            for file in json.attachments
+                fsize = file.size
+                if fsize > (1024*1024)
+                    fsize = (fsize/(1024*1024)).toFixed(2) + "MB"
+                else if fsize > 1024
+                    fsize = (fsize/(1024)).toFixed(2) + "KB"
+                else
+                    fsize = fsize + " bytes"
+                link = new HTML('a', { href: "api/email.lua?attachment=true&file=#{file.hash}&id=#{json.mid}",
style: { marginRight: "8px"}}, "#{file.filename} (#{fsize})")
+                at.push(link)
+            att_line = new HTML('div', {},
+            [
+                new HTML('div', {class:"header_key"}, "Attachments: ")
+                new HTML('div', {class:"header_value"}, at)
+            ])
+            headers.inject(att_line)
+        
         ### Action buttons ###
         
         ### Permalink ###


Mime
View raw message