diff --git a/web/app/static/js/modules/corpus_analysis/client/Client.js b/web/app/static/js/modules/corpus_analysis/client/Client.js index 2d94121fd886a1e2716c480ca66331bc699d5c68..bd1ac2eea86bf5774644ad05cabadca8a7447422 100644 --- a/web/app/static/js/modules/corpus_analysis/client/Client.js +++ b/web/app/static/js/modules/corpus_analysis/client/Client.js @@ -127,7 +127,7 @@ class Client { objectKey = 'fullResultsData'; } else if (resultsType === 'sub-results') { objectKey = 'subResultsData'; - } else if (resultsType = 'inspect-results') { + } else if (resultsType === 'inspect-results') { objectKey = 'inspectResultsData'; } // Delete old data before new data is coming in. diff --git a/web/app/static/js/modules/corpus_analysis/client/callbacks.js b/web/app/static/js/modules/corpus_analysis/client/callbacks.js index 7420747884d5ea38ced573f61ddbbbf81d0ed1ef..52d5d61af232893be56cf401595d9ccfbe40d4c3 100644 --- a/web/app/static/js/modules/corpus_analysis/client/callbacks.js +++ b/web/app/static/js/modules/corpus_analysis/client/callbacks.js @@ -123,8 +123,8 @@ function saveResultsData() { // Notify view to update progress bar client.notifyView('results-data-recieving', {type: type, progress: payload.progress}) - client.isBusy = false; if (payload.progress === 100) { + client.isBusy = false; if (objectKey === 'fullResultsData') { // Get match count per text from results.data only for fullResultsData results[objectKey].text_lookup = results.data.text_lookup; diff --git a/web/app/static/js/modules/corpus_analysis/model/Results.js b/web/app/static/js/modules/corpus_analysis/model/Results.js index 41dc319d0067dd05bebda5e615bdbf207d6adee5..2d1ab7df1e66dc6fb2e6317e1a1abf0a10e97cfe 100644 --- a/web/app/static/js/modules/corpus_analysis/model/Results.js +++ b/web/app/static/js/modules/corpus_analysis/model/Results.js @@ -7,12 +7,12 @@ // Results class bundleing the different data objects. class Results { constructor() { - this.data = new Data(); - this.metaData = new MetaData(); - this.fullResultsData = new Data(); - this.subResultsData = new Data(); - this.inspectResultsData = new Data(); - console.info('Initialized the Results object.'); + this.data = new Data(); + this.metaData = new MetaData(); + this.fullResultsData = new Data(); + this.subResultsData = new Data(); + this.inspectResultsData = new Data(); + console.info('Initialized the Results object.'); } // Reset all the data objects in the results class and thus emptying them. diff --git a/web/app/static/js/modules/corpus_analysis/view/ResultsView.js b/web/app/static/js/modules/corpus_analysis/view/ResultsView.js index 6fc440f947f067bffb5323b42a50d176f9d67370..b799ff2b92ce613572e349e9ca3db4a3865673fb 100644 --- a/web/app/static/js/modules/corpus_analysis/view/ResultsView.js +++ b/web/app/static/js/modules/corpus_analysis/view/ResultsView.js @@ -58,20 +58,11 @@ class ResultsList extends List { this.notificationListeners = {}; this.knownHTMLElements = new Set(); } - - /** - * // TODO: - * Init function that gets all needed HTML Elements. Implement this, or not? - * Or build a check into the get HTMLElements function if element already exists. - * Also think about saving alle elements in resultsList.es.nameOfElement - */ - /** * Function to clear/reset some class field values. Usefull if a new query * hase been issued by the user. */ resetFields() { - this.addToSubResultsIdsToShow = new Set(); this.addToSubResultsStatus = {}; this.subResultsIndexes = {}; } diff --git a/web/app/static/js/modules/corpus_analysis/view/callbacks.js b/web/app/static/js/modules/corpus_analysis/view/callbacks.js index a29143d7b35b9786450cad048987ee9b8049f584..6090ad49b7c80874154541fa8322642b79ee0f8f 100644 --- a/web/app/static/js/modules/corpus_analysis/view/callbacks.js +++ b/web/app/static/js/modules/corpus_analysis/view/callbacks.js @@ -82,7 +82,7 @@ function queryDataPreparingCallback(resultsList, detail) { '#query-results-create', '#sub-results-indexes-display', '#nr-marked-matches', - ]); + ]); // show or enable some things for the user resultsList.interactionsMenu.classList.toggle('hide', false); resultsList.queryResultsUserFeedback.classList.toggle('hide', false); diff --git a/web/app/static/js/modules/corpus_analysis/view/eventListeners.js b/web/app/static/js/modules/corpus_analysis/view/eventListeners.js index 6c40cafcb449f2c569ddac14dc46b1cc9d53e7eb..2316505727a7ac25296ede89f101b56a8ca5a710 100644 --- a/web/app/static/js/modules/corpus_analysis/view/eventListeners.js +++ b/web/app/static/js/modules/corpus_analysis/view/eventListeners.js @@ -181,13 +181,13 @@ function createFullResults(resultsList, results) { resultsList.fullResultsCreate.innerText = 'Creating...'; resultsList.fullResultsCreate.insertAdjacentHTML('afterbegin', loadingSpinnerHTML); + // .keys() is for a zero based array. I think... let dataIndexes = [...Array(results.data.match_count).keys()]; // Empty fullResultsData so that no previous data is used. results.fullResultsData.init(); - resultsList.notifyClient('get-results', { resultsType: 'full-results', - dataIndexes: dataIndexes, - resultsList: resultsList, - }); + resultsList.notifyClient('get-results', {resultsType: 'full-results', + dataIndexes: dataIndexes, + resultsList: resultsList,}); } } @@ -204,10 +204,9 @@ function createSubResults(resultsList, results) { loadingSpinnerHTML); // Empty subResultsData so that no previous data is used. results.subResultsData.init(); - resultsList.notifyClient('get-results', { resultsType: 'sub-results', - dataIndexes: dataIndexes, - resultsList: resultsList, - }); + resultsList.notifyClient('get-results', {resultsType: 'sub-results', + dataIndexes: dataIndexes, + resultsList: resultsList,}); } } // 3. Open download modal when full results export button is pressed diff --git a/web/app/templates/corpora/analyse_corpus.html.j2 b/web/app/templates/corpora/analyse_corpus.html.j2 index 1ee776d41b9e88297e14e651b7cdee8a099f2fa0..7681495d3c744c5a2d3ea41d376f4c72238d1922 100644 --- a/web/app/templates/corpora/analyse_corpus.html.j2 +++ b/web/app/templates/corpora/analyse_corpus.html.j2 @@ -43,6 +43,7 @@ <div class="card-content" id="result-list" style="overflow: hidden;"> <div id="interactions-menu" class="row hide" style="margin-bottom: 0px;"> + {# Importing menus for query settings, export etc. #} {% include 'interactions/infos.html.j2' %} {% include 'interactions/export.html.j2' %} {% include 'interactions/create.html.j2' %} diff --git a/web/app/templates/interactions/infos.html.j2 b/web/app/templates/interactions/infos.html.j2 index 47e94d8f4697a96a7b45b809793af03db69cef5b..7a9eafe8a17edf7abd6179a5c7500369db12a126 100644 --- a/web/app/templates/interactions/infos.html.j2 +++ b/web/app/templates/interactions/infos.html.j2 @@ -6,16 +6,6 @@ result.--> <h6 style="margin-top: 0px;">Infos</h6> <div class="divider" style="margin-bottom: 10px;"></div> <div class="row"> - <div class="col s12"> - <button id="show-meta-data" - class="waves-effect - waves-light - btn-flat - flat-interaction" - type="submit">Corpus Meta Data - <i class="material-icons left">info_outline</i> - </button> - </div> <div class="col s12"> <button id="loading-matches" class="waves-effect @@ -36,6 +26,16 @@ result.--> <div class="determinate"></div> </div> </div> + <div class="col s12"> + <button id="show-meta-data" + class="waves-effect + waves-light + btn-flat + flat-interaction" + type="submit">Corpus Meta Data + <i class="material-icons left">info_outline</i> + </button> + </div> <div class="col s12"> <button id="show-corpus-files" class="waves-effect