From 0cd1f151b5986ede431f1792139fa1a5471ae059 Mon Sep 17 00:00:00 2001 From: ron Date: Wed, 4 Dec 2024 12:35:36 +0530 Subject: [PATCH 1/3] feat: added tagify in Filetype-Association input in dev center --- src/dev-center/index.html | 3 ++ src/dev-center/js/dev-center.js | 58 ++++++++++++++++++++++++++++++--- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/src/dev-center/index.html b/src/dev-center/index.html index 5c0a8219..81bc6c37 100644 --- a/src/dev-center/index.html +++ b/src/dev-center/index.html @@ -19,6 +19,9 @@ + + + diff --git a/src/dev-center/js/dev-center.js b/src/dev-center/js/dev-center.js index 481d6d9e..1f278e99 100644 --- a/src/dev-center/js/dev-center.js +++ b/src/dev-center/js/dev-center.js @@ -764,26 +764,54 @@ async function edit_app_section(cur_app_name) { const filetype_association_input = document.querySelector('textarea[id=edit-app-filetype-associations]'); let tagify = new Tagify(filetype_association_input, { - pattern: /\.(?:[a-z0-9]+)|(?:[a-z]+\/[a-z0-9.-]+)/, // pattern for filetype file like .pdf or MIME type like text/plain - delimiters: null, - whitelist: [ - // Document file types - ".doc", ".docx", ".pdf", ".txt", ".odt", ".rtf", ".tex", - // Spreadsheet file types - ".xls", ".xlsx", ".csv", ".ods", - // Image file types - ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tiff", ".svg", ".webp", - // Video file types - ".mp4", ".avi", ".mov", ".wmv", ".mkv", ".flv", ".webm", - // Audio file types - ".mp3", ".wav", ".aac", ".flac", ".ogg", ".m4a", - // Code file types - ".js", ".ts", ".html", ".css", ".json", ".xml", ".php", ".py", ".java", ".cpp", - // Archive file types - ".zip", ".rar", ".7z", ".tar", ".gz", - // Other - ".exe", ".dll", ".iso" - ], + pattern: /\.(?:[a-z0-9]+)|(?:[a-z]+\/(?:[a-z0-9.-]+|\*))/, + delimiters: null, + whitelist: [ + // MIME type patterns + "text/*", "image/*", "audio/*", "video/*", "application/*", + + // Documents + ".doc", ".docx", ".pdf", ".txt", ".odt", ".rtf", ".tex", ".md", ".pages", ".epub", ".mobi", ".azw", ".azw3", ".djvu", ".xps", ".oxps", ".fb2", ".textile", ".markdown", ".asciidoc", ".rst", ".wpd", ".wps", ".abw", ".zabw", + + // Spreadsheets + ".xls", ".xlsx", ".csv", ".ods", ".numbers", ".tsv", ".gnumeric", ".xlt", ".xltx", ".xlsm", ".xltm", ".xlam", ".xlsb", + + // Presentations + ".ppt", ".pptx", ".key", ".odp", ".pps", ".ppsx", ".pptm", ".potx", ".potm", ".ppam", + + // Images + ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tiff", ".tif", ".svg", ".webp", ".ico", ".psd", ".ai", ".eps", ".raw", ".cr2", ".nef", ".orf", ".sr2", ".heic", ".heif", ".avif", ".jxr", ".hdp", ".wdp", ".jng", ".xcf", ".pgm", ".pbm", ".ppm", ".pnm", + + // Video + ".mp4", ".avi", ".mov", ".wmv", ".mkv", ".flv", ".webm", ".m4v", ".mpeg", ".mpg", ".3gp", ".3g2", ".ogv", ".vob", ".drc", ".gifv", ".mng", ".qt", ".yuv", ".rm", ".rmvb", ".asf", ".amv", ".m2v", ".svi", + + // Audio + ".mp3", ".wav", ".aac", ".flac", ".ogg", ".m4a", ".wma", ".aiff", ".alac", ".ape", ".au", ".mid", ".midi", ".mka", ".pcm", ".ra", ".ram", ".snd", ".wv", ".opus", + + // Code/Development + ".js", ".ts", ".html", ".css", ".json", ".xml", ".php", ".py", ".java", ".cpp", ".c", ".cs", ".h", ".hpp", ".hxx", ".rs", ".go", ".rb", ".pl", ".swift", ".kt", ".kts", ".scala", ".coffee", ".sass", ".scss", ".less", ".jsx", ".tsx", ".vue", ".sh", ".bash", ".zsh", ".fish", ".ps1", ".bat", ".cmd", ".sql", ".r", ".dart", ".f", ".f90", ".for", ".lua", ".m", ".mm", ".clj", ".erl", ".ex", ".exs", ".elm", ".hs", ".lhs", ".lisp", ".ml", ".mli", ".nim", ".pl", ".rkt", ".v", ".vhd", + + // Archives + ".zip", ".rar", ".7z", ".tar", ".gz", ".bz2", ".xz", ".z", ".lz", ".lzma", ".tlz", ".txz", ".tgz", ".tbz2", ".bz", ".br", ".lzo", ".ar", ".cpio", ".shar", ".lrz", ".lz4", ".lz2", ".rz", ".sfark", ".sz", ".zoo", + + // Database + ".db", ".sql", ".sqlite", ".sqlite3", ".dbf", ".mdb", ".accdb", ".db3", ".s3db", ".dbx", + + // Fonts + ".ttf", ".otf", ".woff", ".woff2", ".eot", ".pfa", ".pfb", ".sfd", + + // CAD and 3D + ".dwg", ".dxf", ".stl", ".obj", ".fbx", ".dae", ".3ds", ".blend", ".max", ".ma", ".mb", ".c4d", ".skp", ".usd", ".usda", ".usdc", ".abc", + + // Scientific/Technical + ".mat", ".fig", ".nb", ".cdf", ".fits", ".fts", ".fit", ".gmsh", ".msh", ".fem", ".neu", ".hdf", ".h5", ".nx", ".unv", + + // System + ".exe", ".dll", ".so", ".dylib", ".app", ".dmg", ".iso", ".img", ".bin", ".msi", ".apk", ".ipa", ".deb", ".rpm", + + // Directory + ".directory" + ], }) // -------------------------------------------------------- From 591cf0f45eee0cfa117801746124518dd43d4df2 Mon Sep 17 00:00:00 2001 From: jelveh Date: Wed, 4 Dec 2024 16:22:06 -0800 Subject: [PATCH 3/3] tweak for fluid ux --- src/dev-center/js/dev-center.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dev-center/js/dev-center.js b/src/dev-center/js/dev-center.js index 1f278e99..c6eab46c 100644 --- a/src/dev-center/js/dev-center.js +++ b/src/dev-center/js/dev-center.js @@ -765,7 +765,12 @@ async function edit_app_section(cur_app_name) { const filetype_association_input = document.querySelector('textarea[id=edit-app-filetype-associations]'); let tagify = new Tagify(filetype_association_input, { pattern: /\.(?:[a-z0-9]+)|(?:[a-z]+\/(?:[a-z0-9.-]+|\*))/, - delimiters: null, + delimiters: ", ", + enforceWhitelist: false, + dropdown : { + // show the dropdown immediately on focus (0 character typed) + enabled: 0, + }, whitelist: [ // MIME type patterns "text/*", "image/*", "audio/*", "video/*", "application/*",