2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
2024-02-13 16:59:27 +01:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 07:31:52 +02:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2022-12-21 08:00:00 +01:00
|
|
|
<template>
|
2023-01-06 01:41:14 +01:00
|
|
|
<MkModalWindow
|
2022-12-21 08:00:00 +01:00
|
|
|
ref="dialog"
|
|
|
|
:width="400"
|
|
|
|
:height="450"
|
2023-05-19 06:58:09 +02:00
|
|
|
:withOkButton="true"
|
|
|
|
:okButtonDisabled="false"
|
2022-12-21 08:00:00 +01:00
|
|
|
@ok="ok()"
|
2024-01-30 11:53:53 +01:00
|
|
|
@close="dialog?.close()"
|
2022-12-21 08:00:00 +01:00
|
|
|
@closed="emit('closed')"
|
|
|
|
>
|
|
|
|
<template #header>{{ i18n.ts.describeFile }}</template>
|
2023-05-19 06:58:09 +02:00
|
|
|
<MkSpacer :marginMin="20" :marginMax="28">
|
2023-11-01 01:10:26 +01:00
|
|
|
<MkDriveFileThumbnail :file="file" fit="contain" style="height: 193px; margin-bottom: 16px;"/>
|
2022-12-21 08:00:00 +01:00
|
|
|
<MkTextarea v-model="caption" autofocus :placeholder="i18n.ts.inputNewDescription">
|
|
|
|
<template #label>{{ i18n.ts.caption }}</template>
|
|
|
|
</MkTextarea>
|
2022-12-29 09:26:10 +01:00
|
|
|
</MkSpacer>
|
2023-01-06 01:41:14 +01:00
|
|
|
</MkModalWindow>
|
2022-12-21 08:00:00 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-12-07 06:42:09 +01:00
|
|
|
import { shallowRef, ref } from 'vue';
|
2022-12-21 08:00:00 +01:00
|
|
|
import * as Misskey from 'misskey-js';
|
2023-01-06 01:41:14 +01:00
|
|
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
2023-01-07 07:09:46 +01:00
|
|
|
import MkTextarea from '@/components/MkTextarea.vue';
|
2022-12-21 08:00:00 +01:00
|
|
|
import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue';
|
2023-09-19 09:37:43 +02:00
|
|
|
import { i18n } from '@/i18n.js';
|
2022-12-21 08:00:00 +01:00
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
file: Misskey.entities.DriveFile;
|
|
|
|
default: string;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
(ev: 'done', v: string): void;
|
|
|
|
(ev: 'closed'): void;
|
|
|
|
}>();
|
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
|
2022-12-21 08:00:00 +01:00
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const caption = ref(props.default);
|
2022-12-21 08:00:00 +01:00
|
|
|
|
|
|
|
async function ok() {
|
2023-12-07 06:42:09 +01:00
|
|
|
emit('done', caption.value);
|
2024-01-30 11:53:53 +01:00
|
|
|
dialog.value?.close();
|
2022-12-21 08:00:00 +01:00
|
|
|
}
|
|
|
|
</script>
|