Fix id reference errors

This commit is contained in:
Patrick Jentsch 2023-08-08 14:33:07 +02:00
parent f1962b3b47
commit 173aea7df4
3 changed files with 38 additions and 39 deletions

View File

@ -40,7 +40,7 @@ class ConcordanceQueryBuilder {
placeholder: 'Add your query here' placeholder: 'Add your query here'
} }
); );
document.querySelector('#concordance-extension-form-query-builder input').style.setProperty('width', '150px', 'important'); document.querySelector('#corpus-analysis-app-concordance-extension-form-query-builder input').style.setProperty('width', '150px', 'important');
this.elements.positionalAttrModal = M.Modal.init( this.elements.positionalAttrModal = M.Modal.init(
document.querySelector('#positional-attr-modal'), document.querySelector('#positional-attr-modal'),

View File

@ -2,7 +2,7 @@ class ElementReferencesQueryBuilder {
constructor() { constructor() {
// General Elements // General Elements
this.counter = 0; this.counter = 0;
this.queryInputField = document.querySelector('#concordance-extension-form-query-builder'); this.queryInputField = document.querySelector('#corpus-analysis-app-concordance-extension-form-query-builder');
this.queryInputFieldInstance = M.Chips.getInstance(this.queryInputField); this.queryInputFieldInstance = M.Chips.getInstance(this.queryInputField);
this.queryInputFieldContent = []; this.queryInputFieldContent = [];

View File

@ -2,21 +2,19 @@
{% import 'corpora/_analysis/query_builder/_query_builder.html.j2' as query_builder with context %} {% import 'corpora/_analysis/query_builder/_query_builder.html.j2' as query_builder with context %}
{# The extension icon #}
{% set icon = 'list_alt' %} {% set icon = 'list_alt' %}
{# The extension name #}
{% set name = 'Concordance' %} {% set name = 'Concordance' %}
{# The extension description #}
{% set description = 'Query your corpus with the CQP query language utilizing a KWIC view.' %} {% set description = 'Query your corpus with the CQP query language utilizing a KWIC view.' %}
{% set id_prefix = name.lower().replace(' ', '-') + '-extension' %} {# The extension container content #}
{% macro container_content(id_prefix) %}
{% set tab_content %} <div class="card">
<i class="material-icons left">list_alt</i>{{ name }}</a>
{% endset %}
{% set container_content %}
<div class="row">
<div class="col s12">
<div class="card">
<div class="card-content"> <div class="card-content">
<div class="row"> <div class="row">
<div class="col s1"> <div class="col s1">
@ -39,8 +37,8 @@
{{ query_builder.card_content(id_prefix) }} {{ query_builder.card_content(id_prefix) }}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div id="{{ id_prefix }}-subcorpus-list"></div> <div id="{{ id_prefix }}-subcorpus-list"></div>
@ -122,15 +120,16 @@
</div> </div>
{% endmacro %} {% endmacro %}
{% set modals %} {# The extension modals #}
{{ query_builder.structural_attribute_modal() }} {% macro modals(id_prefix) %}
{{ query_builder.positional_attribute_modal() }} {{ query_builder.structural_attribute_modal(id_prefix) }}
{% endset %} {{ query_builder.positional_attribute_modal(id_prefix) }}
{% endmacro %}
{# The extension scripts #} {# The extension scripts #}
{% macro scripts(id_prefix) %} {% macro scripts(id_prefix) %}
<script> <script>
const corpusAnalysisConcordance = new CorpusAnalysisConcordance(corpusAnalysisApp); const corpusAnalysisConcordance = new CorpusAnalysisConcordance(corpusAnalysisApp, "{{ id_prefix }}");
let queryBuilderDisplay = document.getElementById("{{ id_prefix }}-query-builder-display"); let queryBuilderDisplay = document.getElementById("{{ id_prefix }}-query-builder-display");
let expertModeDisplay = document.getElementById("{{ id_prefix }}-expert-mode-display"); let expertModeDisplay = document.getElementById("{{ id_prefix }}-expert-mode-display");
@ -148,4 +147,4 @@
const concordanceQueryBuilder = new ConcordanceQueryBuilder(); const concordanceQueryBuilder = new ConcordanceQueryBuilder();
</script> </script>
{# {{ query_builder.scripts() }} #} {# {{ query_builder.scripts() }} #}
{% endset %} {% endmacro %}