From c351e9bbefe69c86e99459f050c99f82d4370ea4 Mon Sep 17 00:00:00 2001 From: Benjamin Funke <58399929+BJNFNE@users.noreply.github.com> Date: Sun, 12 Apr 2026 10:22:06 +0200 Subject: [PATCH] implement isFont() --- src/js/constants.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/js/constants.js b/src/js/constants.js index a71fd03..a22b278 100644 --- a/src/js/constants.js +++ b/src/js/constants.js @@ -101,6 +101,7 @@ function isImage(mime) { return mime.startsWith('image/'); } function isAudio(mime) { return mime.startsWith('audio/'); } function isVideo(mime) { return mime.startsWith('video/'); } function isPDF(mime) { return mime === 'application/pdf'; } +function isFont(mime) { return mime.startsWith('font/'); } function buf2b64(buf) { const u8 = buf instanceof Uint8Array ? buf : new Uint8Array(buf), @@ -245,6 +246,7 @@ function getFileIconSVG(mime, name) { if (isAudio(mime)) return _bigIcon('#c678dd', _audioPath()); if (isVideo(mime)) return _bigIcon('#c678dd', _videoPath()); if (isPDF(mime)) return _bigIcon('#f44747', _pdfPath()); + if (isFont(mime)) return _bigIcon('#ebdc13', _fontPath()); if (isText(mime, name)) { if (['js', 'ts', 'py', 'rs', 'go', 'java', 'c', 'cmd', 'cpp', 'cs', 'php', 'rb', 'sh', 'bat', 'ps1', 'vbs'].includes(ext)) return _bigIcon('#dcdcaa', _codePath()); @@ -280,6 +282,7 @@ function _pdfPath() { return ``; } function _docPath() { return ``; } function _slidePath() { return ``; } +function _fontPath() { return ``; } function _bigIconExt(color, extText) { const fs = extText.length <= 2 ? 14 : extText.length === 3 ? 12 : 10;