From e3166ca54c43786d9aca69eba99a6a4d4f5c9794 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Thu, 9 Nov 2023 14:29:01 +0100 Subject: [PATCH] Use a single js namespace as parent for all other nopaque namespaces. --- .../CorpusAnalysisConcordance.js | 12 +-- .../js/CorpusAnalysis/CorpusAnalysisReader.js | 20 ++-- .../CorpusAnalysisStaticVisualization.js | 12 +-- .../GeneralFunctionsQueryBuilder.js | 14 +-- app/static/js/{nopaque => }/app.js | 6 +- app/static/js/forms/base-form.js | 8 +- .../js/forms/create-contribution-form.js | 2 +- .../js/forms/create-corpus-file-form.js | 2 +- app/static/js/forms/create-job-form.js | 2 +- app/static/js/forms/index.js | 14 +-- app/static/js/index.js | 5 + app/static/js/nopaque/index.js | 1 - app/static/js/requests/admin.js | 12 +-- app/static/js/requests/contributions.js | 30 +++--- app/static/js/requests/corpora.js | 52 +++++------ app/static/js/requests/index.js | 6 +- app/static/js/requests/jobs.js | 16 ++-- app/static/js/requests/users.js | 26 +++--- .../js/resource-displays/corpus-display.js | 4 +- app/static/js/resource-displays/index.js | 14 +-- .../js/resource-displays/job-display.js | 2 +- .../js/resource-displays/resource-display.js | 2 +- .../js/resource-lists/admin-user-list.js | 8 +- .../js/resource-lists/corpus-file-list.js | 20 ++-- .../js/resource-lists/corpus-follower-list.js | 12 +-- app/static/js/resource-lists/corpus-list.js | 20 ++-- .../resource-lists/corpus-text-info-list.js | 10 +- .../js/resource-lists/corpus-token-list.js | 10 +- .../detailed-public-corpus-list.js | 6 +- app/static/js/resource-lists/index.js | 14 +-- .../js/resource-lists/job-input-list.js | 6 +- app/static/js/resource-lists/job-list.js | 16 ++-- .../js/resource-lists/job-result-list.js | 6 +- .../js/resource-lists/public-corpus-list.js | 6 +- .../js/resource-lists/public-user-list.js | 6 +- app/static/js/resource-lists/resource-list.js | 6 +- .../spacy-nlp-pipeline-model-list.js | 12 +-- .../tesseract-ocr-pipeline-model-list.js | 12 +-- app/static/js/utils.js | 91 +++++++++++++++++++ app/static/js/utils/index.js | 1 - app/static/js/utils/utils.js | 89 ------------------ app/templates/_scripts.html.j2 | 14 +-- app/templates/admin/user_settings.html.j2 | 2 +- app/templates/corpora/corpus.html.j2 | 10 +- app/templates/users/settings/settings.html.j2 | 8 +- 45 files changed, 322 insertions(+), 325 deletions(-) rename app/static/js/{nopaque => }/app.js (98%) create mode 100644 app/static/js/index.js delete mode 100644 app/static/js/nopaque/index.js create mode 100644 app/static/js/utils.js delete mode 100644 app/static/js/utils/index.js delete mode 100644 app/static/js/utils/utils.js diff --git a/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js b/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js index 2263fbde..fd32c49c 100644 --- a/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js +++ b/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js @@ -33,7 +33,7 @@ class CorpusAnalysisConcordance { async submitForm(queryModeId) { this.app.disableActionElements(); - let queryBuilderQuery = Utils.unescape(document.querySelector('#corpus-analysis-concordance-query-preview').innerHTML.trim()); + let queryBuilderQuery = nopaque.Utils.unescape(document.querySelector('#corpus-analysis-concordance-query-preview').innerHTML.trim()); let expertModeQuery = this.elements.expertModeForm.query.value.trim(); let query = queryModeId === 'corpus-analysis-concordance-expert-mode-form' ? expertModeQuery : queryBuilderQuery; let form = queryModeId === 'corpus-analysis-concordance-expert-mode-form' ? this.elements.expertModeForm : this.elements.queryBuilderForm; @@ -171,11 +171,11 @@ class CorpusAnalysisConcordance { this.elements.subcorpusActions.querySelector('.subcorpus-export-trigger').addEventListener('click', (event) => { event.preventDefault(); let subcorpus = this.data.subcorpora[this.settings.selectedSubcorpus]; - let modalElementId = Utils.generateElementId('export-subcorpus-modal-'); - let exportFormatSelectElementId = Utils.generateElementId('export-format-select-'); - let exportSelectedMatchesOnlyCheckboxElementId = Utils.generateElementId('export-selected-matches-only-checkbox-'); - let exportFileNameInputElementId = Utils.generateElementId('export-file-name-input-'); - let modalElement = Utils.HTMLToElement( + let modalElementId = nopaque.Utils.generateElementId('export-subcorpus-modal-'); + let exportFormatSelectElementId = nopaque.Utils.generateElementId('export-format-select-'); + let exportSelectedMatchesOnlyCheckboxElementId = nopaque.Utils.generateElementId('export-selected-matches-only-checkbox-'); + let exportFileNameInputElementId = nopaque.Utils.generateElementId('export-file-name-input-'); + let modalElement = nopaque.Utils.HTMLToElement( `