diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-08-02 12:05:17 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-08-03 11:49:45 +0200 |
commit | 0a046844f657a10f993e35473f3f0bac557db516 (patch) | |
tree | b883ad6bc7b4d8fd3db78b48ee9505a35d5da80a /apps/theming/src | |
parent | c7c94a39f779cde2f142ba9e057e633f76287790 (diff) | |
download | nextcloud-server-0a046844f657a10f993e35473f3f0bac557db516.tar.gz nextcloud-server-0a046844f657a10f993e35473f3f0bac557db516.zip |
feat(theming): add mime accept in Theming image file picker
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/theming/src')
-rw-r--r-- | apps/theming/src/components/admin/FileInputField.vue | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/theming/src/components/admin/FileInputField.vue b/apps/theming/src/components/admin/FileInputField.vue index 8af17711141..3d6fda9ec70 100644 --- a/apps/theming/src/components/admin/FileInputField.vue +++ b/apps/theming/src/components/admin/FileInputField.vue @@ -71,6 +71,7 @@ </NcNoteCard> <input ref="input" + :accept="acceptMime" type="file" @change="onChange"> </div> @@ -79,6 +80,7 @@ <script> import axios from '@nextcloud/axios' import { generateUrl } from '@nextcloud/router' +import { loadState } from '@nextcloud/initial-state' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js' @@ -89,6 +91,10 @@ import Upload from 'vue-material-design-icons/Upload.vue' import FieldMixin from '../../mixins/admin/FieldMixin.js' +const { + allowedMimeTypes, +} = loadState('theming', 'adminThemingParameters', {}) + export default { name: 'FileInputField', @@ -135,6 +141,8 @@ export default { data() { return { showLoading: false, + acceptMime: (allowedMimeTypes[this.name] + || ['image/jpeg', 'image/png', 'image/gif', 'image/webp']).join(','), } }, |