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 2020/09/08 18:59:29 UTC
[incubator-ponymail-foal] 02/02: Fix attachments for old-style
layout
This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
commit 7211b0fb91f0f34374870b266f7c00bef45c0027
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Sep 8 20:59:15 2020 +0200
Fix attachments for old-style layout
---
webui/js/ponymail.js | 6 +++---
webui/js/source/render-email.js | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index 8824a9b..09fc113 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -2771,10 +2771,10 @@ async function render_email(state, json) {
let alinks = [];
for (let n = 0; n < json.attachments.length; n++) {
let attachment = json.attachments[n];
- let link = `${apiURL}/api/email.lua?attachment=true&id=${json.mid}&file=${attachment.hash}`;
+ let link = `${pm_config.apiURL}api/email.lua?attachment=true&id=${json.mid}&file=${attachment.hash}`;
let a = new HTML('a', {href: link, target: '_blank'}, attachment.filename);
alinks.push(a);
- let fs = " ${attachment.size} bytes";
+ let fs = ` ${attachment.size} bytes`;
if (attachment.size >= 1024) fs = ` ${Math.floor(attachment.size/1024)} KB`;
if (attachment.size >= 1024*1024) fs = ` ${Math.floor(attachment.size/(1024*10.24))/100} MB`;
alinks.push (fs);
@@ -2846,7 +2846,7 @@ async function render_email_chatty(state, json) {
// Attachments?
if (json.attachments && json.attachments.length > 0) {
let attach_field = new HTML('div', {class: 'email_kv'});
- let attach_key = new HTML('div', {class: 'email_key'}, "Attachment(s): ");
+ let attach_key = new HTML('div', {class: 'email_key'}, "Attachment(s):");
let alinks = [];
for (let n = 0; n < json.attachments.length; n++) {
let attachment = json.attachments[n];
diff --git a/webui/js/source/render-email.js b/webui/js/source/render-email.js
index 05f88b5..b1b9c3f 100644
--- a/webui/js/source/render-email.js
+++ b/webui/js/source/render-email.js
@@ -62,10 +62,10 @@ async function render_email(state, json) {
let alinks = [];
for (let n = 0; n < json.attachments.length; n++) {
let attachment = json.attachments[n];
- let link = `${apiURL}/api/email.lua?attachment=true&id=${json.mid}&file=${attachment.hash}`;
+ let link = `${pm_config.apiURL}api/email.lua?attachment=true&id=${json.mid}&file=${attachment.hash}`;
let a = new HTML('a', {href: link, target: '_blank'}, attachment.filename);
alinks.push(a);
- let fs = " ${attachment.size} bytes";
+ let fs = ` ${attachment.size} bytes`;
if (attachment.size >= 1024) fs = ` ${Math.floor(attachment.size/1024)} KB`;
if (attachment.size >= 1024*1024) fs = ` ${Math.floor(attachment.size/(1024*10.24))/100} MB`;
alinks.push (fs);