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/09/11 22:48:24 UTC

[incubator-ponymail-foal] 03/03: regen JS

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 763cea9105987545ce51298120f645460d9ea156
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sat Sep 11 17:48:09 2021 -0500

    regen JS
---
 webui/js/ponymail.js | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index d5152d7..20b8f5c 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -304,7 +304,7 @@ ponymail_diff_regex = new RegExp(
   "^-{3} .+?[\r\n]+" + // Starts with a "--- /foo/bar/baz"
   "^\\+{3} .+?[\r\n]+" + // Then a "+++ /foo/bar/baz"
   "(" + // Then one or more of...
-    "^@@ .+[\r\n]+" + // positioning
+    "^@@@? .+[\r\n]+" + // positioning
     "(^ .*[\r\n]*$){0,3}" + // diff header
     "(^[-+ ].*[\r\n]*)+" + // actual diff
     "(^ .*[\r\n]*$){0,3}" + // diff trailer
@@ -547,6 +547,7 @@ function toggle_quote(el) {
     }
 }
 
+
 /******************************************
  Fetched from source/composer.js
 ******************************************/
@@ -1713,7 +1714,7 @@ function hideWindows(force_all) {
     }
     
     // if viewing a single thread, disregard the collapses below - the won't make sense!
-    if (location.href.match(/thread\.html/)) return;
+    if (location.href.match(/thread(?:\.html)?/)) return;
     
     // Finally, check for other opened emails, close 'em all
     let placeholders = document.getElementsByClassName('email_placeholder');
@@ -2056,7 +2057,7 @@ function listview_header(state, json) {
     let cforward = new HTML('button', { onclick: 'listview_header({pos: %u}, current_json);'.format(pnext),  disabled: (first+per_page-1 >= blobs.length) ? 'true': null}, new HTML('span', {class: 'glyphicon glyphicon-chevron-right'}, " "));
     chevrons.inject(cforward);
     
-    let crefresh = new HTML('button', { onclick: 'parseURL();', title: 'Refresh results', style: {marginLeft: '8px'}}, new HTML('span', {class: 'glyphicon glyphicon-refresh'}, " "));
+    let crefresh = new HTML('button', { onclick: 'parseURL({noprefs: true});', title: 'Refresh results', style: {marginLeft: '8px'}}, new HTML('span', {class: 'glyphicon glyphicon-refresh'}, " "));
     chevrons.inject(crefresh);
     
     if (state && state.pos != undefined) {
@@ -2381,7 +2382,7 @@ function listview_threaded_element(thread, idx) {
     let as = new HTML('div', {class: 'listview_email_as'});
     
     let suba = new HTML('a', {},  eml.subject === '' ? '(No subject)' : eml.subject);
-    if (current_json.name == '*' || current_json.domain == '*') {
+    if (current_json.list.match(/\*/) || current_json.domain == '*') {
         let kbd = new HTML('kbd', {class: 'listview_kbd'}, eml.list_raw.replace(/[<>]/g, '').replace('.','@',1))
         suba = [kbd, suba];
     }
@@ -2874,7 +2875,12 @@ function parseURL(state) {
     state.query = query;
     state.date = month;
   }
-  primeListView(state);
+  // If hitting the refresh button, don't refresh preferences, just do the search.
+  if (state.noprefs) {
+      post_prime(state);
+  } else {
+      primeListView(state);
+  }
 };