mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 12:22:47 +00:00 
			
		
		
		
	Query Builder fixes
This commit is contained in:
		@@ -162,9 +162,21 @@ class ConcordanceQueryBuilder {
 | 
				
			|||||||
    this.elements.or.addEventListener('click', () => {this.orHandler();});
 | 
					    this.elements.or.addEventListener('click', () => {this.orHandler();});
 | 
				
			||||||
    this.elements.and.addEventListener('click', () => {this.andHandler();});
 | 
					    this.elements.and.addEventListener('click', () => {this.andHandler();});
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  
 | 
					 | 
				
			||||||
    //#endregion Token Attribute Event Listeners
 | 
					    //#endregion Token Attribute Event Listeners
 | 
				
			||||||
 | 
					    let selectInstances = this.elements.concordanceQueryBuilder.querySelectorAll('select');
 | 
				
			||||||
 | 
					    M.FormSelect.init(
 | 
				
			||||||
 | 
					      selectInstances,
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        dropdownOptions: {
 | 
				
			||||||
 | 
					          alignment: 'bottom',
 | 
				
			||||||
 | 
					          coverTrigger: false
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					    let dropdownContents = this.elements.concordanceQueryBuilder.querySelectorAll('.dropdown-content');
 | 
				
			||||||
 | 
					    dropdownContents.forEach((dropdownContent) => {
 | 
				
			||||||
 | 
					      dropdownContent.style.paddingBottom = '15px';
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -182,6 +194,7 @@ class ConcordanceQueryBuilder {
 | 
				
			|||||||
  
 | 
					  
 | 
				
			||||||
  showPositionalAttrArea() {
 | 
					  showPositionalAttrArea() {
 | 
				
			||||||
    this.elements.positionalAttrArea.classList.remove('hide');
 | 
					    this.elements.positionalAttrArea.classList.remove('hide');
 | 
				
			||||||
 | 
					    this.elements.structuralAttrArea.classList.add('hide');
 | 
				
			||||||
    this.wordBuilder();
 | 
					    this.wordBuilder();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    this.elements.tokenQueryFilled = false;
 | 
					    this.elements.tokenQueryFilled = false;
 | 
				
			||||||
@@ -275,7 +288,7 @@ class ConcordanceQueryBuilder {
 | 
				
			|||||||
  queryPreviewBuilder() {
 | 
					  queryPreviewBuilder() {
 | 
				
			||||||
    this.elements.yourQueryContent = [];
 | 
					    this.elements.yourQueryContent = [];
 | 
				
			||||||
    for (let element of this.elements.yourQuery.childNodes) {
 | 
					    for (let element of this.elements.yourQuery.childNodes) {
 | 
				
			||||||
      let queryElement = decodeURI(element.dataset.query);
 | 
					      let queryElement = element.dataset.query;
 | 
				
			||||||
      queryElement = Utils.escape(queryElement);
 | 
					      queryElement = Utils.escape(queryElement);
 | 
				
			||||||
      if (queryElement !== 'undefined') {
 | 
					      if (queryElement !== 'undefined') {
 | 
				
			||||||
        this.elements.yourQueryContent.push(queryElement);
 | 
					        this.elements.yourQueryContent.push(queryElement);
 | 
				
			||||||
@@ -307,7 +320,7 @@ class ConcordanceQueryBuilder {
 | 
				
			|||||||
    this.validateValue();
 | 
					    this.validateValue();
 | 
				
			||||||
    if (this.elements.valueValidator) {
 | 
					    if (this.elements.valueValidator) {
 | 
				
			||||||
      for (let element of this.elements.yourQuery.childNodes) {
 | 
					      for (let element of this.elements.yourQuery.childNodes) {
 | 
				
			||||||
        let queryElement = decodeURI(element.dataset.query);
 | 
					        let queryElement = element.dataset.query;
 | 
				
			||||||
        if (queryElement !== 'undefined') {
 | 
					        if (queryElement !== 'undefined') {
 | 
				
			||||||
          this.elements.yourQueryContent.push(queryElement);
 | 
					          this.elements.yourQueryContent.push(queryElement);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -633,8 +646,11 @@ class ConcordanceQueryBuilder {
 | 
				
			|||||||
  englishPosHandler() {
 | 
					  englishPosHandler() {
 | 
				
			||||||
    this.hideEverything();
 | 
					    this.hideEverything();
 | 
				
			||||||
    this.elements.englishPosBuilder.classList.remove('hide');
 | 
					    this.elements.englishPosBuilder.classList.remove('hide');
 | 
				
			||||||
    // this.elements.incidenceModifiersButton.classList.remove('hide');
 | 
					    this.elements.incidenceModifiersButton.classList.remove('hide');
 | 
				
			||||||
    this.elements.conditionContainer.classList.remove('hide');
 | 
					    this.elements.conditionContainer.classList.remove('hide');
 | 
				
			||||||
 | 
					    this.elements.incidenceModifiersButton.firstElementChild.classList.remove('disabled');
 | 
				
			||||||
 | 
					    this.elements.or.classList.remove('disabled');
 | 
				
			||||||
 | 
					    this.elements.and.classList.remove('disabled');
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    // Resets materialize select dropdown
 | 
					    // Resets materialize select dropdown
 | 
				
			||||||
    let selectInstance = M.FormSelect.getInstance(this.elements.englishPos);
 | 
					    let selectInstance = M.FormSelect.getInstance(this.elements.englishPos);
 | 
				
			||||||
@@ -645,8 +661,11 @@ class ConcordanceQueryBuilder {
 | 
				
			|||||||
  germanPosHandler() {
 | 
					  germanPosHandler() {
 | 
				
			||||||
    this.hideEverything();
 | 
					    this.hideEverything();
 | 
				
			||||||
    this.elements.germanPosBuilder.classList.remove('hide');
 | 
					    this.elements.germanPosBuilder.classList.remove('hide');
 | 
				
			||||||
    // this.elements.incidenceModifiersButton.classList.remove('hide');
 | 
					    this.elements.incidenceModifiersButton.classList.remove('hide');
 | 
				
			||||||
    this.elements.conditionContainer.classList.remove('hide');
 | 
					    this.elements.conditionContainer.classList.remove('hide');
 | 
				
			||||||
 | 
					    this.elements.incidenceModifiersButton.firstElementChild.classList.remove('disabled');
 | 
				
			||||||
 | 
					    this.elements.or.classList.remove('disabled');
 | 
				
			||||||
 | 
					    this.elements.and.classList.remove('disabled');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Resets materialize select dropdown
 | 
					    // Resets materialize select dropdown
 | 
				
			||||||
    let selectInstance = M.FormSelect.getInstance(this.elements.germanPos);
 | 
					    let selectInstance = M.FormSelect.getInstance(this.elements.germanPos);
 | 
				
			||||||
@@ -657,14 +676,27 @@ class ConcordanceQueryBuilder {
 | 
				
			|||||||
  simplePosBuilder() {
 | 
					  simplePosBuilder() {
 | 
				
			||||||
  this.hideEverything();
 | 
					  this.hideEverything();
 | 
				
			||||||
  this.elements.simplePosBuilder.classList.remove('hide');
 | 
					  this.elements.simplePosBuilder.classList.remove('hide');
 | 
				
			||||||
  // this.elements.incidenceModifiersButton.classList.remove('hide');
 | 
					  this.elements.incidenceModifiersButton.classList.remove('hide');
 | 
				
			||||||
  this.elements.conditionContainer.classList.remove('hide');
 | 
					  this.elements.conditionContainer.classList.remove('hide');
 | 
				
			||||||
  this.elements.simplePos.selectedIndex = 0;
 | 
					  this.elements.simplePos.selectedIndex = 0;
 | 
				
			||||||
 | 
					  this.elements.incidenceModifiersButton.firstElementChild.classList.remove('disabled');
 | 
				
			||||||
 | 
					  this.elements.or.classList.remove('disabled');
 | 
				
			||||||
 | 
					  this.elements.and.classList.remove('disabled');
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  // Resets materialize select dropdown
 | 
					  // Resets materialize select dropdown
 | 
				
			||||||
  let selectInstance = M.FormSelect.getInstance(this.elements.simplePos);
 | 
					  let selectInstance = M.FormSelect.getInstance(this.elements.simplePos);
 | 
				
			||||||
  selectInstance.input.value = 'simple_pos tagset';
 | 
					  selectInstance.input.value = 'simple_pos tagset';
 | 
				
			||||||
  this.elements.simplePos.value = 'default';
 | 
					  this.elements.simplePos.value = 'default';
 | 
				
			||||||
 | 
					  M.FormSelect.init(
 | 
				
			||||||
 | 
					    selectInstance,
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      dropdownOptions: {
 | 
				
			||||||
 | 
					        direction: 'bottom',
 | 
				
			||||||
 | 
					        coverTrigger: false
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  emptyTokenHandler() {
 | 
					  emptyTokenHandler() {
 | 
				
			||||||
@@ -672,6 +704,8 @@ class ConcordanceQueryBuilder {
 | 
				
			|||||||
    this.elements.tokenQueryFilled = true;
 | 
					    this.elements.tokenQueryFilled = true;
 | 
				
			||||||
    this.hideEverything();
 | 
					    this.hideEverything();
 | 
				
			||||||
    this.elements.incidenceModifiersButton.classList.remove('hide');
 | 
					    this.elements.incidenceModifiersButton.classList.remove('hide');
 | 
				
			||||||
 | 
					    this.elements.incidenceModifiersButton.firstElementChild.classList.remove('disabled');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  //#endregion Dropdown Select Handler
 | 
					  //#endregion Dropdown Select Handler
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
@@ -687,7 +721,7 @@ class ConcordanceQueryBuilder {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (elem === this.elements.optionGroup) {
 | 
					    if (elem === this.elements.optionGroup) {
 | 
				
			||||||
      input.value  += '( option1 | option2 )';
 | 
					      input.value  += '(option1|option2)';
 | 
				
			||||||
      let firstIndex = input.value.indexOf('option1');
 | 
					      let firstIndex = input.value.indexOf('option1');
 | 
				
			||||||
      let lastIndex = firstIndex + 'option1'.length;
 | 
					      let lastIndex = firstIndex + 'option1'.length;
 | 
				
			||||||
      input.focus();
 | 
					      input.focus();
 | 
				
			||||||
@@ -695,6 +729,7 @@ class ConcordanceQueryBuilder {
 | 
				
			|||||||
    } else if (elem === this.elements.wildcardChar) {
 | 
					    } else if (elem === this.elements.wildcardChar) {
 | 
				
			||||||
      input.value  += '.';
 | 
					      input.value  += '.';
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    this.inputFieldHandler();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  nSubmitHandler() {
 | 
					  nSubmitHandler() {
 | 
				
			||||||
@@ -808,8 +843,7 @@ class ConcordanceQueryBuilder {
 | 
				
			|||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        input =  this.elements.lemmaInput;
 | 
					        input =  this.elements.lemmaInput;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					      input.value += elem.dataset.token;
 | 
				
			||||||
      input.value += ' ' + elem.dataset.token;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -439,6 +439,10 @@ Query your corpus with the CQP query language utilizing a KWIC view.
 | 
				
			|||||||
                    <option value="VVINF">infinitive, full</option>
 | 
					                    <option value="VVINF">infinitive, full</option>
 | 
				
			||||||
                    <option value="VVIZU">infinitive with "zu", full</option>
 | 
					                    <option value="VVIZU">infinitive with "zu", full</option>
 | 
				
			||||||
                    <option value="VVPP">perfect participle, full</option>
 | 
					                    <option value="VVPP">perfect participle, full</option>
 | 
				
			||||||
 | 
					                    <option value="XY">non-word containing non-letter</option>
 | 
				
			||||||
 | 
					                    <option value="$(">other sentence-internal punctuation mark</option>
 | 
				
			||||||
 | 
					                    <option value="$,">comma</option>
 | 
				
			||||||
 | 
					                    <option value="$.">sentence-final punctuation mark</option>
 | 
				
			||||||
                  </select>
 | 
					                  </select>
 | 
				
			||||||
                  <label>Part-of-speech tags</label>
 | 
					                  <label>Part-of-speech tags</label>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user