From d453196c9f9cfdb7b40a894752fe5bb805716c3a Mon Sep 17 00:00:00 2001 From: samunohito <46447427+samunohito@users.noreply.github.com> Date: Tue, 30 Jan 2024 19:25:41 +0900 Subject: [PATCH] support choose pc file and drive file --- .../admin/custom-emojis-grid.register.vue | 34 +++++++++++++++++-- packages/frontend/src/scripts/select-file.ts | 20 +++++++++-- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/pages/admin/custom-emojis-grid.register.vue b/packages/frontend/src/pages/admin/custom-emojis-grid.register.vue index 1117715d6a..ecb8bd457b 100644 --- a/packages/frontend/src/pages/admin/custom-emojis-grid.register.vue +++ b/packages/frontend/src/pages/admin/custom-emojis-grid.register.vue @@ -46,7 +46,14 @@ @dragover.prevent @drop.prevent.stop="onDrop" > - ここに絵文字の画像ファイルをドラッグ&ドロップするとドライブにアップロードされます。 +
+ いずれかの方法で登録する絵文字を選択してください。 +
+
file.name.replace(/\.[a-zA-Z0-9]+$/, ''), + }, + ); + gridItems.value.push(...driveFiles.map(GridItem.fromDriveFile)); +} + +async function onDriveSelectClicked(ev: MouseEvent) { + ev.preventDefault(); + const driveFiles = await chooseFileFromDrive(true); + gridItems.value.push(...driveFiles.map(GridItem.fromDriveFile)); +} + function onRowDeleting(rows: GridRow[]) { const deletedIndexes = rows.map(it => it.index); gridItems.value = gridItems.value.filter((_, index) => !deletedIndexes.includes(index)); @@ -270,13 +298,15 @@ onMounted(async () => {