2022-12-21 01:00:00 -06:00
|
|
|
<template>
|
2023-01-05 18:41:14 -06:00
|
|
|
<MkModalWindow
|
2022-12-21 01:00:00 -06:00
|
|
|
ref="dialog"
|
|
|
|
:width="400"
|
|
|
|
:height="450"
|
2023-05-18 23:58:09 -05:00
|
|
|
:withOkButton="true"
|
|
|
|
:okButtonDisabled="false"
|
2022-12-21 01:00:00 -06:00
|
|
|
@ok="ok()"
|
|
|
|
@close="dialog.close()"
|
|
|
|
@closed="emit('closed')"
|
|
|
|
>
|
|
|
|
<template #header>{{ i18n.ts.describeFile }}</template>
|
2023-05-18 23:58:09 -05:00
|
|
|
<MkSpacer :marginMin="20" :marginMax="28">
|
2022-12-29 02:26:10 -06:00
|
|
|
<MkDriveFileThumbnail :file="file" fit="contain" style="height: 100px; margin-bottom: 16px;"/>
|
2022-12-21 01:00:00 -06:00
|
|
|
<MkTextarea v-model="caption" autofocus :placeholder="i18n.ts.inputNewDescription">
|
|
|
|
<template #label>{{ i18n.ts.caption }}</template>
|
|
|
|
</MkTextarea>
|
2022-12-29 02:26:10 -06:00
|
|
|
</MkSpacer>
|
2023-01-05 18:41:14 -06:00
|
|
|
</MkModalWindow>
|
2022-12-21 01:00:00 -06:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
|
|
|
import * as Misskey from 'misskey-js';
|
2023-01-05 18:41:14 -06:00
|
|
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
2023-01-07 00:09:46 -06:00
|
|
|
import MkTextarea from '@/components/MkTextarea.vue';
|
2022-12-21 01:00:00 -06:00
|
|
|
import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue';
|
|
|
|
import { i18n } from '@/i18n';
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
file: Misskey.entities.DriveFile;
|
|
|
|
default: string;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
(ev: 'done', v: string): void;
|
|
|
|
(ev: 'closed'): void;
|
|
|
|
}>();
|
|
|
|
|
2023-01-05 18:41:14 -06:00
|
|
|
const dialog = $shallowRef<InstanceType<typeof MkModalWindow>>();
|
2022-12-21 01:00:00 -06:00
|
|
|
|
|
|
|
let caption = $ref(props.default);
|
|
|
|
|
|
|
|
async function ok() {
|
|
|
|
emit('done', caption);
|
|
|
|
dialog.close();
|
|
|
|
}
|
|
|
|
</script>
|