Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more file types/extensions based on https://developer.mozilla.org/en-US/docs #17

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/FileBrowser.vue
Expand Up @@ -196,11 +196,11 @@ import Upload from '@/components/file/Upload.vue';

// Categories for filtering
const extensionCategories = {
image: ['jpg', 'jpeg', 'png', 'gif', 'svg', 'bmp', 'tif', 'tiff'],
image: ['jpg', 'jpeg', 'png', 'apng', 'webp', 'avif', 'ico', 'cur', 'gif', 'svg', 'bmp', 'tif', 'tiff'],
document: ['pdf', 'doc', 'docx', 'ppt', 'pptx', 'vxls', 'xlsx', 'txt', 'rtf'],
video: ['mp4', 'avi', 'mov', 'wmv', 'flv'],
audio: ['mp3', 'wav', 'aac', 'ogg', 'flac'],
compressed: ['zip', 'rar', '7z', 'tar', 'gz', 'tgz']
video: ['mp4', 'avi', 'mov', 'wmv', 'flv', 'mpeg', 'webm', 'ogv', 'ts', '3gp', '3g2'],
audio: ['mp3', 'wav', 'aac', 'ogg', 'flac', 'weba', 'oga', 'opus', 'mid', 'midi', '3gp', '3g2'],
compressed: ['zip', 'rar', '7z', 'tar', 'gz', 'tgz', 'bz', 'bz2']
}

const route = useRoute();
Expand Down
4 changes: 2 additions & 2 deletions src/components/file/TipTap.vue
Expand Up @@ -350,7 +350,7 @@ const editor = useEditor({
handleDrop: async function(view, event, slice, moved) {
if (!moved && event.dataTransfer && event.dataTransfer.files && event.dataTransfer.files.length) {
const files = Array.from(event.dataTransfer.files);
const allowedTypes = ['image/jpeg', 'image/png', 'image/gif', 'image/svg+xml', 'image/bmp', 'image/tif', 'image/tiff'];
const allowedTypes = ['image/jpeg', 'image/png', 'image/webp', 'image/apng', 'image/avif', 'image/gif', 'image/svg+xml', 'image/x-icon', 'image/bmp', 'image/tif', 'image/tiff'];
const { schema } = view.state;
const coordinates = view.posAtCoords({ left: event.clientX, top: event.clientY });
let position = coordinates.pos;
Expand All @@ -367,7 +367,7 @@ const editor = useEditor({
}
}
} else {
notifications.notify('Only images can be uploaded (JPEG, PNG, GIF, SVG, TIFF and BMP).', 'error');
notifications.notify('Only images can be uploaded (JPEG, PNG, WEBP, APNG, AVIF, GIF, SVG, ICO, TIFF and BMP).', 'error');
}
}
return true;
Expand Down