diff --git a/app/static/js/ResourceDisplays/CorpusDisplay.js b/app/static/js/resource-displays/corpus-display.js similarity index 97% rename from app/static/js/ResourceDisplays/CorpusDisplay.js rename to app/static/js/resource-displays/corpus-display.js index 29e8b2052a802ef34c41cd18e5a2831684fdfc89..6bfa1676a774bc0ad759c7c48365f5642a817049 100644 --- a/app/static/js/ResourceDisplays/CorpusDisplay.js +++ b/app/static/js/resource-displays/corpus-display.js @@ -1,4 +1,4 @@ -class CorpusDisplay extends ResourceDisplay { +ResourceDisplays.CorpusDisplay = class CorpusDisplay extends ResourceDisplays.BaseDisplay { constructor(displayElement) { super(displayElement); this.corpusId = displayElement.dataset.corpusId; diff --git a/app/static/js/ResourceDisplays/ResourceDisplay.js b/app/static/js/resource-displays/index.js similarity index 92% rename from app/static/js/ResourceDisplays/ResourceDisplay.js rename to app/static/js/resource-displays/index.js index 24a5dec3828f7d6d9c4a63a25ded42c7ab2dcdea..75c689871fc0ce6f2668392ca594c66ce01c07c2 100644 --- a/app/static/js/ResourceDisplays/ResourceDisplay.js +++ b/app/static/js/resource-displays/index.js @@ -1,4 +1,6 @@ -class ResourceDisplay { +var ResourceDisplays = {}; + +ResourceDisplays.BaseDisplay = class BaseDisplay { constructor(displayElement) { this.displayElement = displayElement; this.userId = this.displayElement.dataset.userId; @@ -41,4 +43,4 @@ class ResourceDisplay { this.setElement(element, value); } } -} +}; diff --git a/app/static/js/ResourceDisplays/JobDisplay.js b/app/static/js/resource-displays/job-display.js similarity index 97% rename from app/static/js/ResourceDisplays/JobDisplay.js rename to app/static/js/resource-displays/job-display.js index 6287d934b3baa69b41e23783ec4dc510d618b539..2d107716f78c0906ef4cbfdd58fd664497aa0848 100644 --- a/app/static/js/ResourceDisplays/JobDisplay.js +++ b/app/static/js/resource-displays/job-display.js @@ -1,4 +1,4 @@ -class JobDisplay extends ResourceDisplay { +ResourceDisplays.JobDisplay = class JobDisplay extends ResourceDisplays.BaseDisplay { constructor(displayElement) { super(displayElement); this.jobId = this.displayElement.dataset.jobId; diff --git a/app/templates/_scripts.html.j2 b/app/templates/_scripts.html.j2 index 7ebb61c22d061e04d72f31d18ed8bf459fa5eb62..b2ca56a4ed09c97760237f77d1d72bed9d861e5a 100644 --- a/app/templates/_scripts.html.j2 +++ b/app/templates/_scripts.html.j2 @@ -45,10 +45,10 @@ {%- assets filters='rjsmin', - output='gen/ResourceDisplays.%(version)s.js', - 'js/ResourceDisplays/ResourceDisplay.js', - 'js/ResourceDisplays/CorpusDisplay.js', - 'js/ResourceDisplays/JobDisplay.js' + output='gen/resource-displays.%(version)s.js', + 'js/resource-displays/index.js', + 'js/resource-displays/corpus-display.js', + 'js/resource-displays/job-display.js' %} <script src="{{ ASSET_URL }}"></script> {%- endassets %} diff --git a/app/templates/corpora/corpus.html.j2 b/app/templates/corpora/corpus.html.j2 index 21a10221f8f300a313c896d4136645c087b12401..7539f420a418e0c51c0283c25e5d697a9002cea1 100644 --- a/app/templates/corpora/corpus.html.j2 +++ b/app/templates/corpora/corpus.html.j2 @@ -237,7 +237,7 @@ {% block scripts %} {{ super() }} <script> -let corpusDisplay = new CorpusDisplay(document.querySelector('#corpus-display')); +let corpusDisplay = new ResourceDisplays.CorpusDisplay(document.querySelector('#corpus-display')); {# {% if current_user.is_following_corpus(corpus) %} let unfollowRequestElement = document.querySelector('.action-button[data-action="unfollow-request"]'); diff --git a/app/templates/jobs/job.html.j2 b/app/templates/jobs/job.html.j2 index c6260cf1fc24762d6afbc0b3ebfec83fbfbd6794..b7b16bfbcdfee58ca0e010cc97e71a6bd1a0ad02 100644 --- a/app/templates/jobs/job.html.j2 +++ b/app/templates/jobs/job.html.j2 @@ -150,7 +150,7 @@ {% block scripts %} {{ super() }} <script> - let jobDisplay = new JobDisplay(document.querySelector('#job-display')); + let jobDisplay = new ResourceDisplays.JobDisplay(document.querySelector('#job-display')); let deleteJobRequestElement = document.querySelector('#delete-job-request'); let restartJobRequestElement = document.querySelector('#restart-job-request'); deleteJobRequestElement.addEventListener('click', (event) => {