class RessourceList { /* A wrapper class for the list.js list. * This class is not meant to be used directly, instead it should be used as * a base class for concrete ressource list implementations. */ static autoInit() { CorpusList.autoInit(); CorpusFileList.autoInit(); JobList.autoInit(); JobInputList.autoInit(); JobResultList.autoInit(); PublicUserList.autoInit(); SpaCyNLPPipelineModelList.autoInit(); TesseractOCRPipelineModelList.autoInit(); UserList.autoInit(); } static options = {page: 5, pagination: {innerWindow: 2, outerWindow: 2}}; constructor(listElement, options = {}) { if (!(listElement.hasAttribute('id'))) { let i; for (i = 0; true; i++) { if (document.querySelector(`#ressource-list-${i}`)) {continue;} listElement.id = `ressource-list-${i}`; break; } } options = { ...RessourceList.options, ...options } if ('ressourceMapper' in options && typeof options.ressourceMapper === 'function') { this.ressourceMapper = options.ressourceMapper; delete options.ressourceMapper; } if ('initialHtmlGenerator' in options && typeof options.initialHtmlGenerator === 'function') { this.initialHtmlGenerator = options.initialHtmlGenerator; listElement.innerHTML = this.initialHtmlGenerator(listElement.id); delete options.initialHtmlGenerator; } if ('sortArgs' in options) { this.sortArgs = options.sortArgs; delete options.sortArgs; } this.listjs = new List(listElement, {...RessourceList.options, ...options}); this.listjs.list.innerHTML = `
This list is not initialized yet.
No ressource available.