diff --git a/app/static/js/nopaque.CorpusAnalysisClient.js b/app/static/js/nopaque.CorpusAnalysisClient.js index 60e57369..268ba048 100644 --- a/app/static/js/nopaque.CorpusAnalysisClient.js +++ b/app/static/js/nopaque.CorpusAnalysisClient.js @@ -5,7 +5,7 @@ class CorpusAnalysisClient { this.displays = {}; this.socket = socket; - // socket on event fpr corpous analysis initialization + // socket on event for corpous analysis initialization socket.on("corpus_analysis_init", (response) => { var errorText; @@ -20,7 +20,8 @@ class CorpusAnalysisClient { } else { errorText = `Error ${response.code} - ${response.msg}`; if (this.displays.init.errorContainer != undefined) { - this.displays.init.errorContainer.innerHTML = `
error ${errorText}
`; + this.displays.init.errorContainer.innerHTML = `` + + `error ${errorText}
`; } if (this.displays.init != undefined) { this.displays.init.setVisibilityByStatus("error"); @@ -45,7 +46,8 @@ class CorpusAnalysisClient { errorText = `Error ${response.payload.code} - ${response.payload.msg}`; nopaque.flash("error", errorText); if (this.displays.query.errorContainer != undefined) { - this.displays.query.errorContainer.innerHTML = `error ${errorText}
`; + this.displays.query.errorContainer.innerHTML = ``+ + `error ${errorText}
`; } if (this.displays.query != undefined) { this.displays.query.setVisibilityByStatus("error"); @@ -54,13 +56,18 @@ class CorpusAnalysisClient { } }); + socket.on("corpus_analysis_query_results", (response) => { - if (this.callbacks.query_results != undefined) {this.callbacks.query_results(response.payload);} + if (this.callbacks.query_results != undefined) { + this.callbacks.query_results(response.payload); + } }); - // TODO: set callback for this - // get context of one match if inspected via socket.io - socket.on("corpus_analysis_inspect_match", (response) => { results.resultsList.showMatchContext(response)}); + socket.on("corpus_analysis_inspect_match", (response) => { + if (this.callbacks.query_match_context != undefined) { + this.callbacks.query_match_context(response); + } + }); } init() { diff --git a/app/static/js/nopaque.lists.js b/app/static/js/nopaque.lists.js index 74641fe6..2313b9a3 100644 --- a/app/static/js/nopaque.lists.js +++ b/app/static/js/nopaque.lists.js @@ -129,8 +129,11 @@ RessourceList.options = { class ResultsList extends List { constructor(idOrElement, options={}) { super(idOrElement, options); - this.eventTokens = {}; // all span tokens which are holdeing events if expert mode is on - this.currentExpertTokenElements = {}; + this.eventTokens = {}; // all span tokens which are holdeing events if expert + // mode is on. Collected here to delete later on + this.currentExpertTokenElements = {}; // all token elements which have added + // classes like chip and hoverable for expert view. Collected + //here to delete later on } @@ -261,8 +264,8 @@ class ResultsList extends List { tokenHTMlElement = this.HTMLTStrToElement(htmlTokenStr) tokenHTMLArray.push(tokenHTMlElement); } - console.log(tokenHTMLArray); - console.log(uniqueS); + // console.log(tokenHTMLArray); + // console.log(uniqueS); for (let sId of uniqueS) { let htmlSentence = ``; @@ -297,7 +300,7 @@ class ResultsList extends List { }; nrOfContextSentences.onchange = (event) => { - console.log(event.target.value); + // console.log(event.target.value); this.changeSentenceContext(event.target.value); } @@ -340,7 +343,7 @@ class ResultsList extends List { let toHideArray; let toShowArray; sValue = maxSValue - sValue; - console.log(sValue); + // console.log(sValue); sentences = document.getElementById("context-results").getElementsByClassName("sentence"); array = Array.from(sentences); if (sValue != 0) { @@ -350,9 +353,9 @@ class ResultsList extends List { toHideArray = []; toShowArray = array; } - console.log(array); - console.log("#######"); - console.log(toHideArray); + // console.log(array); + // console.log("#######"); + // console.log(toHideArray); for (let s of toHideArray) { s.classList.add("hide"); } diff --git a/app/templates/corpora/analyse_corpus.html.j2 b/app/templates/corpora/analyse_corpus.html.j2 index d1764a32..53502a6a 100644 --- a/app/templates/corpora/analyse_corpus.html.j2 +++ b/app/templates/corpora/analyse_corpus.html.j2 @@ -26,7 +26,8 @@ {{ query_form.query.label }} - help + help + CQP query language tutorial @@ -49,10 +50,12 @@