Merge pull request #8205 from tclaus/8189-filter-upload-image-types

File selection dialog accepts only image types
This commit is contained in:
Dennis Schubert 2021-02-13 04:38:16 +01:00
commit 1ef0cef74c
No known key found for this signature in database
GPG key ID: 5A0304BEA7966D7E
4 changed files with 4 additions and 0 deletions

View file

@ -25,6 +25,7 @@ Although the chat was never enabled per default and was marked as experimental,
## Bug fixes ## Bug fixes
* Fix multiple photos upload progress bar [#7655](https://github.com/diaspora/diaspora/pull/7655) * Fix multiple photos upload progress bar [#7655](https://github.com/diaspora/diaspora/pull/7655)
* Photo-upload file picker now correctly restricts possible file types [#8205](https://github.com/diaspora/diaspora/pull/8205)
## Features ## Features
* Add client-side cropping of profile image uploads [#7581](https://github.com/diaspora/diaspora/pull/7581) * Add client-side cropping of profile image uploads [#7581](https://github.com/diaspora/diaspora/pull/7581)

View file

@ -54,6 +54,7 @@ Diaspora.PostPhotoUploader = class {
} }
}, },
validation: { validation: {
acceptFiles: "image/png, image/jpeg, image/gif",
allowedExtensions: ["jpg", "jpeg", "png", "gif"], allowedExtensions: ["jpg", "jpeg", "png", "gif"],
sizeLimit: (window.Promise && qq.supportedFeatures.scaling ? null : this.sizeLimit) sizeLimit: (window.Promise && qq.supportedFeatures.scaling ? null : this.sizeLimit)
}, },

View file

@ -38,6 +38,7 @@ Diaspora.ProfilePhotoUploader = class {
this.fineUploader = new qq.FineUploaderBasic({ this.fineUploader = new qq.FineUploaderBasic({
element: this.fileInput, element: this.fileInput,
validation: { validation: {
acceptFiles: "image/png, image/jpeg",
allowedExtensions: ["jpg", "jpeg", "png"] allowedExtensions: ["jpg", "jpeg", "png"]
}, },
request: { request: {

View file

@ -11,6 +11,7 @@ Diaspora.ProfilePhotoUploader.prototype = {
new qq.FineUploaderBasic({ new qq.FineUploaderBasic({
element: document.getElementById("file-upload"), element: document.getElementById("file-upload"),
validation: { validation: {
acceptFiles: "image/png, image/jpeg, image/gif",
allowedExtensions: ["jpg", "jpeg", "png"], allowedExtensions: ["jpg", "jpeg", "png"],
sizeLimit: 4194304 sizeLimit: 4194304
}, },