stop sending matched content twice for the tooltip, use smaller objects containing only regular expression and rule type
This commit is contained in:
@@ -20,7 +20,7 @@ const Filters = {
|
||||
PARAM_ACTIONS: [4, 6, 7, 9, 10],
|
||||
filter_info: {},
|
||||
formatMatchedRules: function(rules) {
|
||||
return rules.map((r) => r.regexp_matches[0] + ' - ' + r.reg_exp + ' (' + r.type + ')').join('\n');
|
||||
return rules.map((r) => r.reg_exp + ' (' + r.type + ')').join('\n');
|
||||
},
|
||||
test: function() {
|
||||
const test_dialog = new fox.SingleUseDialog({
|
||||
@@ -46,7 +46,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.matched_rules))}"><span class='title'>${item.title}</span>
|
||||
results_list.innerHTML += result.items.reduce((current, item) => current + `<li title="${App.escapeHtml(dialog.formatMatchedRules(item.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>`, '');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user