QueryBuilder 1.1

This commit is contained in:
Inga Kirschnick 2022-09-07 14:22:59 +02:00
parent d537a38712
commit f09403e61d

View File

@ -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) {