From 82bed1e651ca002cae3a0790aadd914ad7597386 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 17 Mar 2021 08:45:04 +0300 Subject: filter test dialog: remove .gif; cleanup markup --- js/CommonFilters.js | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'js/CommonFilters.js') diff --git a/js/CommonFilters.js b/js/CommonFilters.js index 1450458f8..8a20480f0 100644 --- a/js/CommonFilters.js +++ b/js/CommonFilters.js @@ -38,16 +38,19 @@ const Filters = { console.log("got results:" + result.length); - App.byId("prefFilterProgressMsg").innerHTML = __("Looking for articles (%d processed, %f found)...") - .replace("%f", test_dialog.results) - .replace("%d", offset); + const loading_message = test_dialog.domNode.querySelector(".loading-message"); + const results_list = test_dialog.domNode.querySelector(".filter-results-list"); + + loading_message.innerHTML = __("Looking for articles (%d processed, %f found)...") + .replace("%f", test_dialog.results) + .replace("%d", offset); console.log(offset + " " + test_dialog.max_offset); for (let i = 0; i < result.length; i++) { - const tmp = dojo.create("table", { innerHTML: result[i]}); + const tmp = dojo.create("div", { innerHTML: result[i]}); - App.byId("prefFilterTestResultList").innerHTML += tmp.innerHTML; + results_list.innerHTML += tmp.innerHTML; } if (test_dialog.results < 30 && offset < test_dialog.max_offset) { @@ -60,14 +63,15 @@ const Filters = { } else { // all done - Element.hide("prefFilterLoadingIndicator"); + test_dialog.domNode.querySelector(".loading-indicator").hide(); if (test_dialog.results == 0) { - App.byId("prefFilterTestResultList").innerHTML = ` - ${__('No recent articles matching this filter have been found.')}`; - App.byId("prefFilterProgressMsg").innerHTML = "Articles matching this filter:"; + results_list.innerHTML = `
  • + ${__('No recent articles matching this filter have been found.')}
  • `; + + loading_message.innerHTML = __("Articles matching this filter:"); } else { - App.byId("prefFilterProgressMsg").innerHTML = __("Found %d articles matching this filter:") + loading_message.innerHTML = __("Found %d articles matching this filter:") .replace("%d", test_dialog.results); } @@ -75,7 +79,7 @@ const Filters = { } else if (!result) { console.log("getTestResults: can't parse results object"); - Element.hide("prefFilterLoadingIndicator"); + test_dialog.domNode.querySelector(".loading-indicator").hide(); Notify.error("Error while trying to get filter test results."); } else { console.log("getTestResults: dialog closed, bailing out."); @@ -86,12 +90,12 @@ const Filters = { }); }, content: ` -
    -   - Looking for articles... +
    + + ${__("Looking for articles...")}
    - +