ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: flat view mode does not show first line of body
Date Fri, 06 Jan 2017 22:14:23 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 216dfac83 -> f843e6891


flat view mode does not show first line of body

This fixes #198

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

Branch: refs/heads/master
Commit: f843e68918e04472905572683be8482af65f9f6b
Parents: 216dfac
Author: Sebb <sebb@apache.org>
Authored: Fri Jan 6 22:14:08 2017 +0000
Committer: Sebb <sebb@apache.org>
Committed: Fri Jan 6 22:14:08 2017 +0000

----------------------------------------------------------------------
 CHANGELOG.md                              | 1 +
 site/api/stats.lua                        | 7 +++----
 site/js/dev/ponymail_listview_threaded.js | 4 ++--
 site/js/dev/ponymail_listview_tree.js     | 4 ++--
 site/js/ponymail.js                       | 8 ++++----
 tools/setup.py                            | 1 +
 6 files changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/f843e689/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8d5343f..c31c0a7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -104,6 +104,7 @@
 - pminfo.lua fetches and saves epoch but never uses it #320
 - pminfo.lua - no need to use scroll unless doc count > 10000 (#321)
 - pminfo.lua - scroll/scan ignores sort order (#322)
+- flat view mode does not show first line of body (#198)
 
 ## CHANGES in 0.9b:
 

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/f843e689/site/api/stats.lua
----------------------------------------------------------------------
diff --git a/site/api/stats.lua b/site/api/stats.lua
index 29950e6..423af53 100644
--- a/site/api/stats.lua
+++ b/site/api/stats.lua
@@ -29,6 +29,8 @@ local days = {
     31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31 
 }
 
+local BODY_MAXLEN = config.stats_maxBody or 200
+
 local function sortEmail(thread)
     if thread.children and type(thread.children) == "table" then
         table.sort (thread.children, function (k1, k2) return k1.epoch > k2.epoch end
)
@@ -678,9 +680,6 @@ function handle(r)
                 else
                     table.insert(threads, emails[mid])
                 end
-                if not statsOnly then
-                    threads[#threads].body = #email.body < 300 and email.body or email.body:sub(1,300)
.. "..."
-                end
             end
             email.references = nil
             email.to = nil
@@ -693,7 +692,7 @@ function handle(r)
             else
                 email.attachments = 0
             end
-            email.body = nil
+            email.body = #email.body < BODY_MAXLEN and email.body or email.body:sub(1,
BODY_MAXLEN) .. "..."
             if not statsOnly then
                 table.insert(emls, email)
             else

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/f843e689/site/js/dev/ponymail_listview_threaded.js
----------------------------------------------------------------------
diff --git a/site/js/dev/ponymail_listview_threaded.js b/site/js/dev/ponymail_listview_threaded.js
index 9d0de49..9e401bb 100644
--- a/site/js/dev/ponymail_listview_threaded.js
+++ b/site/js/dev/ponymail_listview_threaded.js
@@ -168,7 +168,7 @@ function loadList_threaded(mjson, limit, start, deep) {
                     "<div style='width: 64px; float: left;'>" +
                     "<img src='https://secure.gravatar.com/avatar/" + eml.gravatar + ".jpg?s=48&r=g&d=mm'/>"
+
                     "</div>" +
-                    "<div class='bubble-topic' style='float: left; width:calc(100% - 70px);'>"+
json[i].body.replace(/</g, "&lt;") + "<br/>" +
+                    "<div class='bubble-topic' style='float: left; width:calc(100% - 70px);'>"+
eml.body.replace(/</g, "&lt;") + "<br/>" +
                     "<a class='label label-info' href='thread.html/" + (pm_config.shortLinks
? shortenID(eml.id) : eml.id) + "' style='font-size: 85%; padding: 2px;' onclick='latestEmailInThread
= " +
                     latest +
                     "; toggleEmails_threaded(" + i + "); latestEmailInThread = 0; return
false;'>Read more..</a>" +
@@ -180,7 +180,7 @@ function loadList_threaded(mjson, limit, start, deep) {
         else if (prefs.theme && prefs.theme == "compact") {
             var from = eml.from.replace(/<.*>/, "").length > 0 ? eml.from.replace(/<.*>/,
"") : eml.from.replace(/[<>]+/g, "")
             from = "<span class='from_name'>" + from.replace(/\"/g, "") + "</span>"
-            var sbody = json[i].body.replace(/</g, "&lt;") + "&nbsp;"
+            var sbody = eml.body.replace(/</g, "&lt;") + "&nbsp;"
             
             nest += "<li class='list-group-item'>" +
                     

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/f843e689/site/js/dev/ponymail_listview_tree.js
----------------------------------------------------------------------
diff --git a/site/js/dev/ponymail_listview_tree.js b/site/js/dev/ponymail_listview_tree.js
index 1a463bb..0cab9b9 100644
--- a/site/js/dev/ponymail_listview_tree.js
+++ b/site/js/dev/ponymail_listview_tree.js
@@ -138,7 +138,7 @@ function loadList_treeview(mjson, limit, start, deep) {
                     "<div style='width: 64px; float: left;'>" +
                     "<img src='https://secure.gravatar.com/avatar/" + eml.gravatar + ".jpg?s=48&r=g&d=mm'/>"
+
                     "</div>" +
-                    "<div class='bubble-topic' style='float: left; width:calc(100% - 70px);'>"+
json[i].body.replace(/</g, "&lt;") + "<br/>" +
+                    "<div class='bubble-topic' style='float: left; width:calc(100% - 70px);'>"+
eml.body.replace(/</g, "&lt;") + "<br/>" +
                     "<a class='label label-info' href='thread.html/" + (pm_config.shortLinks
? shortenID(eml.id) : eml.id) + "' style='font-size: 85%; padding: 2px;' onclick='latestEmailInThread
= " +
                     latest +
                     "; toggleEmails_treeview(" + i + "); latestEmailInThread = 0; return
false;'>Read more..</a>" +
@@ -148,7 +148,7 @@ function loadList_treeview(mjson, limit, start, deep) {
         } else if (prefs.theme && prefs.theme == "compact") {
             var from = eml.from.replace(/<.*>/, "").length > 0 ? eml.from.replace(/<.*>/,
"") : eml.from.replace(/[<>]+/g, "")
             from = "<span class='from_name'>" + from.replace(/\"/g, "") + "</span>"
-            var sbody = json[i].body.replace(/</g, "&lt;") + "&nbsp;"
+            var sbody = eml.body.replace(/</g, "&lt;") + "&nbsp;"
             
             nest += "<li class='list-group-item'>" +
                     

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/f843e689/site/js/ponymail.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail.js b/site/js/ponymail.js
index 8b5b2a5..40ca07d 100644
--- a/site/js/ponymail.js
+++ b/site/js/ponymail.js
@@ -2752,7 +2752,7 @@ function loadList_threaded(mjson, limit, start, deep) {
                     "<div style='width: 64px; float: left;'>" +
                     "<img src='https://secure.gravatar.com/avatar/" + eml.gravatar + ".jpg?s=48&r=g&d=mm'/>"
+
                     "</div>" +
-                    "<div class='bubble-topic' style='float: left; width:calc(100% - 70px);'>"+
json[i].body.replace(/</g, "&lt;") + "<br/>" +
+                    "<div class='bubble-topic' style='float: left; width:calc(100% - 70px);'>"+
eml.body.replace(/</g, "&lt;") + "<br/>" +
                     "<a class='label label-info' href='thread.html/" + (pm_config.shortLinks
? shortenID(eml.id) : eml.id) + "' style='font-size: 85%; padding: 2px;' onclick='latestEmailInThread
= " +
                     latest +
                     "; toggleEmails_threaded(" + i + "); latestEmailInThread = 0; return
false;'>Read more..</a>" +
@@ -2764,7 +2764,7 @@ function loadList_threaded(mjson, limit, start, deep) {
         else if (prefs.theme && prefs.theme == "compact") {
             var from = eml.from.replace(/<.*>/, "").length > 0 ? eml.from.replace(/<.*>/,
"") : eml.from.replace(/[<>]+/g, "")
             from = "<span class='from_name'>" + from.replace(/\"/g, "") + "</span>"
-            var sbody = json[i].body.replace(/</g, "&lt;") + "&nbsp;"
+            var sbody = eml.body.replace(/</g, "&lt;") + "&nbsp;"
             
             nest += "<li class='list-group-item'>" +
                     
@@ -3005,7 +3005,7 @@ function loadList_treeview(mjson, limit, start, deep) {
                     "<div style='width: 64px; float: left;'>" +
                     "<img src='https://secure.gravatar.com/avatar/" + eml.gravatar + ".jpg?s=48&r=g&d=mm'/>"
+
                     "</div>" +
-                    "<div class='bubble-topic' style='float: left; width:calc(100% - 70px);'>"+
json[i].body.replace(/</g, "&lt;") + "<br/>" +
+                    "<div class='bubble-topic' style='float: left; width:calc(100% - 70px);'>"+
eml.body.replace(/</g, "&lt;") + "<br/>" +
                     "<a class='label label-info' href='thread.html/" + (pm_config.shortLinks
? shortenID(eml.id) : eml.id) + "' style='font-size: 85%; padding: 2px;' onclick='latestEmailInThread
= " +
                     latest +
                     "; toggleEmails_treeview(" + i + "); latestEmailInThread = 0; return
false;'>Read more..</a>" +
@@ -3015,7 +3015,7 @@ function loadList_treeview(mjson, limit, start, deep) {
         } else if (prefs.theme && prefs.theme == "compact") {
             var from = eml.from.replace(/<.*>/, "").length > 0 ? eml.from.replace(/<.*>/,
"") : eml.from.replace(/[<>]+/g, "")
             from = "<span class='from_name'>" + from.replace(/\"/g, "") + "</span>"
-            var sbody = json[i].body.replace(/</g, "&lt;") + "&nbsp;"
+            var sbody = eml.body.replace(/</g, "&lt;") + "&nbsp;"
             
             nest += "<li class='list-group-item'>" +
                     

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/f843e689/tools/setup.py
----------------------------------------------------------------------
diff --git a/tools/setup.py b/tools/setup.py
index a4d668b..a478458 100755
--- a/tools/setup.py
+++ b/tools/setup.py
@@ -472,6 +472,7 @@ local config = {
     email_footer = nil, -- see the docs for how to set this up.
     full_headers = false,
     maxResults = 5000, -- max emails to return in one go. Might need to be bumped for large
lists
+--  stats_maxBody = 200, -- max size of body snippet returned by stats.lua
     admin_oauth = {}, -- list of domains that may do administrative oauth (private list access)
                      -- add 'www.googleapis.com' to the list for google oauth to decide,
for instance.
     oauth_fields = { -- used for specifying individual oauth handling parameters.


Mime
View raw message