From 173aea7df4a0d9f8909370a1921fc2b1d105f730 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Tue, 8 Aug 2023 14:33:07 +0200 Subject: [PATCH] Fix id reference errors --- app/static/js/CorpusAnalysis/QueryBuilder.js | 4 +- .../ElementReferencesQueryBuilder.js | 2 +- .../corpora/_analysis/concordance.html.j2 | 71 +++++++++---------- 3 files changed, 38 insertions(+), 39 deletions(-) diff --git a/app/static/js/CorpusAnalysis/QueryBuilder.js b/app/static/js/CorpusAnalysis/QueryBuilder.js index f5fa63cb..c5ff3dc7 100644 --- a/app/static/js/CorpusAnalysis/QueryBuilder.js +++ b/app/static/js/CorpusAnalysis/QueryBuilder.js @@ -40,8 +40,8 @@ class ConcordanceQueryBuilder { 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( document.querySelector('#positional-attr-modal'), { diff --git a/app/static/js/CorpusAnalysis/QueryBuilder/ElementReferencesQueryBuilder.js b/app/static/js/CorpusAnalysis/QueryBuilder/ElementReferencesQueryBuilder.js index 96cdbaac..7f46c22a 100644 --- a/app/static/js/CorpusAnalysis/QueryBuilder/ElementReferencesQueryBuilder.js +++ b/app/static/js/CorpusAnalysis/QueryBuilder/ElementReferencesQueryBuilder.js @@ -2,7 +2,7 @@ class ElementReferencesQueryBuilder { constructor() { // General Elements 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.queryInputFieldContent = []; diff --git a/app/templates/corpora/_analysis/concordance.html.j2 b/app/templates/corpora/_analysis/concordance.html.j2 index e7a403fb..1eb1da18 100644 --- a/app/templates/corpora/_analysis/concordance.html.j2 +++ b/app/templates/corpora/_analysis/concordance.html.j2 @@ -2,45 +2,43 @@ {% import 'corpora/_analysis/query_builder/_query_builder.html.j2' as query_builder with context %} +{# The extension icon #} {% set icon = 'list_alt' %} + +{# The extension name #} {% set name = 'Concordance' %} + +{# The extension description #} {% set description = 'Query your corpus with the CQP query language utilizing a KWIC view.' %} -{% set id_prefix = name.lower().replace(' ', '-') + '-extension' %} - -{% set tab_content %} -list_alt{{ name }} -{% endset %} - -{% set container_content %} -
-
-
-
-
-
- Query search -
-
-
- -
-
-
-
- {{ expert_mode.card_content(id_prefix) }} -
-
- {{ query_builder.card_content(id_prefix) }} +{# The extension container content #} +{% macro container_content(id_prefix) %} +
+
+
+
+ Query search +
+
+
+
+
+ {{ expert_mode.card_content(id_prefix) }} +
+
+ {{ query_builder.card_content(id_prefix) }} +
+
+
@@ -122,15 +120,16 @@
{% endmacro %} -{% set modals %} -{{ query_builder.structural_attribute_modal() }} -{{ query_builder.positional_attribute_modal() }} -{% endset %} +{# The extension modals #} +{% macro modals(id_prefix) %} +{{ query_builder.structural_attribute_modal(id_prefix) }} +{{ query_builder.positional_attribute_modal(id_prefix) }} +{% endmacro %} {# The extension scripts #} {% macro scripts(id_prefix) %} {# {{ query_builder.scripts() }} #} -{% endset %} +{% endmacro %}