diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 0e8e22752f..7737e6044e 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -908,6 +908,7 @@ sendPushNotificationReadMessage: "通知やメッセージが既読になった sendPushNotificationReadMessageCaption: "「{emptyPushNotificationMessage}」という通知が一瞬表示されるようになります。端末の電池消費量が増加する可能性があります。" windowMaximize: "最大化" windowRestore: "元に戻す" +caption: "キャプション" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てることができます。サーバーの負荷が少し増えます。" diff --git a/packages/client/src/components/MkDrive.file.vue b/packages/client/src/components/MkDrive.file.vue index 11bd9e9e3b..8c17c0530a 100644 --- a/packages/client/src/components/MkDrive.file.vue +++ b/packages/client/src/components/MkDrive.file.vue @@ -71,7 +71,7 @@ function getMenu() { action: toggleSensitive, }, { text: i18n.ts.describeFile, - icon: 'ti ti-forms', + icon: 'ti ti-text-caption', action: describe, }, null, { text: i18n.ts.copyUrl, @@ -134,20 +134,14 @@ function rename() { } function describe() { - os.popup(defineAsyncComponent(() => import('@/components/MkMediaCaption.vue')), { - title: i18n.ts.describeFile, - input: { - placeholder: i18n.ts.inputNewDescription, - default: props.file.comment != null ? props.file.comment : '', - }, - image: props.file, + os.popup(defineAsyncComponent(() => import('@/components/MkFileCaptionEditWindow.vue')), { + default: props.file.comment != null ? props.file.comment : '', + file: props.file, }, { - done: result => { - if (!result || result.canceled) return; - let comment = result.result; + done: caption => { os.api('drive/files/update', { fileId: props.file.id, - comment: comment.length === 0 ? null : comment, + comment: caption.length === 0 ? null : caption, }); }, }, 'closed'); diff --git a/packages/client/src/components/MkFileCaptionEditWindow.vue b/packages/client/src/components/MkFileCaptionEditWindow.vue new file mode 100644 index 0000000000..73875251f0 --- /dev/null +++ b/packages/client/src/components/MkFileCaptionEditWindow.vue @@ -0,0 +1,175 @@ + + + {{ i18n.ts.describeFile }} + + + + {{ i18n.ts.caption }} + + + + + + + + diff --git a/packages/client/src/components/MkMediaCaption.vue b/packages/client/src/components/MkMediaCaption.vue deleted file mode 100644 index c25755d762..0000000000 --- a/packages/client/src/components/MkMediaCaption.vue +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - - - {{ remainingLength }} - - - - {{ $ts.ok }} - {{ $ts.cancel }} - - - - - {{ image.name }} - - - - - - - - - - diff --git a/packages/client/src/components/MkPostFormAttaches.vue b/packages/client/src/components/MkPostFormAttaches.vue index 955d835f25..2e16cc52a7 100644 --- a/packages/client/src/components/MkPostFormAttaches.vue +++ b/packages/client/src/components/MkPostFormAttaches.vue @@ -70,17 +70,12 @@ async function rename(file) { } async function describe(file) { - os.popup(defineAsyncComponent(() => import('@/components/MkMediaCaption.vue')), { - title: i18n.ts.describeFile, - input: { - placeholder: i18n.ts.inputNewDescription, - default: file.comment !== null ? file.comment : '', - }, - image: file, + os.popup(defineAsyncComponent(() => import('@/components/MkFileCaptionEditWindow.vue')), { + default: file.comment !== null ? file.comment : '', + file: file, }, { - done: result => { - if (!result || result.canceled) return; - let comment = result.result.length === 0 ? null : result.result; + done: caption => { + let comment = caption.length === 0 ? null : caption; os.api('drive/files/update', { fileId: file.id, comment: comment, @@ -103,7 +98,7 @@ function showFileMenu(file, ev: MouseEvent) { action: () => { toggleSensitive(file); }, }, { text: i18n.ts.describeFile, - icon: 'ti ti-forms', + icon: 'ti ti-text-caption', action: () => { describe(file); }, }, { text: i18n.ts.attachCancel,