You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2016/09/06 08:53:37 UTC
[1/3] incubator-ponymail git commit: add attachments to email headers
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 <hu...@apache.org>
Authored: Tue Sep 6 10:49:52 2016 +0200
Committer: Daniel Gruno <hu...@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 ###
[3/3] incubator-ponymail git commit: bit of commentary
Posted by hu...@apache.org.
bit of commentary
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/5ad48831
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/5ad48831
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/5ad48831
Branch: refs/heads/coffee-and-cake
Commit: 5ad48831faca0051ffc0e71e37760bc84ddb2aef
Parents: 830215f
Author: Daniel Gruno <hu...@apache.org>
Authored: Tue Sep 6 10:51:18 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Tue Sep 6 10:51:18 2016 +0200
----------------------------------------------------------------------
site/js/coffee/email_display_basic.coffee | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/5ad48831/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 3035835..3542dc5 100644
--- a/site/js/coffee/email_display_basic.coffee
+++ b/site/js/coffee/email_display_basic.coffee
@@ -124,14 +124,18 @@ class BasicEmailDisplay
at = []
for file in json.attachments
fsize = file.size
+
+ ### Compact size to MB, KB or bytes ###
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"
+ ### Make a link with the filename and size ###
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: ")
[2/3] incubator-ponymail git commit: forgot to add default registry,
oops!
Posted by hu...@apache.org.
forgot to add default registry, oops!
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/830215f8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/830215f8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/830215f8
Branch: refs/heads/coffee-and-cake
Commit: 830215f853232f796fdcc08ee64fd8037e42c10c
Parents: f36bafb
Author: Daniel Gruno <hu...@apache.org>
Authored: Tue Sep 6 10:50:10 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Tue Sep 6 10:50:10 2016 +0200
----------------------------------------------------------------------
site/js/coffee/defaults_register.coffee | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/830215f8/site/js/coffee/defaults_register.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/defaults_register.coffee b/site/js/coffee/defaults_register.coffee
new file mode 100644
index 0000000..1999bc4
--- /dev/null
+++ b/site/js/coffee/defaults_register.coffee
@@ -0,0 +1,27 @@
+###
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+###
+
+### Various register functions ###
+
+ponymail_listview_models = {}
+ponymail_display_models = {}
+
+ponymail_register_listview = (name, title, cl) ->
+ ponymail_listview_models[name] = {title: title, class: cl}
+
+ponymail_register_display = (name, title, cl) ->
+ ponymail_display_models[name] = {title: title, class: cl}
\ No newline at end of file