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:29:20 UTC

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

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 3f6edbe  Regen JS
     new ad20497  Add in treeview list mode
     new e456343  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                 | 54 +++++++++++++++++++++++++++++++++---
 webui/js/source/listview-header.js   |  8 ++++--
 webui/js/source/listview-treeview.js | 51 ++++++++++++++++++++++++++++++++++
 webui/js/source/primer.js            |  4 +++
 webui/list.html                      |  8 +++---
 webui/oauth.html                     |  8 +++---
 webui/thread.html                    |  8 +++---
 9 files changed, 129 insertions(+), 26 deletions(-)
 create mode 100644 webui/js/source/listview-treeview.js

[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 e456343cd22a85824aaff1e4cca8fbd0878e59dd
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Fri Dec 10 20:28:15 2021 +0100

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

diff --git a/webui/admin.html b/webui/admin.html
index 531187c..a4f3c45 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=61f8ff6" rel="stylesheet" media="all">
+    <link href="css/scaffolding.css?revision=ad20497" 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=61f8ff6"></script>
-    <script src="js/wordcloud.js?revision=61f8ff6"></script>
-    <script src="js/ponymail.js?revision=61f8ff6"></script>
+    <script src="js/config.js?revision=ad20497"></script>
+    <script src="js/wordcloud.js?revision=ad20497"></script>
+    <script src="js/ponymail.js?revision=ad20497"></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 1ab47c3..5f8d6db 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=61f8ff6" rel="stylesheet" media="all">
+    <link href="css/scaffolding.css?revision=ad20497" 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=61f8ff6"></script>
-    <script src="js/ponymail.js?revision=61f8ff6"></script>
+    <script src="js/config.js?revision=ad20497"></script>
+    <script src="js/ponymail.js?revision=ad20497"></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 7187dcd..994d137 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 = '61f8ff6';
+const PONYMAIL_REVISION = 'ad20497';
 
 
 /******************************************
@@ -2242,7 +2242,7 @@ function listview_header(state, json) {
         list_title = "Virtual inbox, past 30 days";
     }
     let blobs = json.emails ? json.emails : [];
-    if (G_current_listmode == 'threaded') blobs = json.thread_struct;
+    if (G_current_listmode == 'threaded' || G_current_listmode == 'treeview') blobs = json.thread_struct;
 
     if (G_current_year && G_current_month) {
         list_title += ", %s %u".format(MONTHS[G_current_month - 1], G_current_year);
@@ -2318,12 +2318,14 @@ function listview_header(state, json) {
         class: 'glyphicon glyphicon-refresh'
     }, " "));
     chevrons.inject(crefresh);
-
+    console.log(G_current_listmode)
     if (state && state.pos != undefined) {
         if (G_current_listmode == 'threaded') {
             listview_threaded(json, state.pos);
-        } else {
+        } else if (G_current_listmode == 'flat') {
             listview_flat(json, state.pos);
+        } else {
+            listview_treeview(json, state.pos);
         }
     }
 
@@ -2771,6 +2773,46 @@ function listview_threaded_element(thread, idx) {
 
 
 /******************************************
+ Fetched from source/listview-treeview.js
+******************************************/
+
+function find_email(json, id) {
+    for (let eml of json.emails) {
+        if (id === eml.id) return eml
+    }
+}
+
+function listview_treeview(json, start) {
+    let list = document.getElementById('emails');
+    list.innerHTML = "";
+    let s = start || 0;
+    let email_ordered = [];
+    for (let thread of json.thread_struct) {
+        email_ordered.push(find_email(json, thread.tid));
+        for (let child of thread.children) email_ordered.push(find_email(json, child.tid));
+    }
+    if (email_ordered.length) {
+        for (let n = s; n < (s + G_current_per_page); n++) {
+            let z = email_ordered.length - n - 1; // reverse order by default
+            if (email_ordered[z]) {
+                let item = listview_flat_element(email_ordered[z], z);
+                list.inject(item);
+
+                // Hidden placeholder for expanding email(s)
+                let placeholder = new HTML('div', {
+                    class: G_chatty_layout ? 'email_placeholder_chatty' : 'email_placeholder',
+                    id: 'email_%u'.format(z)
+                });
+                list.inject(placeholder);
+            }
+        }
+    } else {
+        list.inject(txt("No emails found..."));
+    }
+}
+
+
+/******************************************
  Fetched from source/mgmt.js
 ******************************************/
 
@@ -3392,6 +3434,8 @@ function renderListView(state, json) {
     listview_header(state, json);
     if (G_current_listmode == 'threaded') {
         listview_threaded(json, 0);
+    } else if (G_current_listmode == 'treeview') {
+        listview_treeview(json, 0);
     } else {
         listview_flat(json, 0);
     }
@@ -3548,6 +3592,8 @@ function render_virtual_inbox(state, json) {
         listview_header(state, G_current_json);
         if (G_current_listmode == 'threaded') {
             listview_threaded(G_current_json, 0);
+        } else if (G_current_listmode == 'treeview') {
+            listview_treeview(G_current_json, 0);
         } else {
             listview_flat(G_current_json, 0);
         }
diff --git a/webui/list.html b/webui/list.html
index 446b15b..d422de9 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=61f8ff6" rel="stylesheet" media="all">
+    <link href="css/scaffolding.css?revision=ad20497" 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=61f8ff6"></script>
-    <script src="js/wordcloud.js?revision=61f8ff6"></script>
-    <script src="js/ponymail.js?revision=61f8ff6"></script>
+    <script src="js/config.js?revision=ad20497"></script>
+    <script src="js/wordcloud.js?revision=ad20497"></script>
+    <script src="js/ponymail.js?revision=ad20497"></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 c8fc2ed..430ef9a 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=61f8ff6" rel="stylesheet" media="all">
+    <link href="css/scaffolding.css?revision=ad20497" 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=61f8ff6"></script>
-    <script src="js/ponymail.js?revision=61f8ff6"></script>
-    <script src="js/oauth.js?revision=61f8ff6"></script>
+    <script src="js/config.js?revision=ad20497"></script>
+    <script src="js/ponymail.js?revision=ad20497"></script>
+    <script src="js/oauth.js?revision=ad20497"></script>
   </body>
 </html>
diff --git a/webui/thread.html b/webui/thread.html
index 8a32368..e0f3a92 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=61f8ff6" rel="stylesheet" media="all">
+    <link href="css/scaffolding.css?revision=ad20497" 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=61f8ff6"></script>
-    <script src="js/wordcloud.js?revision=61f8ff6"></script>
-    <script src="js/ponymail.js?revision=61f8ff6"></script>
+    <script src="js/config.js?revision=ad20497"></script>
+    <script src="js/wordcloud.js?revision=ad20497"></script>
+    <script src="js/ponymail.js?revision=ad20497"></script>
     <div id="splash" class="splash fade-in"> &nbsp; </div>
     <div style="clear: both;"></div>
   </body>

[incubator-ponymail-foal] 01/02: Add in treeview list mode

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 ad20497fbef6b7a1175b0743a6e1b67469b7ed28
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Fri Dec 10 20:27:59 2021 +0100

    Add in treeview list mode
    
    This fixes #153.
---
 webui/js/source/listview-header.js   |  8 +++---
 webui/js/source/listview-treeview.js | 51 ++++++++++++++++++++++++++++++++++++
 webui/js/source/primer.js            |  4 +++
 3 files changed, 60 insertions(+), 3 deletions(-)

diff --git a/webui/js/source/listview-header.js b/webui/js/source/listview-header.js
index 7b3192d..bd0cd26 100644
--- a/webui/js/source/listview-header.js
+++ b/webui/js/source/listview-header.js
@@ -29,7 +29,7 @@ function listview_header(state, json) {
         list_title = "Virtual inbox, past 30 days";
     }
     let blobs = json.emails ? json.emails : [];
-    if (G_current_listmode == 'threaded') blobs = json.thread_struct;
+    if (G_current_listmode == 'threaded' || G_current_listmode == 'treeview') blobs = json.thread_struct;
 
     if (G_current_year && G_current_month) {
         list_title += ", %s %u".format(MONTHS[G_current_month - 1], G_current_year);
@@ -105,12 +105,14 @@ function listview_header(state, json) {
         class: 'glyphicon glyphicon-refresh'
     }, " "));
     chevrons.inject(crefresh);
-
+    console.log(G_current_listmode)
     if (state && state.pos != undefined) {
         if (G_current_listmode == 'threaded') {
             listview_threaded(json, state.pos);
-        } else {
+        } else if (G_current_listmode == 'flat') {
             listview_flat(json, state.pos);
+        } else {
+            listview_treeview(json, state.pos);
         }
     }
 
diff --git a/webui/js/source/listview-treeview.js b/webui/js/source/listview-treeview.js
new file mode 100644
index 0000000..7677e97
--- /dev/null
+++ b/webui/js/source/listview-treeview.js
@@ -0,0 +1,51 @@
+/*
+ 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.
+ */
+
+function find_email(json, id) {
+    for (let eml of json.emails) {
+        if (id === eml.id) return eml
+    }
+}
+
+function listview_treeview(json, start) {
+    let list = document.getElementById('emails');
+    list.innerHTML = "";
+    let s = start || 0;
+    let email_ordered = [];
+    for (let thread of json.thread_struct) {
+        email_ordered.push(find_email(json, thread.tid));
+        for (let child of thread.children) email_ordered.push(find_email(json, child.tid));
+    }
+    if (email_ordered.length) {
+        for (let n = s; n < (s + G_current_per_page); n++) {
+            let z = email_ordered.length - n - 1; // reverse order by default
+            if (email_ordered[z]) {
+                let item = listview_flat_element(email_ordered[z], z);
+                list.inject(item);
+
+                // Hidden placeholder for expanding email(s)
+                let placeholder = new HTML('div', {
+                    class: G_chatty_layout ? 'email_placeholder_chatty' : 'email_placeholder',
+                    id: 'email_%u'.format(z)
+                });
+                list.inject(placeholder);
+            }
+        }
+    } else {
+        list.inject(txt("No emails found..."));
+    }
+}
diff --git a/webui/js/source/primer.js b/webui/js/source/primer.js
index b058415..f83bd56 100644
--- a/webui/js/source/primer.js
+++ b/webui/js/source/primer.js
@@ -33,6 +33,8 @@ function renderListView(state, json) {
     listview_header(state, json);
     if (G_current_listmode == 'threaded') {
         listview_threaded(json, 0);
+    } else if (G_current_listmode == 'treeview') {
+        listview_treeview(json, 0);
     } else {
         listview_flat(json, 0);
     }
@@ -189,6 +191,8 @@ function render_virtual_inbox(state, json) {
         listview_header(state, G_current_json);
         if (G_current_listmode == 'threaded') {
             listview_threaded(G_current_json, 0);
+        } else if (G_current_listmode == 'treeview') {
+            listview_treeview(G_current_json, 0);
         } else {
             listview_flat(G_current_json, 0);
         }