diff --git a/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js b/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js index 58e486a2..dfb92a6c 100644 --- a/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js +++ b/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js @@ -9,7 +9,7 @@ class CorpusAnalysisConcordance { this.elements = { container: document.querySelector(`#${idPrefix}-container`), error: document.querySelector(`#${idPrefix}-error`), - UIForm: document.querySelector(`#${idPrefix}-ui-form`), + userInterfaceForm: document.querySelector(`#${idPrefix}-user-interface-form`), form: document.querySelector(`#${idPrefix}-form`), progress: document.querySelector(`#${idPrefix}-progress`), subcorpusInfo: document.querySelector(`#${idPrefix}-subcorpus-info`), @@ -20,11 +20,11 @@ class CorpusAnalysisConcordance { }; this.settings = { - context: parseInt(this.elements.UIForm['context'].value), - perPage: parseInt(this.elements.UIForm['per-page'].value), + context: parseInt(this.elements.userInterfaceForm['context'].value), + perPage: parseInt(this.elements.userInterfaceForm['per-page'].value), selectedSubcorpus: undefined, - textStyle: parseInt(this.elements.UIForm['text-style'].value), - tokenRepresentation: this.elements.UIForm['token-representation'].value + textStyle: parseInt(this.elements.userInterfaceForm['text-style'].value), + tokenRepresentation: this.elements.userInterfaceForm['token-representation'].value }; console.log(this.settings); @@ -77,24 +77,24 @@ class CorpusAnalysisConcordance { event.preventDefault(); this.submitForm(); }); - this.elements.UIForm.addEventListener('change', (event) => { - if (event.target === this.elements.UIForm['context']) { + this.elements.userInterfaceForm.addEventListener('change', (event) => { + if (event.target === this.elements.userInterfaceForm['context']) { console.log(this.settings.context); - console.log(parseInt(this.elements.UIForm['context'].value)); - this.settings.context = parseInt(this.elements.UIForm['context'].value); + console.log(parseInt(this.elements.userInterfaceForm['context'].value)); + this.settings.context = parseInt(this.elements.userInterfaceForm['context'].value); console.log(this.settings.context); this.submitForm(); } - if (event.target === this.elements.UIForm['per-page']) { - this.settings.perPage = parseInt(this.elements.UIForm['per-page'].value); + if (event.target === this.elements.userInterfaceForm['per-page']) { + this.settings.perPage = parseInt(this.elements.userInterfaceForm['per-page'].value); this.submitForm(); } - if (event.target === this.elements.UIForm['text-style']) { - this.settings.textStyle = parseInt(this.elements.UIForm['text-style'].value); + if (event.target === this.elements.userInterfaceForm['text-style']) { + this.settings.textStyle = parseInt(this.elements.userInterfaceForm['text-style'].value); this.setTextStyle(); } - if (event.target === this.elements.UIForm['token-representation']) { - this.settings.tokenRepresentation = this.elements.UIForm['token-representation'].value; + if (event.target === this.elements.userInterfaceForm['token-representation']) { + this.settings.tokenRepresentation = this.elements.userInterfaceForm['token-representation'].value; this.setTokenRepresentation(); } }); diff --git a/app/static/js/CorpusAnalysis/CorpusAnalysisReader.js b/app/static/js/CorpusAnalysis/CorpusAnalysisReader.js index ab103068..4990b91a 100644 --- a/app/static/js/CorpusAnalysis/CorpusAnalysisReader.js +++ b/app/static/js/CorpusAnalysis/CorpusAnalysisReader.js @@ -8,17 +8,17 @@ class CorpusAnalysisReader { this.elements = { container: document.querySelector(`#${idPrefix}-container`), - error: document.querySelector(`#${idPrefix}-error`), - form: document.querySelector(`#${idPrefix}-form`), - progress: document.querySelector(`#${idPrefix}-progress`), corpus: document.querySelector(`#${idPrefix}-corpus`), - corpusPagination: document.querySelector(`#${idPrefix}-corpus-pagination`) + corpusPagination: document.querySelector(`#${idPrefix}-corpus-pagination`), + error: document.querySelector(`#${idPrefix}-error`), + progress: document.querySelector(`#${idPrefix}-progress`), + userInterfaceForm: document.querySelector(`#${idPrefix}-user-interface-form`) }; this.settings = { - perPage: parseInt(this.elements.form['per-page'].value), - textStyle: parseInt(this.elements.form['text-style'].value), - tokenRepresentation: this.elements.form['token-representation'].value, + perPage: parseInt(this.elements.userInterfaceForm['per-page'].value), + textStyle: parseInt(this.elements.userInterfaceForm['text-style'].value), + tokenRepresentation: this.elements.userInterfaceForm['token-representation'].value, pagination: { innerWindow: 5, outerWindow: 1 @@ -56,21 +56,21 @@ class CorpusAnalysisReader { // Init data this.data.corpus = this.app.data.corpus; // Add event listeners - this.elements.form.addEventListener('submit', (event) => { + this.elements.userInterfaceForm.addEventListener('submit', (event) => { event.preventDefault(); this.submitForm(); }); - this.elements.form.addEventListener('change', (event) => { - if (event.target === this.elements.form['per-page']) { - this.settings.perPage = parseInt(this.elements.form['per-page'].value); + this.elements.userInterfaceForm.addEventListener('change', (event) => { + if (event.target === this.elements.userInterfaceForm['per-page']) { + this.settings.perPage = parseInt(this.elements.userInterfaceForm['per-page'].value); this.submitForm(); } - if (event.target === this.elements.form['text-style']) { - this.settings.textStyle = parseInt(this.elements.form['text-style'].value); + if (event.target === this.elements.userInterfaceForm['text-style']) { + this.settings.textStyle = parseInt(this.elements.userInterfaceForm['text-style'].value); this.setTextStyle(); } - if (event.target === this.elements.form['token-representation']) { - this.settings.tokenRepresentation = this.elements.form['token-representation'].value; + if (event.target === this.elements.userInterfaceForm['token-representation']) { + this.settings.tokenRepresentation = this.elements.userInterfaceForm['token-representation'].value; this.setTokenRepresentation(); } }); diff --git a/app/templates/corpora/_analysis/concordance.html.j2 b/app/templates/corpora/_analysis/concordance.html.j2 index 78df52e7..6fc3f0c6 100644 --- a/app/templates/corpora/_analysis/concordance.html.j2 +++ b/app/templates/corpora/_analysis/concordance.html.j2 @@ -80,7 +80,7 @@
-
+
diff --git a/app/templates/corpora/_analysis/reader.html.j2 b/app/templates/corpora/_analysis/reader.html.j2 index 2ed756d8..df12fb6b 100644 --- a/app/templates/corpora/_analysis/reader.html.j2 +++ b/app/templates/corpora/_analysis/reader.html.j2 @@ -12,7 +12,7 @@ {% macro container_content(id_prefix) %}
- +