mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
Remove PublicCorporaList.js
This commit is contained in:
parent
65c907a990
commit
69152f5e6a
@ -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 `
|
||||
<div class="input-field">
|
||||
<i class="material-icons prefix">search</i>
|
||||
<input id="${id}-search" class="search" type="search"></input>
|
||||
<label for="${id}-search">Search corpus</label>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Title</th>
|
||||
<th>Description</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="list"></tbody>
|
||||
</table>
|
||||
<ul class="pagination"></ul>
|
||||
`.trim();
|
||||
},
|
||||
item: `
|
||||
<tr class="clickable hoverable">
|
||||
<td><a class="btn-floating disabled"><i class="material-icons service-color darken" data-service="corpus-analysis">book</i></a></td>
|
||||
<td><b class="title"></b></td>
|
||||
<td><i class="description"></i></td>
|
||||
</tr>
|
||||
`.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);
|
||||
}
|
||||
}
|
@ -10,7 +10,6 @@ class RessourceList {
|
||||
JobList.autoInit();
|
||||
JobInputList.autoInit();
|
||||
JobResultList.autoInit();
|
||||
PublicCorporaList.autoInit();
|
||||
SpaCyNLPPipelineModelList.autoInit();
|
||||
TesseractOCRPipelineModelList.autoInit();
|
||||
UserList.autoInit();
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user