From e0fbeee88edb29f04a3260560d10d1a812f84029 Mon Sep 17 00:00:00 2001
From: Henry Jameson
Date: Mon, 24 Apr 2023 21:57:31 +0300
Subject: [PATCH] finish up attachment setting (right now only for admin
section only)
---
src/components/media_upload/media_upload.js | 18 ++++--
src/components/media_upload/media_upload.vue | 22 +++++--
.../helpers/attachment_setting.js | 7 ++-
.../helpers/attachment_setting.vue | 57 +++++++++++++------
src/i18n/en.json | 2 +
5 files changed, 75 insertions(+), 31 deletions(-)
diff --git a/src/components/media_upload/media_upload.js b/src/components/media_upload/media_upload.js
index cfd42d4ccd..8c9e5f71d1 100644
--- a/src/components/media_upload/media_upload.js
+++ b/src/components/media_upload/media_upload.js
@@ -23,6 +23,11 @@ const mediaUpload = {
}
},
methods: {
+ onClick () {
+ if (this.uploadReady) {
+ this.$refs.input.click()
+ }
+ },
uploadFile (file) {
const self = this
const store = this.$store
@@ -69,10 +74,15 @@ const mediaUpload = {
this.multiUpload(target.files)
}
},
- props: [
- 'dropFiles',
- 'disabled'
- ],
+ props: {
+ dropFiles: Object,
+ disabled: Boolean,
+ normalButton: Boolean,
+ acceptTypes: {
+ type: String,
+ default: '*/*'
+ }
+ },
watch: {
dropFiles: function (fileInfos) {
if (!this.uploading) {
diff --git a/src/components/media_upload/media_upload.vue b/src/components/media_upload/media_upload.vue
index 2799495bbc..c761b94f47 100644
--- a/src/components/media_upload/media_upload.vue
+++ b/src/components/media_upload/media_upload.vue
@@ -1,8 +1,10 @@
-
+
@@ -32,10 +40,12 @@
@import "../../variables";
.media-upload {
- cursor: pointer; // We use
@@ -63,8 +68,24 @@
.AttachmentSetting {
.attachment {
display: block;
- width: 20em;
+ width: 100%;
height: 15em;
+ margin-bottom: 0.5em;
+ }
+
+ .attachment-input {
+ margin-left: 1em;
+ display: flex;
+ flex-direction: column;
+ width: 20em;
+ }
+
+ .controls {
+ margin-bottom: 0.5em;
+
+ input, button {
+ width: 100%;
+ }
}
}
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 082ad8269d..44998453dd 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -519,6 +519,8 @@
"loop_video_silent_only": "Loop only videos without sound (i.e. Mastodon's \"gifs\")",
"mutes_tab": "Mutes",
"play_videos_in_modal": "Play videos in a popup frame",
+ "url": "URL",
+ "preview": "Preview",
"file_export_import": {
"backup_restore": "Settings backup",
"backup_settings": "Backup settings to file",