diff --git a/app/static/css/queryBuilder.css b/app/static/css/queryBuilder.css index 48081b74..21430995 100644 --- a/app/static/css/queryBuilder.css +++ b/app/static/css/queryBuilder.css @@ -2,15 +2,15 @@ overflow-x: hidden; } -#positional-attr-modal, #structural-attr-modal { +#corpus-analysis-concordance-positional-attr-modal, #corpus-analysis-concordance-corpus-analysis-concordance-structural-attr-modal { width: 70%; } -#general-options-query-builder-tutorial-info-icon { +#corpus-analysis-concordance-general-options-query-builder-tutorial-info-icon { color: black; } -#insert-query-button { +#corpus-analysis-concordance-insert-query-button { background-color: #00426f; text-align: center; } @@ -29,7 +29,7 @@ margin-left: 15px; } -#add-structural-attribute-tutorial-info-icon { +#corpus-analysis-concordance-add-structural-attribute-tutorial-info-icon { color: black; } @@ -45,7 +45,7 @@ background-color: #2FBBAB !important; } -#no-value-metadata-message { +#corpus-analysis-concordance-no-value-metadata-message { padding-top: 25px; margin-left: -20px; } @@ -54,60 +54,60 @@ margin-left: 41px; } -#token-attr { +#corpus-analysis-concordance-token-attr { margin-left: 41px; } -#token-tutorial-info-icon { +#corpus-analysis-concordance-token-tutorial-info-icon { color: black; } -#no-value-message { +#corpus-analysis-concordance-no-value-message { padding-top: 25px; margin-left: -20px; } -#token-edit-options h6 { +#corpus-analysis-concordance-token-edit-options h6 { margin-left: 15px; } -#edit-options-tutorial-info-icon { +#corpus-analysis-concordance-edit-options-tutorial-info-icon { color: black; } -#incidence-modifiers-button a{ +#corpus-analysis-concordance-incidence-modifiers-button a{ background-color: #2FBBAB; } -#incidence-modifiers-dropdown a{ +#corpus-analysis-concordance-incidence-modifiers-dropdown a{ background-color: white; } -#ignore-case-checkbox { +#corpus-analysis-concordance-ignore-case-checkbox { margin-left: 5px; } -#or, #and { +#corpus-analysis-concordance-or, #corpus-analysis-concordance-and { background-color: #fc0; } -#betweenNM { +#corpus-analysis-concordance-betweenNM { width: 60%; } -#query-builder-tutorial-modal { +#corpus-analysis-concordance-query-builder-tutorial-modal { width: 60%; } -#query-builder-tutorial-modal ul { +#corpus-analysis-concordance-query-builder-tutorial-modal ul { margin-top: 10px; } -#query-builder-tutorial { +#corpus-analysis-concordance-query-builder-tutorial { padding:15px; } -#scroll-up-button-query-builder-tutorial { +#corpus-analysis-concordance-scroll-up-button-query-builder-tutorial { background-color: #28B3D1; } diff --git a/app/static/js/CorpusAnalysis/CorpusAnalysisApp.js b/app/static/js/CorpusAnalysis/CorpusAnalysisApp.js index d6274f32..958bd7d2 100644 --- a/app/static/js/CorpusAnalysis/CorpusAnalysisApp.js +++ b/app/static/js/CorpusAnalysis/CorpusAnalysisApp.js @@ -93,6 +93,7 @@ class CorpusAnalysisApp { actionElement.disabled = true; break; case 'SELECT': + console.log(actionElement); actionElement.parentNode.querySelector('input.select-dropdown').disabled = true; break; default: diff --git a/app/static/js/CorpusAnalysis/QueryBuilder.js b/app/static/js/CorpusAnalysis/QueryBuilder.js index c5ff3dc7..78ee7265 100644 --- a/app/static/js/CorpusAnalysis/QueryBuilder.js +++ b/app/static/js/CorpusAnalysis/QueryBuilder.js @@ -40,10 +40,10 @@ class ConcordanceQueryBuilder { placeholder: 'Add your query here' } ); - document.querySelector('#corpus-analysis-app-concordance-extension-form-query-builder input').style.setProperty('width', '150px', 'important'); + document.querySelector('#corpus-analysis-concordance-form-query-builder input').style.setProperty('width', '150px', 'important'); this.elements.positionalAttrModal = M.Modal.init( - document.querySelector('#positional-attr-modal'), + document.querySelector('#corpus-analysis-concordance-positional-attr-modal'), { onOpenStart: () => { this.tokenAttributeBuilder.optionToggleHandler(); diff --git a/app/static/js/CorpusAnalysis/QueryBuilder/ElementReferencesQueryBuilder.js b/app/static/js/CorpusAnalysis/QueryBuilder/ElementReferencesQueryBuilder.js index 7f46c22a..f75c3a99 100644 --- a/app/static/js/CorpusAnalysis/QueryBuilder/ElementReferencesQueryBuilder.js +++ b/app/static/js/CorpusAnalysis/QueryBuilder/ElementReferencesQueryBuilder.js @@ -2,30 +2,30 @@ class ElementReferencesQueryBuilder { constructor() { // General Elements this.counter = 0; - this.queryInputField = document.querySelector('#corpus-analysis-app-concordance-extension-form-query-builder'); + this.queryInputField = document.querySelector('#corpus-analysis-concordance-form-query-builder'); this.queryInputFieldInstance = M.Chips.getInstance(this.queryInputField); this.queryInputFieldContent = []; // Structural Attribute Builder Elements - this.structuralAttrModalInstance = document.querySelector('#structural-attr-modal'); + this.structuralAttrModalInstance = document.querySelector('#corpus-analysis-concordance-structural-attr-modal'); this.sentenceElement = document.querySelector('[data-structural-attr-modal-action-button="sentence"]'); this.entityElement = document.querySelector('[data-structural-attr-modal-action-button="entity"]'); this.textAnnotationElement = document.querySelector('[data-structural-attr-modal-action-button="text-annotation"]'); // Token Attribute Builder Elements - this.positionalAttrModal = M.Modal.getInstance(document.querySelector('#positional-attr-modal')); - this.positionalAttrSelection = document.querySelector('#positional-attr-selection'); - this.tokenQuery = document.querySelector('#token-query'); - this.tokenSubmitButton = document.querySelector('#token-submit'); - this.noValueMessage = document.querySelector('#no-value-message'); + this.positionalAttrModal = M.Modal.getInstance(document.querySelector('#corpus-analysis-concordance-positional-attr-modal')); + this.positionalAttrSelection = document.querySelector('#corpus-analysis-concordance-positional-attr-selection'); + this.tokenQuery = document.querySelector('#corpus-analysis-concordance-token-query'); + this.tokenSubmitButton = document.querySelector('#corpus-analysis-concordance-token-submit'); + this.noValueMessage = document.querySelector('#corpus-analysis-concordance-no-value-message'); this.isTokenQueryInvalid = false; - this.wordInput = document.querySelector('#word-input'); - this.lemmaInput = document.querySelector('#lemma-input'); - this.englishPosSelection = document.querySelector('#english-pos-selection'); - this.germanPosSelection = document.querySelector('#german-pos-selection'); - this.simplePosSelection = document.querySelector('#simple-pos-selection'); + this.wordInput = document.querySelector('#corpus-analysis-concordance-word-input'); + this.lemmaInput = document.querySelector('#corpus-analysis-concordance-lemma-input'); + this.englishPosSelection = document.querySelector('#corpus-analysis-concordance-english-pos-selection'); + this.germanPosSelection = document.querySelector('#corpus-analysis-concordance-german-pos-selection'); + this.simplePosSelection = document.querySelector('#corpus-analysis-concordance-simple-pos-selection'); - this.ignoreCaseCheckbox = document.querySelector('#ignore-case-checkbox'); + this.ignoreCaseCheckbox = document.querySelector('#corpus-analysis-concordance-ignore-case-checkbox'); } } diff --git a/app/static/js/CorpusAnalysis/QueryBuilder/GeneralFunctionsQueryBuilder.js b/app/static/js/CorpusAnalysis/QueryBuilder/GeneralFunctionsQueryBuilder.js index 83ed5a76..ca73a31c 100644 --- a/app/static/js/CorpusAnalysis/QueryBuilder/GeneralFunctionsQueryBuilder.js +++ b/app/static/js/CorpusAnalysis/QueryBuilder/GeneralFunctionsQueryBuilder.js @@ -89,7 +89,7 @@ class GeneralFunctionsQueryBuilder { } queryPreviewBuilder() { - let queryPreview = document.querySelector('#query-preview'); + let queryPreview = document.querySelector('#corpus-analysis-concordance-query-preview'); let queryChipElements = Array.from(Object.values(this.elements.queryInputFieldInstance.$chips)); queryChipElements.pop(); this.elements.queryInputFieldContent = []; diff --git a/app/static/js/CorpusAnalysis/QueryBuilder/TokenAttributeBuilderFunctionsQueryBuilder.js b/app/static/js/CorpusAnalysis/QueryBuilder/TokenAttributeBuilderFunctionsQueryBuilder.js index 6b9b9a54..e03bc964 100644 --- a/app/static/js/CorpusAnalysis/QueryBuilder/TokenAttributeBuilderFunctionsQueryBuilder.js +++ b/app/static/js/CorpusAnalysis/QueryBuilder/TokenAttributeBuilderFunctionsQueryBuilder.js @@ -144,13 +144,13 @@ class TokenAttributeBuilderFunctionsQueryBuilder extends GeneralFunctionsQueryBu `; - document.querySelector('#positional-attr-selection').innerHTML = originalSelectionList; + document.querySelector('#corpus-analysis-concordance-positional-attr-selection').innerHTML = originalSelectionList; this.elements.tokenQuery.innerHTML = ''; this.toggleClass(['word', 'lemma', 'english-pos', 'german-pos', 'simple-pos'], 'hide', 'add'); this.toggleClass(['word'], 'hide', 'remove'); this.toggleClass(['incidence-modifiers', 'or', 'and'], 'disabled', 'add'); - document.querySelector(`#positional-attr-selection option[value="word"]`).selected = true; + document.querySelector(`#corpus-analysis-concordance-positional-attr-selection option[value="word"]`).selected = true; let instance = M.FormSelect.getInstance(document.getElementById('positional-attr-selection')); instance.destroy(); @@ -283,10 +283,10 @@ class TokenAttributeBuilderFunctionsQueryBuilder extends GeneralFunctionsQueryBu setTokenSelection(selection, optionDeleteList) { optionDeleteList.forEach(option => { - document.querySelector(`#positional-attr-selection option[value=${option}]`).remove(); + document.querySelector(`#corpus-analysis-concordance-positional-attr-selection option[value=${option}]`).remove(); }); - document.querySelector(`#positional-attr-selection option[value=${selection}]`).selected = true; + document.querySelector(`#corpus-analysis-concordance-positional-attr-selection option[value=${selection}]`).selected = true; let instance = M.FormSelect.getInstance(document.getElementById('positional-attr-selection')); instance.destroy(); diff --git a/app/templates/corpora/_analysis/concordance.html.j2 b/app/templates/corpora/_analysis/concordance.html.j2 index 1eb1da18..4be026b8 100644 --- a/app/templates/corpora/_analysis/concordance.html.j2 +++ b/app/templates/corpora/_analysis/concordance.html.j2 @@ -38,7 +38,6 @@ -
@@ -144,7 +143,6 @@ expertModeDisplay.classList.add("hide"); } }); - const concordanceQueryBuilder = new ConcordanceQueryBuilder(); -{# {{ query_builder.scripts() }} #} +{{ query_builder.scripts(id_prefix) }} {% endmacro %} diff --git a/app/templates/corpora/_analysis/query_builder/_expert_mode.html.j2 b/app/templates/corpora/_analysis/query_builder/_expert_mode.html.j2 index 21443d4e..d6b112eb 100644 --- a/app/templates/corpora/_analysis/query_builder/_expert_mode.html.j2 +++ b/app/templates/corpora/_analysis/query_builder/_expert_mode.html.j2 @@ -1,22 +1,22 @@ {% macro card_content(id_prefix) %}