From 69152f5e6af3e93bb39787455002fb7c5fe98b47 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Mon, 12 Dec 2022 13:18:22 +0100 Subject: [PATCH] Remove PublicCorporaList.js --- .../js/RessourceLists/PublicCorporaList.js | 70 ------------------- app/static/js/RessourceLists/RessourceList.js | 1 - app/templates/_scripts.html.j2 | 1 - 3 files changed, 72 deletions(-) delete mode 100644 app/static/js/RessourceLists/PublicCorporaList.js diff --git a/app/static/js/RessourceLists/PublicCorporaList.js b/app/static/js/RessourceLists/PublicCorporaList.js deleted file mode 100644 index 2171396e..00000000 --- a/app/static/js/RessourceLists/PublicCorporaList.js +++ /dev/null @@ -1,70 +0,0 @@ -class PublicCorporaList extends RessourceList { - static instances = []; - - static getInstance(elem) { - return PublicCorporaList.instances.find((instance) => { - return instance.listjs.list === elem; - }); - } - - static autoInit() { - for (let publicCorporaListElement of document.querySelectorAll('.public-corpora-list:not(.no-autoinit)')) { - new PublicCorporaList(publicCorporaListElement); - } - } - - static options = { - initialHtmlGenerator: (id) => { - return ` -
- search - - -
- - - - - - - - - - -
TitleDescription
- - `.trim(); - }, - item: ` - - book - - - - `.trim(), - ressourceMapper: (corpus) => { - return { - 'id': corpus.id, - 'creation-date': corpus.creation_date, - 'description': corpus.description, - 'title': corpus.title - }; - }, - sortArgs: ['creation-date', {order: 'desc'}], - valueNames: [ - {data: ['id']}, - {data: ['creation-date']}, - 'description', - 'title' - ] - }; - - constructor(listElement, options = {}) { - super(listElement, {...PublicCorporaList.options, ...options}); - PublicCorporaList.instances.push(this); - } - - init(user) { - this._init(user.corpora.is_public); - } -} diff --git a/app/static/js/RessourceLists/RessourceList.js b/app/static/js/RessourceLists/RessourceList.js index 5af7a231..871a1e2f 100644 --- a/app/static/js/RessourceLists/RessourceList.js +++ b/app/static/js/RessourceLists/RessourceList.js @@ -10,7 +10,6 @@ class RessourceList { JobList.autoInit(); JobInputList.autoInit(); JobResultList.autoInit(); - PublicCorporaList.autoInit(); SpaCyNLPPipelineModelList.autoInit(); TesseractOCRPipelineModelList.autoInit(); UserList.autoInit(); diff --git a/app/templates/_scripts.html.j2 b/app/templates/_scripts.html.j2 index 8ff90c33..7cc8a8f8 100644 --- a/app/templates/_scripts.html.j2 +++ b/app/templates/_scripts.html.j2 @@ -24,7 +24,6 @@ 'js/RessourceLists/JobList.js', 'js/RessourceLists/JobInputList.js', 'js/RessourceLists/JobResultList.js', - 'js/RessourceLists/PublicCorporaList.js', 'js/RessourceLists/SpacyNLPPipelineModelList.js', 'js/RessourceLists/TesseractOCRPipelineModelList.js', 'js/RessourceLists/UserList.js'