diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2025-03-27 22:10:16 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2025-03-27 22:22:34 +0300 |
| commit | 49766ab01f24d1be5743c353b9a6d4d09f55f5b8 (patch) | |
| tree | 7292492a179930bb376869fbd3824d2e7f672327 /js | |
| parent | c1e6a5ff634c46a0df3fb8d7a21bd3db96be5a69 (diff) | |
filter test dialog improvements:
- properly return results for filter rules matching specific feeds or
categories
- fix test results never returned for Uncategorized
- show tooltip with specific word match and matched rule on resulting
item hover
Diffstat (limited to 'js')
| -rw-r--r-- | js/CommonFilters.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/js/CommonFilters.js b/js/CommonFilters.js index b7bb69a15..83bc4cae9 100644 --- a/js/CommonFilters.js +++ b/js/CommonFilters.js @@ -19,6 +19,9 @@ const Filters = { ACTION_REMOVE_TAG: 10, PARAM_ACTIONS: [4, 6, 7, 9, 10], filter_info: {}, + formatMatchedRules: function(rules) { + return rules.map((r) => r.regexp_matches[0] + ' - ' + r.reg_exp).join('\n'); + }, test: function() { const test_dialog = new fox.SingleUseDialog({ title: "Test Filter", @@ -43,8 +46,8 @@ const Filters = { .replace("%f", test_dialog.results) .replace("%d", offset); - results_list.innerHTML += result.items.reduce((current, item) => current + `<li><span class='title'>${item.title}</span><br> - <span class='feed'>${item.feed_title}</span>, <span class='date'>${item.date}</span> + results_list.innerHTML += result.items.reduce((current, item) => current + `<li title="${App.escapeHtml(dialog.formatMatchedRules(item.matched_rules))}"><span class='title'>${item.title}</span> + — <span class='feed'>${item.feed_title}</span>, <span class='date'>${item.date}</span> <div class='preview text-muted'>${item.content_preview}</div></li>`, ''); // get the next batch if there may be more available and testing limits haven't been reached |