class TesseractOCRPipelineModelList extends ResourceList { static autoInit() { for (let tesseractOCRPipelineModelListElement of document.querySelectorAll('.tesseract-ocr-pipeline-model-list:not(.no-autoinit)')) { new TesseractOCRPipelineModelList(tesseractOCRPipelineModelListElement); } } constructor(listContainerElement, options = {}) { super(listContainerElement, options); this.listjs.list.addEventListener('change', (event) => {this.onChange(event)}); this.listjs.list.addEventListener('click', (event) => {this.onClick(event)}); this.isInitialized = false; this.userId = listContainerElement.dataset.userId; if (this.userId === undefined) {return;} app.subscribeUser(this.userId).then((response) => { app.socket.on('PATCH', (patch) => { if (this.isInitialized) {this.onPatch(patch);} }); }); app.getUser(this.userId).then((user) => { this.add(Object.values(user.tesseract_ocr_pipeline_models)); for (let uncheckedCheckbox of this.listjs.list.querySelectorAll('input[data-checked="True"]')) { uncheckedCheckbox.setAttribute('checked', ''); } if (user.role.name !== ('Administrator' || 'Contributor')) { for (let switchElement of this.listjs.list.querySelectorAll('.is_public')) { switchElement.setAttribute('disabled', ''); } } this.isInitialized = true; }); } get item() { return (values) => { return `
Title and Description | Publisher | Availability |
---|