mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +00:00
Bug fix
This commit is contained in:
parent
3d38e550a0
commit
8a5c94f448
@ -32,7 +32,9 @@ class CorpusAnalysisConcordance {
|
|||||||
|
|
||||||
async submitForm() {
|
async submitForm() {
|
||||||
this.app.disableActionElements();
|
this.app.disableActionElements();
|
||||||
let query = this.elements.form.query.value.trim();
|
// let query = this.elements.form.query.value.trim();
|
||||||
|
let query = this.checkQueryInput();
|
||||||
|
console.log(query);
|
||||||
let subcorpusName = this.elements.form['subcorpus-name'].value;
|
let subcorpusName = this.elements.form['subcorpus-name'].value;
|
||||||
this.elements.error.innerText = '';
|
this.elements.error.innerText = '';
|
||||||
this.elements.error.classList.add('hide');
|
this.elements.error.classList.add('hide');
|
||||||
@ -96,6 +98,14 @@ class CorpusAnalysisConcordance {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkQueryInput() {
|
||||||
|
if (document.querySelector('#corpus-analysis-concordance-expert-mode-display').classList.contains('hide')) {
|
||||||
|
return document.querySelector('#corpus-analysis-concordance-query-preview').innerHTML.trim();
|
||||||
|
} else {
|
||||||
|
return this.elements.form.query.value.trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
clearSubcorpusList() {
|
clearSubcorpusList() {
|
||||||
this.elements.subcorpusList.innerHTML = '';
|
this.elements.subcorpusList.innerHTML = '';
|
||||||
this.elements.subcorpusList.classList.add('hide');
|
this.elements.subcorpusList.classList.add('hide');
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col s2">
|
<div class="col s1">
|
||||||
<span class="card-title">Query <i class="material-icons left" style="font-size: inherit;">search</i></span>
|
<span class="card-title">Query <i class="material-icons left" style="font-size: inherit;">search</i></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col s2">
|
<div class="col s2">
|
||||||
@ -30,23 +30,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<form id="corpus-analysis-concordance-form">
|
<div id="corpus-analysis-concordance-expert-mode-display" class="hide">
|
||||||
<div id="corpus-analysis-concordance-expert-mode-display" class="hide">
|
{{ expert_mode.card_content() }}
|
||||||
{{ expert_mode.card_content() }}
|
</div>
|
||||||
</div>
|
<div id="corpus-analysis-concordance-query-builder-display">
|
||||||
<div id="corpus-analysis-concordance-query-builder-display">
|
{{ query_builder.card_content() }}
|
||||||
{{ query_builder.card_content() }}
|
</div>
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col s12 right-align">
|
|
||||||
<p class="hide-on-small-only"> </p>
|
|
||||||
<button class="btn waves-effect waves-light corpus-analysis-action" id="corpus-analysis-concordance-form-submit" type="submit" name="submit">
|
|
||||||
Send
|
|
||||||
<i class="material-icons right">send</i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,17 +1,26 @@
|
|||||||
{% macro card_content(id_prefix) %}
|
{% macro card_content(id_prefix) %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="input-field col s12 m9">
|
<form id="corpus-analysis-concordance-form">
|
||||||
<i class="material-icons prefix">search</i>
|
<div class="input-field col s12 m9">
|
||||||
<input class="validate corpus-analysis-action" id="corpus-analysis-concordance-form-query" name="query" type="text" required pattern=".*\S+.*" placeholder="Type in your query or use the Query Builder on the right"></input>
|
<i class="material-icons prefix">search</i>
|
||||||
<span class="error-color-text helper-text hide" id="corpus-analysis-concordance-error"></span>
|
<input class="validate corpus-analysis-action" id="corpus-analysis-concordance-form-query" name="query" type="text" required pattern=".*\S+.*" placeholder="Type in your query or use the Query Builder on the right"></input>
|
||||||
<a class="modal-trigger" data-manual-modal-chapter="manual-modal-cqp-query-language" href="#manual-modal" style="margin-left: 40px;"><i class="material-icons" style="font-size: inherit;">help</i> Corpus Query Language tutorial</a>
|
<span class="error-color-text helper-text hide" id="corpus-analysis-concordance-error"></span>
|
||||||
<span> | </span>
|
<a class="modal-trigger" data-manual-modal-chapter="manual-modal-cqp-query-language" href="#manual-modal" style="margin-left: 40px;"><i class="material-icons" style="font-size: inherit;">help</i> Corpus Query Language tutorial</a>
|
||||||
<a class="modal-trigger" data-manual-modal-chapter="manual-modal-tagsets" href="#manual-modal"><i class="material-icons" style="font-size: inherit;">info</i> Tagsets</a>
|
<span> | </span>
|
||||||
</div>
|
<a class="modal-trigger" data-manual-modal-chapter="manual-modal-tagsets" href="#manual-modal"><i class="material-icons" style="font-size: inherit;">info</i> Tagsets</a>
|
||||||
<div class="input-field col s12 m3">
|
</div>
|
||||||
<i class="material-icons prefix">arrow_forward</i>
|
<div class="input-field col s12 m3">
|
||||||
<input class="validate corpus-analysis-action" id="corpus-analysis-concordance-form-subcorpus-name" name="subcorpus-name" type="text" required pattern="^[A-Z][a-z0-9\-]*" value="Last"></input>
|
<i class="material-icons prefix">arrow_forward</i>
|
||||||
<label for="corpus-analysis-concordance-form-subcorpus-name">Subcorpus name</label>
|
<input class="validate corpus-analysis-action" id="corpus-analysis-concordance-form-subcorpus-name" name="subcorpus-name" type="text" required pattern="^[A-Z][a-z0-9\-]*" value="Last"></input>
|
||||||
</div>
|
<label for="corpus-analysis-concordance-form-subcorpus-name">Subcorpus name</label>
|
||||||
|
</div>
|
||||||
|
<div class="col s12 m3 l3 right-align">
|
||||||
|
<p class="hide-on-small-only"> </p>
|
||||||
|
<button class="btn waves-effect waves-light corpus-analysis-action" id="corpus-analysis-concordance-form-submit" type="submit" name="submit">
|
||||||
|
Send
|
||||||
|
<i class="material-icons right">send</i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
@ -1,36 +1,47 @@
|
|||||||
{% macro card_content(id_prefix) %}
|
{% macro card_content(id_prefix) %}
|
||||||
<div class="row">
|
<form id="corpus-analysis-concordance-form">
|
||||||
<div class="col s9">
|
<div class="row">
|
||||||
<div class="chips" id="corpus-analysis-concordance-form-query-builder"></div>
|
<div class="col s9">
|
||||||
|
<div class="chips" id="corpus-analysis-concordance-form-query-builder"></div>
|
||||||
|
</div>
|
||||||
|
<div class="input-field col s3">
|
||||||
|
<i class="material-icons prefix">arrow_forward</i>
|
||||||
|
<input class="validate corpus-analysis-action" id="corpus-analysis-concordance-form-subcorpus-name" name="subcorpus-name" type="text" required pattern="^[A-Z][a-z0-9\-]*" value="Last"></input>
|
||||||
|
<label for="corpus-analysis-concordance-form-subcorpus-name">Subcorpus name</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-field col s3">
|
<div class="row">
|
||||||
<i class="material-icons prefix">arrow_forward</i>
|
<div class="col s12">
|
||||||
<input class="validate corpus-analysis-action" id="corpus-analysis-concordance-form-subcorpus-name" name="subcorpus-name" type="text" required pattern="^[A-Z][a-z0-9\-]*" value="Last"></input>
|
<span class="error-color-text helper-text hide" id="corpus-analysis-concordance-error"></span>
|
||||||
<label for="corpus-analysis-concordance-form-subcorpus-name">Subcorpus name</label>
|
<a class="modal-trigger" data-manual-modal-chapter="manual-modal-cqp-query-language" href="#manual-modal"><i class="material-icons" style="font-size: inherit;">help</i> Corpus Query Language tutorial</a>
|
||||||
|
<span> | </span>
|
||||||
|
<a class="modal-trigger" data-manual-modal-chapter="manual-modal-tagsets" href="#manual-modal"><i class="material-icons" style="font-size: inherit;">info</i> Tagsets</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="row">
|
||||||
<div class="row">
|
<div class="col s12 hide">
|
||||||
<div class="col s12">
|
<p><i> Preview:</i></p>
|
||||||
<span class="error-color-text helper-text hide" id="corpus-analysis-concordance-error"></span>
|
<p id="corpus-analysis-concordance-query-preview"></p>
|
||||||
<a class="modal-trigger" data-manual-modal-chapter="manual-modal-cqp-query-language" href="#manual-modal"><i class="material-icons" style="font-size: inherit;">help</i> Corpus Query Language tutorial</a>
|
<br>
|
||||||
<span> | </span>
|
</div>
|
||||||
<a class="modal-trigger" data-manual-modal-chapter="manual-modal-tagsets" href="#manual-modal"><i class="material-icons" style="font-size: inherit;">info</i> Tagsets</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="row">
|
||||||
<div class="row">
|
<div class="col s12">
|
||||||
<div class="col s12 hide">
|
<p></p>
|
||||||
<p><i> Preview:</i></p>
|
<a class="btn waves-effect waves-light tooltipped modal-trigger" href="#corpus-analysis-concordance-positional-attr-modal" data-position="bottom" data-tooltip="Search for any token, for example a word, a lemma or a part-of-speech tag">Add new token to your query</a>
|
||||||
<p id="corpus-analysis-concordance-query-preview"></p>
|
<a class="btn waves-effect waves-light tooltipped modal-trigger" href="#corpus-analysis-concordance-structural-attr-modal" data-position="bottom" data-tooltip="Structure your query with structural attributes, for example sentences, entities or annotate the text">Add structural attributes to your query</a>
|
||||||
<br>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="row">
|
||||||
<div class="row">
|
<div class="col s12 right-align">
|
||||||
<div class="col s12">
|
<p class="hide-on-small-only"> </p>
|
||||||
<p></p>
|
<button class="btn waves-effect waves-light corpus-analysis-action" type="submit" name="submit">
|
||||||
<a class="btn waves-effect waves-light tooltipped modal-trigger" href="#corpus-analysis-concordance-positional-attr-modal" data-position="bottom" data-tooltip="Search for any token, for example a word, a lemma or a part-of-speech tag">Add new token to your query</a>
|
Send
|
||||||
<a class="btn waves-effect waves-light tooltipped modal-trigger" href="#corpus-analysis-concordance-structural-attr-modal" data-position="bottom" data-tooltip="Structure your query with structural attributes, for example sentences, entities or annotate the text">Add structural attributes to your query</a>
|
<i class="material-icons right">send</i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro structural_attribute_modal(id_prefix) %}
|
{% macro structural_attribute_modal(id_prefix) %}
|
||||||
|
Loading…
Reference in New Issue
Block a user