summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkPostFormAttaches.vue
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2023-11-03 15:35:07 +0900
committerGitHub <noreply@github.com>2023-11-03 15:35:07 +0900
commit24e629ca5c50789ff0aba31532ae66b51148d70f (patch)
tree513155452fd0644c6b69bf7e53e26ab6575977db /packages/frontend/src/components/MkPostFormAttaches.vue
parentenhance: アカウント登録時のメールアドレス認証に30分の有... (diff)
downloadsharkey-24e629ca5c50789ff0aba31532ae66b51148d70f.tar.gz
sharkey-24e629ca5c50789ff0aba31532ae66b51148d70f.tar.bz2
sharkey-24e629ca5c50789ff0aba31532ae66b51148d70f.zip
enhance: 初期設定とチュートリアルを統合 (#12141)
* better onboarding experience * enhance: iroiro * (add) title * (enhance) 戻る・次へボタンを全ページでstickyに * fix merging * (add) iroiro * remove unnecessary file * Update CHANGELOG.md * tweak texts * (fix) reactionViewer mock * change strings * Update MkTutorialDialog.Note.vue * Update ja-JP.yml * (fix) reactionViewer error * (fix) path * refactor * fix * Update MkPostForm.vue * Update ja-JP.yml * Update ja-JP.yml * tweak text * Update ja-JP.yml * Update ja-JP.yml * Update ja-JP.yml * (add) achivement * (add) もう一度見れますよメッセージを追加 * Revert "feat: レジストリAPIをサードパーティから利用可能に (#12229)" This reverts commit 79346272f8792d35955efd3aaaa1e42e0cd2a6e3. * Revert "(add) もう一度見れますよメッセージを追加" This reverts commit 6123b35215133f0d5e5db356bb43f4acbafab8fa. * Revert "Revert "feat: レジストリAPIをサードパーティから利用可能に (#12229)"" This reverts commit bae684e484ef99308d7ac816a822047117efe1c6. * tweak --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/frontend/src/components/MkPostFormAttaches.vue')
-rw-r--r--packages/frontend/src/components/MkPostFormAttaches.vue17
1 files changed, 16 insertions, 1 deletions
diff --git a/packages/frontend/src/components/MkPostFormAttaches.vue b/packages/frontend/src/components/MkPostFormAttaches.vue
index d499a22ed6..28a09c571f 100644
--- a/packages/frontend/src/components/MkPostFormAttaches.vue
+++ b/packages/frontend/src/components/MkPostFormAttaches.vue
@@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
-import { defineAsyncComponent } from 'vue';
+import { defineAsyncComponent, inject } from 'vue';
import * as Misskey from 'misskey-js';
import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue';
import * as os from '@/os.js';
@@ -33,6 +33,8 @@ const props = defineProps<{
detachMediaFn?: (id: string) => void;
}>();
+const mock = inject<boolean>('mock', false);
+
const emit = defineEmits<{
(ev: 'update:modelValue', value: any[]): void;
(ev: 'detach', id: string): void;
@@ -44,6 +46,8 @@ const emit = defineEmits<{
let menuShowing = false;
function detachMedia(id: string) {
+ if (mock) return;
+
if (props.detachMediaFn) {
props.detachMediaFn(id);
} else {
@@ -52,6 +56,11 @@ function detachMedia(id: string) {
}
function toggleSensitive(file) {
+ if (mock) {
+ emit('changeSensitive', file, !file.isSensitive);
+ return;
+ }
+
os.api('drive/files/update', {
fileId: file.id,
isSensitive: !file.isSensitive,
@@ -61,6 +70,8 @@ function toggleSensitive(file) {
}
async function rename(file) {
+ if (mock) return;
+
const { canceled, result } = await os.inputText({
title: i18n.ts.enterFileName,
default: file.name,
@@ -77,6 +88,8 @@ async function rename(file) {
}
async function describe(file) {
+ if (mock) return;
+
os.popup(defineAsyncComponent(() => import('@/components/MkFileCaptionEditWindow.vue')), {
default: file.comment !== null ? file.comment : '',
file: file,
@@ -94,6 +107,8 @@ async function describe(file) {
}
async function crop(file: Misskey.entities.DriveFile): Promise<void> {
+ if (mock) return;
+
const newFile = await os.cropImage(file, { aspectRatio: NaN });
emit('replaceFile', file, newFile);
}