diff --git a/src/network/html/FilesPage.html b/src/network/html/FilesPage.html index 4d7db447..83b5da0b 100644 --- a/src/network/html/FilesPage.html +++ b/src/network/html/FilesPage.html @@ -2278,9 +2278,10 @@ if (file.isDirectory) return 0; const ext = file.name.includes('.') ? file.name.split('.').pop().toLowerCase() : ''; if (ext === 'epub') return 1; - if (ext === 'xtc') return 2; + if (ext === 'xtc' || ext === 'xtch') return 2; if (ext === 'txt') return 3; - return 4; + if (ext === 'md') return 4; + return 5; } function sortFiles(files) { @@ -2355,11 +2356,18 @@ if (!filePath.endsWith("/")) filePath += "/"; filePath += file.name; - fileTableContent += ``; + const ext = file.name.includes('.') ? file.name.split('.').pop().toLowerCase() : ''; + const isXtc = ext === 'xtc' || ext === 'xtch'; + const isMd = ext === 'md'; + const fileIcon = file.isEpub ? '📗' : isXtc ? '📘' : isMd ? '📝' : '📄'; + const fileBadge = file.isEpub ? 'EPUB' : isXtc ? 'XTC' : ext === 'txt' ? 'TXT' : isMd ? 'MD' : ''; + const rowClass = file.isEpub ? 'epub-file' : isXtc ? 'xtc-file' : ''; + + fileTableContent += ``; fileTableContent += ``; - fileTableContent += `${file.isEpub ? '📗' : '📄'}`; + fileTableContent += `${fileIcon}`; fileTableContent += `${escapeHtml(displayFileName(file.name))}`; - if (file.isEpub) fileTableContent += 'EPUB'; + if (fileBadge) fileTableContent += `${fileBadge}`; fileTableContent += ''; fileTableContent += `${file.name.includes('.') ? file.name.split('.').pop().toUpperCase() : '-'}`; fileTableContent += `${formatFileSize(file.size)}`;