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/10/28 21:26:27 UTC

[incubator-ponymail-foal] branch master updated (0e64ea3 -> 09b674f)

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 0e64ea3  regen JS
     new 2a3e0f2  Add a subscribe button option, default to not showing it
     new 09b674f  move sub button up so it'll always render if applicable

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/css/scaffolding.css        | 14 ++++++++++++++
 webui/js/config.js               |  1 +
 webui/js/ponymail.js             | 13 +++++++++++++
 webui/js/source/sidebar-stats.js | 13 +++++++++++++
 webui/list.html                  |  1 +
 5 files changed, 42 insertions(+)

[incubator-ponymail-foal] 01/02: Add a subscribe button option, default to not showing it

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 2a3e0f2e8c5f650f1a2bfacbfa134f58ce20d289
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Thu Oct 28 23:18:49 2021 +0200

    Add a subscribe button option, default to not showing it
---
 webui/css/scaffolding.css        | 14 ++++++++++++++
 webui/js/config.js               |  1 +
 webui/js/ponymail.js             | 11 +++++++++++
 webui/js/source/sidebar-stats.js | 11 +++++++++++
 webui/list.html                  |  1 +
 5 files changed, 38 insertions(+)

diff --git a/webui/css/scaffolding.css b/webui/css/scaffolding.css
index 635a08d..af5a82c 100644
--- a/webui/css/scaffolding.css
+++ b/webui/css/scaffolding.css
@@ -360,6 +360,20 @@ a.dropdown-toggle {
 }
 
 
+/* Sidebar subscribe link */
+#subscribe_button {
+    margin-top: 16px;
+    display: inline-block;
+    background-color: #337ab7;
+    color: white;
+    font-size: 1.15rem;
+    text-decoration: none;
+    cursor: pointer;
+    padding: 5px;
+    border: 1px solid #0009;
+    border-radius: 4px;
+}
+
 /* Sidebar calendar */
 
 #sidebar_calendar {
diff --git a/webui/js/config.js b/webui/js/config.js
index b57289c..79dce88 100644
--- a/webui/js/config.js
+++ b/webui/js/config.js
@@ -62,6 +62,7 @@ var pm_config = {
 
 // Localized preferences (defaults)
 var prefs = {
+    subscribeLinks: false,           // Add subscribe button in stats pane?
     displayMode: 'threaded',        // threaded or flat
     groupBy: 'thread',              // thread or date
     sortOrder: 'forward',           // forward or reverse sort
diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index 518baec..54b0368 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -4199,4 +4199,15 @@ async function sidebar_stats(json) {
             wordCloud(json.cloud, 220, 100, wc);
         }, 50);
     }
+
+    // Subscribe button
+    if (prefs && prefs.subscribeLinks) {
+        let sb = document.getElementById('sidebar_subscribe');
+        if (sb && json.list) {
+            sb.textContent = "";
+            let sublink = json.list.replace("@", "-subscribe@");
+            let subbutton = new HTML("a", {href: `mailto:${sublink}`, id: "subscribe_button"}, "Subscribe to list");
+            sb.inject(subbutton);
+        }
+    }
 }
\ No newline at end of file
diff --git a/webui/js/source/sidebar-stats.js b/webui/js/source/sidebar-stats.js
index 89fb945..31dcb06 100644
--- a/webui/js/source/sidebar-stats.js
+++ b/webui/js/source/sidebar-stats.js
@@ -67,4 +67,15 @@ async function sidebar_stats(json) {
             wordCloud(json.cloud, 220, 100, wc);
         }, 50);
     }
+
+    // Subscribe button
+    if (prefs && prefs.subscribeLinks) {
+        let sb = document.getElementById('sidebar_subscribe');
+        if (sb && json.list) {
+            sb.textContent = "";
+            let sublink = json.list.replace("@", "-subscribe@");
+            let subbutton = new HTML("a", {href: `mailto:${sublink}`, id: "subscribe_button"}, "Subscribe to list");
+            sb.inject(subbutton);
+        }
+    }
 }
\ No newline at end of file
diff --git a/webui/list.html b/webui/list.html
index 70e229c..fda5a8f 100644
--- a/webui/list.html
+++ b/webui/list.html
@@ -145,6 +145,7 @@ the License. -->
         <div id="sidebar_calendar"></div>
         <div id="sidebar_stats"></div>
         <div id="sidebar_wordcloud"></div>
+        <div id="sidebar_subscribe"></div>
       </div>
       
       <!--

[incubator-ponymail-foal] 02/02: move sub button up so it'll always render if applicable

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 09b674f9f011c5d05d43fb59cff8fb86550bdba2
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Thu Oct 28 23:26:14 2021 +0200

    move sub button up so it'll always render if applicable
---
 webui/js/ponymail.js             | 22 ++++++++++++----------
 webui/js/source/sidebar-stats.js | 22 ++++++++++++----------
 2 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index 54b0368..cfdb13d 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -4155,6 +4155,18 @@ async function sidebar_stats(json) {
 
     obj.innerHTML = ""; // clear stats bar
 
+    // Subscribe button
+    if (prefs && prefs.subscribeLinks) {
+        let sb = document.getElementById('sidebar_subscribe');
+        if (sb) sb.textContent = "";
+        if (sb && json.list && !json.list.match(/\*/)) {
+            sb.textContent = "";
+            let sublink = json.list.replace("@", "-subscribe@");
+            let subbutton = new HTML("a", {href: `mailto:${sublink}`, id: "subscribe_button"}, "Subscribe to list");
+            sb.inject(subbutton);
+        }
+    }
+
     if (!json.emails || isHash(json.emails) || json.emails.length == 0) {
         obj.innerText = "No emails found...";
         return;
@@ -4200,14 +4212,4 @@ async function sidebar_stats(json) {
         }, 50);
     }
 
-    // Subscribe button
-    if (prefs && prefs.subscribeLinks) {
-        let sb = document.getElementById('sidebar_subscribe');
-        if (sb && json.list) {
-            sb.textContent = "";
-            let sublink = json.list.replace("@", "-subscribe@");
-            let subbutton = new HTML("a", {href: `mailto:${sublink}`, id: "subscribe_button"}, "Subscribe to list");
-            sb.inject(subbutton);
-        }
-    }
 }
\ No newline at end of file
diff --git a/webui/js/source/sidebar-stats.js b/webui/js/source/sidebar-stats.js
index 31dcb06..d1605d6 100644
--- a/webui/js/source/sidebar-stats.js
+++ b/webui/js/source/sidebar-stats.js
@@ -23,6 +23,18 @@ async function sidebar_stats(json) {
 
     obj.innerHTML = ""; // clear stats bar
 
+    // Subscribe button
+    if (prefs && prefs.subscribeLinks) {
+        let sb = document.getElementById('sidebar_subscribe');
+        if (sb) sb.textContent = "";
+        if (sb && json.list && !json.list.match(/\*/)) {
+            sb.textContent = "";
+            let sublink = json.list.replace("@", "-subscribe@");
+            let subbutton = new HTML("a", {href: `mailto:${sublink}`, id: "subscribe_button"}, "Subscribe to list");
+            sb.inject(subbutton);
+        }
+    }
+
     if (!json.emails || isHash(json.emails) || json.emails.length == 0) {
         obj.innerText = "No emails found...";
         return;
@@ -68,14 +80,4 @@ async function sidebar_stats(json) {
         }, 50);
     }
 
-    // Subscribe button
-    if (prefs && prefs.subscribeLinks) {
-        let sb = document.getElementById('sidebar_subscribe');
-        if (sb && json.list) {
-            sb.textContent = "";
-            let sublink = json.list.replace("@", "-subscribe@");
-            let subbutton = new HTML("a", {href: `mailto:${sublink}`, id: "subscribe_button"}, "Subscribe to list");
-            sb.inject(subbutton);
-        }
-    }
 }
\ No newline at end of file