use server-side localized formatting for matching rule to display as a tooltip (for now)

This commit is contained in:
Andrew Dolgov
2025-03-30 20:41:50 +03:00
parent b4962b670d
commit 2d041f7d28
2 changed files with 11 additions and 14 deletions

View File

@@ -19,9 +19,6 @@ const Filters = {
ACTION_REMOVE_TAG: 10,
PARAM_ACTIONS: [4, 6, 7, 9, 10],
filter_info: {},
formatMatchedRules: function(rules) {
return rules.map((r) => r.reg_exp + ' (' + r.type + ')').join('\n');
},
test: function() {
const test_dialog = new fox.SingleUseDialog({
title: "Test Filter",
@@ -46,7 +43,7 @@ const Filters = {
.replace("%f", test_dialog.results)
.replace("%d", offset);
results_list.innerHTML += result.items.reduce((current, item) => current + `<li title="${App.escapeHtml(dialog.formatMatchedRules(item.rules))}"><span class='title'>${item.title}</span>
results_list.innerHTML += result.items.reduce((current, item) => current + `<li title="${App.escapeHtml(item.rules.join('\n'))}"><span class='title'>${item.title}</span>
&mdash; <span class='feed'>${item.feed_title}</span>, <span class='date'>${item.date}</span>
<div class='preview text-muted'>${item.content_preview}</div></li>`, '');