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/22 00:03:17 UTC
[incubator-ponymail-foal] branch master updated (a168886 -> 918d018)
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 a168886 clean up CSS
new 7cf064f remove regression
new d4b1241 rough in a header search feature
new 918d018 regen JS
The 3 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/js/ponymail.js | 30 +++++++++++++++++++++++++-----
webui/js/source/listview-header.js | 1 -
webui/js/source/search.js | 18 ++++++++++++++++--
webui/js/source/sidebar-calendar.js | 11 +++++++++--
webui/list.html | 6 ++++++
5 files changed, 56 insertions(+), 10 deletions(-)
[incubator-ponymail-foal] 02/03: rough in a header search feature
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 d4b1241f7d8183adc54f921e6222e636cc08a134
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Sep 21 19:02:54 2021 -0500
rough in a header search feature
this will need smoothing out, but works okay.
---
webui/js/source/search.js | 18 ++++++++++++++++--
webui/js/source/sidebar-calendar.js | 11 +++++++++--
webui/list.html | 6 ++++++
3 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/webui/js/source/search.js b/webui/js/source/search.js
index 3d95d36..613a419 100644
--- a/webui/js/source/search.js
+++ b/webui/js/source/search.js
@@ -28,13 +28,27 @@ function search(query, date) {
list = '*';
global = true;
}
+
+ let listid = '%s@%s'.format(list, domain);
+ let newhref = "list?%s:%s:%s".format(listid, date, query);
+
+ let header_from = document.getElementById('header_from');
+ let header_subject = document.getElementById('header_subject');
let sURL = '%sapi/stats.lua?d=%s&list=%s&domain=%s&q=%s'.format(apiURL, date, list, domain, query);
+ if (header_from.value.length > 0) {
+ sURL += "&header_from=%s".format(encodeURIComponent(header_from.value));
+ newhref += "&header_from=%s".format(header_from.value);
+ header_from.value = "";
+ }
+ if (header_subject.value.length > 0) {
+ sURL += "&header_subject=%s".format(encodeURIComponent(header_subject.value));
+ newhref += "&header_subject=%s".format(header_subject.value);
+ header_subject.value = "";
+ }
GET(sURL, renderListView, {
search: true,
global: global
});
- let listid = '%s@%s'.format(list, domain);
- let newhref = "list?%s:%s:%s".format(listid, date, query);
if (location.href !== newhref) {
window.history.pushState({}, null, newhref);
}
diff --git a/webui/js/source/sidebar-calendar.js b/webui/js/source/sidebar-calendar.js
index 64176f6..e54df16 100644
--- a/webui/js/source/sidebar-calendar.js
+++ b/webui/js/source/sidebar-calendar.js
@@ -168,10 +168,17 @@ function calendar_click(year, month) {
let q = "";
let calendar_current_list = current_list;
let calendar_current_domain = current_domain;
- if (current_json && current_json.searchParams && current_json.searchParams.q) {
- q = current_json.searchParams.q;
+ if (current_json && current_json.searchParams) {
+ q = current_json.searchParams.q || "";
calendar_current_list = current_json.searchParams.list;
calendar_current_domain = current_json.searchParams.domain;
+ // Weave in header parameters
+ for (let key of Object.keys((current_json.searchParams || {}))) {
+ if (key.match(/^header_/)) {
+ let value = current_json.searchParams[key];
+ q += `&${key}=${value}`;
+ }
+ }
}
let newhref = "list?%s@%s:%u-%u".format(calendar_current_list, calendar_current_domain, year, month);
if (q && q.length > 0) newhref += ":" + q;
diff --git a/webui/list.html b/webui/list.html
index 7699f46..d57cc6b 100644
--- a/webui/list.html
+++ b/webui/list.html
@@ -67,7 +67,13 @@ the License. -->
<li><b>Date range:</b>
<span id='drh'><input title="Click to change the date range" style="padding-left: 20px; border: none; cursor: url(images/daterange.ico), text; min-width: 200px; margin-right: 10px; background-color: transparent; font-size: 9pt;" name="d" id='d' data="lte=1M" value="Less than 1 month ago" onclick="datePicker(this);" readonly="readonly"/></span>
</li>
+ <li class="divider"></li>
+ <li><b>Advanced filters:</b><br/>
+ <div style="display: inline-block; width: 120px;">Author: </div><span id='hd_from'><input title="Name or email address" style="min-width: 200px; margin-right: 10px; background-color: white; font-size: 8pt;" name="header_from" id='header_from' value=""/></span><br/>
+ <div style="display: inline-block; width: 120px;">Subject: </div><span id='hd_subject'><input style="min-width: 200px; margin-right: 10px; background-color: white; font-size: 8pt;" name="header_subject" id='header_subject' value=""/></span><br/>
+ </li>
</ul>
+
<input type="text" name="q" id="q" placeholder="Search this list..." style="border-top: none; border-bottom: none;"/>
<button type="submit" title="Search!" value="Search!" class="btn btn-primary"><span class="glyphicon glyphicon-search"> </span></button>
[incubator-ponymail-foal] 03/03: 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 918d018a433f22a0a6c97245847d0ca57b622c38
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Sep 21 19:03:09 2021 -0500
regen JS
---
webui/js/ponymail.js | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index d4625b5..1dc2817 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -2374,7 +2374,6 @@ function listview_list_lists(state, json) {
class: 'search'
}, "Search: %s".format(state.query));
li.setAttribute("data-url", state.url);
- li.setAttribute("data-list", "%s@%s".format(current_list, current_domain));
li.setAttribute("data-href", location.href);
lists.inject(li);
}
@@ -3781,13 +3780,27 @@ function search(query, date) {
list = '*';
global = true;
}
+
+ let listid = '%s@%s'.format(list, domain);
+ let newhref = "list?%s:%s:%s".format(listid, date, query);
+
+ let header_from = document.getElementById('header_from');
+ let header_subject = document.getElementById('header_subject');
let sURL = '%sapi/stats.lua?d=%s&list=%s&domain=%s&q=%s'.format(apiURL, date, list, domain, query);
+ if (header_from.value.length > 0) {
+ sURL += "&header_from=%s".format(encodeURIComponent(header_from.value));
+ newhref += "&header_from=%s".format(header_from.value);
+ header_from.value = "";
+ }
+ if (header_subject.value.length > 0) {
+ sURL += "&header_subject=%s".format(encodeURIComponent(header_subject.value));
+ newhref += "&header_subject=%s".format(header_subject.value);
+ header_subject.value = "";
+ }
GET(sURL, renderListView, {
search: true,
global: global
});
- let listid = '%s@%s'.format(list, domain);
- let newhref = "list?%s:%s:%s".format(listid, date, query);
if (location.href !== newhref) {
window.history.pushState({}, null, newhref);
}
@@ -3976,10 +3989,17 @@ function calendar_click(year, month) {
let q = "";
let calendar_current_list = current_list;
let calendar_current_domain = current_domain;
- if (current_json && current_json.searchParams && current_json.searchParams.q) {
- q = current_json.searchParams.q;
+ if (current_json && current_json.searchParams) {
+ q = current_json.searchParams.q || "";
calendar_current_list = current_json.searchParams.list;
calendar_current_domain = current_json.searchParams.domain;
+ // Weave in header parameters
+ for (let key of Object.keys((current_json.searchParams || {}))) {
+ if (key.match(/^header_/)) {
+ let value = current_json.searchParams[key];
+ q += `&${key}=${value}`;
+ }
+ }
}
let newhref = "list?%s@%s:%u-%u".format(calendar_current_list, calendar_current_domain, year, month);
if (q && q.length > 0) newhref += ":" + q;
[incubator-ponymail-foal] 01/03: remove regression
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 7cf064f2a1ac050812e0ac9277d7a254642c8c34
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Sep 21 18:59:12 2021 -0500
remove regression
---
webui/js/source/listview-header.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/webui/js/source/listview-header.js b/webui/js/source/listview-header.js
index 6b5c17a..f9131fb 100644
--- a/webui/js/source/listview-header.js
+++ b/webui/js/source/listview-header.js
@@ -230,7 +230,6 @@ function listview_list_lists(state, json) {
class: 'search'
}, "Search: %s".format(state.query));
li.setAttribute("data-url", state.url);
- li.setAttribute("data-list", "%s@%s".format(current_list, current_domain));
li.setAttribute("data-href", location.href);
lists.inject(li);
}