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 2018/01/07 15:57:22 UTC

[1/2] incubator-ponymail git commit: If we hit >12 levels of nesting, start cutting padding

Repository: incubator-ponymail
Updated Branches:
  refs/heads/humbedooh/max-nesting [created] ec2e136d1


If we hit >12 levels of nesting, start cutting padding

This prevents the width of emails in nested view
from shrinking to no width. This addresses #426


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

Branch: refs/heads/humbedooh/max-nesting
Commit: f8938300d3d8d4b64c173a6c63d6851641e670a2
Parents: 593029a
Author: Daniel Gruno <hu...@apache.org>
Authored: Sun Jan 7 16:54:50 2018 +0100
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sun Jan 7 16:54:50 2018 +0100

----------------------------------------------------------------------
 site/js/dev/ponymail_assign_vars.js    |  1 +
 site/js/dev/ponymail_email_displays.js | 16 ++++++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/f8938300/site/js/dev/ponymail_assign_vars.js
----------------------------------------------------------------------
diff --git a/site/js/dev/ponymail_assign_vars.js b/site/js/dev/ponymail_assign_vars.js
index 068a563..dbeed72 100644
--- a/site/js/dev/ponymail_assign_vars.js
+++ b/site/js/dev/ponymail_assign_vars.js
@@ -60,6 +60,7 @@ var pending_urls = {} // URL list for GetAsync's support functions (such as the
 var pb_refresh = 0
 var treeview_guard = {}
 var mbox_month = null
+var max_nesting = 12
 
 var URL_BASE = pm_config.URLBase ? pm_config.URLBase.replace(/\/+/g, "/") : ""
 

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/f8938300/site/js/dev/ponymail_email_displays.js
----------------------------------------------------------------------
diff --git a/site/js/dev/ponymail_email_displays.js b/site/js/dev/ponymail_email_displays.js
index b440399..76d5699 100644
--- a/site/js/dev/ponymail_email_displays.js
+++ b/site/js/dev/ponymail_email_displays.js
@@ -144,7 +144,18 @@ function displayEmail(json, id, level) {
         }
         // Default theme
         else {
-            thread.setAttribute("class", "reply bs-callout bs-callout-" + cols[parseInt(Math.random() * cols.length - 0.01)])
+            tclass = "reply bs-callout bs-callout-" + cols[parseInt(Math.random() * cols.length - 0.01)]
+            // If we hit max_nesting levels, discard nesting display further down.
+            // Otherwise, we risk squeezing it into oblivion.
+            thread.style.padding = "5px"
+            thread.style.fontFamily = "Hack"
+            
+            if (level >= max_nesting) {
+                tclass = "reply" // No bs-callout if we nest too deep.
+                thread.style.paddingLeft = "0px";  // remove padding, left and right
+                thread.style.paddingRight = "0px";
+            }
+            thread.setAttribute("class", tclass)
             thread.style.background = estyle
             thread.style.marginTop = "30px"
             thread.innerHTML += ' &nbsp; <label class="label label-success" onclick="compose(\'' + json.mid + '\');" style="cursor: pointer; float: right; margin-left: 10px;">Reply</label>'
@@ -156,9 +167,6 @@ function displayEmail(json, id, level) {
             
             
             thread.innerHTML += "<br/>"
-            //thread.style.border = "1px dotted #666"
-            thread.style.padding = "5px"
-            thread.style.fontFamily = "Hack"
             
             var fields = ['From', 'To', 'CC', 'Subject', 'Date']
             for (var i in fields) {


[2/2] incubator-ponymail git commit: Regenerate JS

Posted by hu...@apache.org.
Regenerate JS


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

Branch: refs/heads/humbedooh/max-nesting
Commit: ec2e136d1090287c11e6f2c623c68cd2a166c698
Parents: f893830
Author: Daniel Gruno <hu...@apache.org>
Authored: Sun Jan 7 16:56:36 2018 +0100
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sun Jan 7 16:56:36 2018 +0100

----------------------------------------------------------------------
 site/js/ponymail.js | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/ec2e136d/site/js/ponymail.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail.js b/site/js/ponymail.js
index 84fa8eb..2b4be05 100644
--- a/site/js/ponymail.js
+++ b/site/js/ponymail.js
@@ -68,6 +68,7 @@ var pending_urls = {} // URL list for GetAsync's support functions (such as the
 var pb_refresh = 0
 var treeview_guard = {}
 var mbox_month = null
+var max_nesting = 12
 
 var URL_BASE = pm_config.URLBase ? pm_config.URLBase.replace(/\/+/g, "/") : ""
 
@@ -1506,7 +1507,18 @@ function displayEmail(json, id, level) {
         }
         // Default theme
         else {
-            thread.setAttribute("class", "reply bs-callout bs-callout-" + cols[parseInt(Math.random() * cols.length - 0.01)])
+            tclass = "reply bs-callout bs-callout-" + cols[parseInt(Math.random() * cols.length - 0.01)]
+            // If we hit max_nesting levels, discard nesting display further down.
+            // Otherwise, we risk squeezing it into oblivion.
+            thread.style.padding = "5px"
+            thread.style.fontFamily = "Hack"
+            
+            if (level >= max_nesting) {
+                tclass = "reply" // No bs-callout if we nest too deep.
+                thread.style.paddingLeft = "0px";  // remove padding, left and right
+                thread.style.paddingRight = "0px";
+            }
+            thread.setAttribute("class", tclass)
             thread.style.background = estyle
             thread.style.marginTop = "30px"
             thread.innerHTML += ' &nbsp; <label class="label label-success" onclick="compose(\'' + json.mid + '\');" style="cursor: pointer; float: right; margin-left: 10px;">Reply</label>'
@@ -1518,9 +1530,6 @@ function displayEmail(json, id, level) {
             
             
             thread.innerHTML += "<br/>"
-            //thread.style.border = "1px dotted #666"
-            thread.style.padding = "5px"
-            thread.style.fontFamily = "Hack"
             
             var fields = ['From', 'To', 'CC', 'Subject', 'Date']
             for (var i in fields) {