diff --git a/app/static/js/CorpusAnalysis/QueryBuilder.js b/app/static/js/CorpusAnalysis/QueryBuilder.js index d36dd9f3..881bd5aa 100644 --- a/app/static/js/CorpusAnalysis/QueryBuilder.js +++ b/app/static/js/CorpusAnalysis/QueryBuilder.js @@ -726,6 +726,41 @@ class ConcordanceQueryBuilder { nmSubmitHandler() { let instance = M.Modal.getInstance(this.elements.betweenNM); instance.close(); + + switch (this.elements.positionalAttr.value) { + case "word": + this.elements.wordInput.value += `{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`; + break; + case "lemma": + this.elements.lemmaInput.value += `{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`; + break; + case "english-pos": + this.elements.tokenQueryFilled = true; + this.tokenButtonfactory(`pos=${this.elements.englishPos.value}`, `pos="${this.elements.englishPos.value}"`); + this.tokenButtonfactory(`{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`, `{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`); + this.elements.englishPosBuilder.classList.add("hide"); + this.elements.incidenceModifiersButton.classList.add("hide"); + break; + case "german-pos": + this.elements.tokenQueryFilled = true; + this.tokenButtonfactory(`pos=${this.elements.germanPos.value}`, `pos="${this.elements.germanPos.value}"`); + this.tokenButtonfactory(`{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`, `{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`); + this.elements.germanPosBuilder.classList.add("hide"); + this.elements.incidenceModifiersButton.classList.add("hide"); + break; + case "simple-pos-button": + this.elements.tokenQueryFilled = true; + this.tokenButtonfactory(`simple_pos=${this.elements.simplePos.value}`, `simple_pos="${this.elements.simplePos.value}"`); + this.tokenButtonfactory(`{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`, `{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`); + this.elements.simplePosBuilder.classList.add("hide"); + this.elements.incidenceModifiersButton.classList.add("hide"); + break; + case "empty-token": + this.tokenButtonfactory(`{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`, `{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`); + break; + default: + break; + } } incidenceModifiersHandler(elem) {