diff --git a/web/app/templates/corpora/analyse_corpus.html.j2 b/web/app/templates/corpora/analyse_corpus.html.j2 index 691b28f1..c0412425 100644 --- a/web/app/templates/corpora/analyse_corpus.html.j2 +++ b/web/app/templates/corpora/analyse_corpus.html.j2 @@ -223,6 +223,7 @@ document.addEventListener("DOMContentLoaded", () => { '#query-results-table', '#display-options-form-expert_mode', '.pagination', + '#inspect-results-export', ]); /** @@ -313,6 +314,7 @@ document.addEventListener("DOMContentLoaded", () => { * 2. Create sub-results * 3. Download full-results * 4. Download sub-results + * 5. Download single inspect-results */ resultsList.fullResultsCreate.onclick = () => { resultsList.fullResultsCreate.querySelector('i').classList.toggle('hide'); @@ -336,7 +338,7 @@ document.addEventListener("DOMContentLoaded", () => { dataIndexes: dataIndexes}); } /** - * Before the downland events are added the needed modal is initialized. + * Before the download events are added the needed modal is initialized. */ resultsList.queryResultsDownloadModal = M.Modal.init(resultsList.queryResultsDownloadModal); // Open download modal when full results export button is pressed @@ -346,7 +348,8 @@ document.addEventListener("DOMContentLoaded", () => { resultsList.downloadResultsJson.onclick = () => { let filename = results.fullResultsData.createDownloadFilename('full-results'); results.fullResultsData.addData(results.metaData); - results.fullResultsData.downloadJSONRessource(filename, results.fullResultsData, + results.fullResultsData.downloadJSONRessource(filename, + results.fullResultsData, resultsList.downloadResultsJson)}; } // Open download modal when sub results export button is pressed @@ -356,7 +359,19 @@ document.addEventListener("DOMContentLoaded", () => { resultsList.downloadResultsJson.onclick = () => { let filename = results.subResultsData.createDownloadFilename('sub-results'); results.subResultsData.addData(results.metaData); - results.subResultsData.downloadJSONRessource(filename, results.subResultsData, + results.subResultsData.downloadJSONRessource(filename, + results.subResultsData, + resultsList.downloadResultsJson)}; + } + // Open download modal when inspect-results-export button is pressed + resultsList.inspectResultsExport.onclick = () => { + resultsList.queryResultsDownloadModal.open(); + // add onclick to download JSON button and download the file + resultsList.downloadResultsJson.onclick = () => { + let filename = results.subResultsData.createDownloadFilename('inspect-results'); + results.subResultsData.addData(results.metaData); + results.subResultsData.downloadJSONRessource(filename, + results.inspectResultsData, resultsList.downloadResultsJson)}; } diff --git a/web/app/templates/modals/context_modal.html.j2 b/web/app/templates/modals/context_modal.html.j2 index 2b57a83e..320a18ee 100644 --- a/web/app/templates/modals/context_modal.html.j2 +++ b/web/app/templates/modals/context_modal.html.j2 @@ -67,7 +67,7 @@