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 2021/12/10 19:02:21 UTC

[incubator-ponymail-foal] branch master updated (676720d -> 3f6edbe)

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git.


    from 676720d  Fix menu bar order for mobile
     new 61f8ff6  refactor calc_per_page
     new 3f6edbe  Regen JS

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 webui/admin.html                 |  8 ++++----
 webui/index.html                 |  6 +++---
 webui/js/ponymail.js             | 18 ++++++++++++------
 webui/js/source/listview-flat.js | 16 +++++++++++-----
 webui/list.html                  |  8 ++++----
 webui/oauth.html                 |  8 ++++----
 webui/thread.html                |  8 ++++----
 7 files changed, 42 insertions(+), 30 deletions(-)

[incubator-ponymail-foal] 02/02: Regen JS

Posted by hu...@apache.org.
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 3f6edbe1e33eaed826cc8ca9b35cc61b05f58b3f
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Fri Dec 10 20:02:11 2021 +0100

    Regen JS
---
 webui/admin.html     |  8 ++++----
 webui/index.html     |  6 +++---
 webui/js/ponymail.js | 18 ++++++++++++------
 webui/list.html      |  8 ++++----
 webui/oauth.html     |  8 ++++----
 webui/thread.html    |  8 ++++----
 6 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/webui/admin.html b/webui/admin.html
index c03aab1..531187c 100644
--- a/webui/admin.html
+++ b/webui/admin.html
@@ -25,7 +25,7 @@ the License. -->
     <!-- Bootstrap -->
 
     <link href="css/bootstrap.min.css" rel="stylesheet" media="all">
-    <link href="css/scaffolding.css?revision=5615048" rel="stylesheet" media="all">
+    <link href="css/scaffolding.css?revision=61f8ff6" rel="stylesheet" media="all">
     <link href="css/modal.css" rel="stylesheet" media="all">
     <link href="css/spinner.css" rel="stylesheet" media="all">
     <link rel="alternate" href="/api/static.lua"/>
@@ -79,9 +79,9 @@ the License. -->
     <script src="js/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="></script>
     <!-- Include all compiled plugins (below), or include individual files as needed -->
     <script src="js/bootstrap.min.js"></script>
-    <script src="js/config.js?revision=5615048"></script>
-    <script src="js/wordcloud.js?revision=5615048"></script>
-    <script src="js/ponymail.js?revision=5615048"></script>
+    <script src="js/config.js?revision=61f8ff6"></script>
+    <script src="js/wordcloud.js?revision=61f8ff6"></script>
+    <script src="js/ponymail.js?revision=61f8ff6"></script>
     <div id="splash" class="splash fade-in"> &nbsp; </div>
     <div style="clear: both;"></div>
   </body>
diff --git a/webui/index.html b/webui/index.html
index 52f9893..1ab47c3 100644
--- a/webui/index.html
+++ b/webui/index.html
@@ -24,7 +24,7 @@ the License. -->
     <!-- Bootstrap -->
     
     <link href="css/bootstrap.min.css" rel="stylesheet" media="all">
-    <link href="css/scaffolding.css?revision=5615048" rel="stylesheet" media="all">
+    <link href="css/scaffolding.css?revision=61f8ff6" rel="stylesheet" media="all">
     <link href="css/modal.css" rel="stylesheet" media="all">
     <link href="css/spinner.css" rel="stylesheet" media="all">
     <link rel="alternate" href="/api/static.lua"/>
@@ -60,8 +60,8 @@ the License. -->
     <script src="js/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="></script>
     <!-- Include all compiled plugins (below), or include individual files as needed -->
     <script src="js/bootstrap.min.js"></script>
-    <script src="js/config.js?revision=5615048"></script>
-    <script src="js/ponymail.js?revision=5615048"></script>
+    <script src="js/config.js?revision=61f8ff6"></script>
+    <script src="js/ponymail.js?revision=61f8ff6"></script>
     <div id="splash" class="splash fade-in"> &nbsp; </div>
     <div style="clear: both;"></div>
     
diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index 9df3dca..7187dcd 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -16,7 +16,7 @@
 */
 // THIS IS AN AUTOMATICALLY COMBINED FILE. PLEASE EDIT THE source/ FILES!
 
-const PONYMAIL_REVISION = '5615048';
+const PONYMAIL_REVISION = '61f8ff6';
 
 
 /******************************************
@@ -2083,6 +2083,11 @@ function prime_list_index() {
  Fetched from source/listview-flat.js
 ******************************************/
 
+let compact_email_height = 24;  // a normal email element is 24 pixels high
+let preview_email_height = 40;
+
+let narrow_width = 600;  // <= 600 pixels and we're in narrow view
+
 function calc_per_page() {
     // Figure out how many emails per page
     let body = document.body;
@@ -2091,12 +2096,13 @@ function calc_per_page() {
         html.clientHeight, html.scrollHeight);
     let width = Math.max(body.scrollWidth,
         html.clientWidth, html.scrollWidth);
-    let email_h = G_current_listmode_compact ? 24 : 40;
-    if (width < 600) {
-        console.log("Using narrow view, halving emails per page...");
-        email_h = G_current_listmode_compact ? 36 : 80;
+    let email_h = G_current_listmode_compact ? compact_email_height : preview_email_height;
+    if (width < narrow_width) {
+        console.log("Using narrow view, reducing emails per page...");
+        email_h = G_current_listmode_compact ? compact_email_height * 1.5 : preview_email_height*2;
     }
-    height -= 180;
+    height -= document.getElementById("emails").scrollHeight + 4; // top area height plus spacing
+    email_h += 2;
     let per_page = Math.max(5, Math.floor(height / email_h));
     per_page -= per_page % 5;
     console.log("Viewport is %ux%u. We can show %u emails per page".format(width, height, per_page));
diff --git a/webui/list.html b/webui/list.html
index d831b37..446b15b 100644
--- a/webui/list.html
+++ b/webui/list.html
@@ -24,7 +24,7 @@ the License. -->
     <!-- Bootstrap -->
     
     <link href="css/bootstrap.min.css" rel="stylesheet" media="all">
-    <link href="css/scaffolding.css?revision=5615048" rel="stylesheet" media="all">
+    <link href="css/scaffolding.css?revision=61f8ff6" rel="stylesheet" media="all">
     <link href="css/modal.css" rel="stylesheet" media="all">
     <link href="css/spinner.css" rel="stylesheet" media="all">
     <link rel="alternate" href="/api/static.lua"/>
@@ -173,9 +173,9 @@ the License. -->
     </script>
     <!-- Include all compiled plugins (below), or include individual files as needed -->
     <script src="js/bootstrap.min.js"></script>
-    <script src="js/config.js?revision=5615048"></script>
-    <script src="js/wordcloud.js?revision=5615048"></script>
-    <script src="js/ponymail.js?revision=5615048"></script>
+    <script src="js/config.js?revision=61f8ff6"></script>
+    <script src="js/wordcloud.js?revision=61f8ff6"></script>
+    <script src="js/ponymail.js?revision=61f8ff6"></script>
     <div id="splash" class="splash fade-in"> &nbsp; </div>
     <div style="clear: both;"></div>
     <script type="text/javascript">
diff --git a/webui/oauth.html b/webui/oauth.html
index 2ef3f9d..c8fc2ed 100644
--- a/webui/oauth.html
+++ b/webui/oauth.html
@@ -21,7 +21,7 @@ the License. -->
 
     <!-- CSS -->
     <link href="css/bootstrap.min.css" rel="stylesheet" media="all">
-    <link href="css/scaffolding.css?revision=5615048" rel="stylesheet" media="all">
+    <link href="css/scaffolding.css?revision=61f8ff6" rel="stylesheet" media="all">
     <link href="css/modal.css" rel="stylesheet" media="all">
     <link href="css/spinner.css" rel="stylesheet" media="all">
 
@@ -54,8 +54,8 @@ the License. -->
     <script src="js/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="></script>
     <!-- Include all compiled plugins (below), or include individual files as needed -->
     <script src="js/bootstrap.min.js"></script>
-    <script src="js/config.js?revision=5615048"></script>
-    <script src="js/ponymail.js?revision=5615048"></script>
-    <script src="js/oauth.js?revision=5615048"></script>
+    <script src="js/config.js?revision=61f8ff6"></script>
+    <script src="js/ponymail.js?revision=61f8ff6"></script>
+    <script src="js/oauth.js?revision=61f8ff6"></script>
   </body>
 </html>
diff --git a/webui/thread.html b/webui/thread.html
index 8ce3f8c..8a32368 100644
--- a/webui/thread.html
+++ b/webui/thread.html
@@ -25,7 +25,7 @@ the License. -->
     <!-- Bootstrap -->
     
     <link href="css/bootstrap.min.css" rel="stylesheet" media="all">
-    <link href="css/scaffolding.css?revision=5615048" rel="stylesheet" media="all">
+    <link href="css/scaffolding.css?revision=61f8ff6" rel="stylesheet" media="all">
     <link href="css/modal.css" rel="stylesheet" media="all">
     <link href="css/spinner.css" rel="stylesheet" media="all">
     <link rel="alternate" href="/api/static.lua"/>
@@ -97,9 +97,9 @@ the License. -->
     <script src="js/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="></script>
     <!-- Include all compiled plugins (below), or include individual files as needed -->
     <script src="js/bootstrap.min.js"></script>
-    <script src="js/config.js?revision=5615048"></script>
-    <script src="js/wordcloud.js?revision=5615048"></script>
-    <script src="js/ponymail.js?revision=5615048"></script>
+    <script src="js/config.js?revision=61f8ff6"></script>
+    <script src="js/wordcloud.js?revision=61f8ff6"></script>
+    <script src="js/ponymail.js?revision=61f8ff6"></script>
     <div id="splash" class="splash fade-in"> &nbsp; </div>
     <div style="clear: both;"></div>
   </body>

[incubator-ponymail-foal] 01/02: refactor calc_per_page

Posted by hu...@apache.org.
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 61f8ff6508096728e7d895fa60dbe19e403e5620
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Fri Dec 10 20:02:02 2021 +0100

    refactor calc_per_page
    
    This should fix #146.
---
 webui/js/source/listview-flat.js | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/webui/js/source/listview-flat.js b/webui/js/source/listview-flat.js
index f42138d..be2810f 100644
--- a/webui/js/source/listview-flat.js
+++ b/webui/js/source/listview-flat.js
@@ -15,6 +15,11 @@
  limitations under the License.
  */
 
+let compact_email_height = 24;  // a normal email element is 24 pixels high
+let preview_email_height = 40;
+
+let narrow_width = 600;  // <= 600 pixels and we're in narrow view
+
 function calc_per_page() {
     // Figure out how many emails per page
     let body = document.body;
@@ -23,12 +28,13 @@ function calc_per_page() {
         html.clientHeight, html.scrollHeight);
     let width = Math.max(body.scrollWidth,
         html.clientWidth, html.scrollWidth);
-    let email_h = G_current_listmode_compact ? 24 : 40;
-    if (width < 600) {
-        console.log("Using narrow view, halving emails per page...");
-        email_h = G_current_listmode_compact ? 36 : 80;
+    let email_h = G_current_listmode_compact ? compact_email_height : preview_email_height;
+    if (width < narrow_width) {
+        console.log("Using narrow view, reducing emails per page...");
+        email_h = G_current_listmode_compact ? compact_email_height * 1.5 : preview_email_height*2;
     }
-    height -= 180;
+    height -= document.getElementById("emails").scrollHeight + 4; // top area height plus spacing
+    email_h += 2;
     let per_page = Math.max(5, Math.floor(height / email_h));
     per_page -= per_page % 5;
     console.log("Viewport is %ux%u. We can show %u emails per page".format(width, height, per_page));