wip
This commit is contained in:
parent
0e2a3ebc8d
commit
41032965f1
|
@ -3053,10 +3053,6 @@ _customEmojisManager:
|
||||||
uploadSettingDescription: "この画面で絵文字アップロードを行う際の動作を設定できます。"
|
uploadSettingDescription: "この画面で絵文字アップロードを行う際の動作を設定できます。"
|
||||||
directoryToCategoryLabel: "ディレクトリ名を\"category\"に入力する"
|
directoryToCategoryLabel: "ディレクトリ名を\"category\"に入力する"
|
||||||
directoryToCategoryCaption: "ディレクトリをドラッグ・ドロップした時に、ディレクトリ名を\"category\"に入力します。"
|
directoryToCategoryCaption: "ディレクトリをドラッグ・ドロップした時に、ディレクトリ名を\"category\"に入力します。"
|
||||||
emojiInputAreaCaption: "いずれかの方法で登録する絵文字を選択してください。"
|
|
||||||
emojiInputAreaList1: "この枠に画像ファイルまたはディレクトリをドラッグ&ドロップ"
|
|
||||||
emojiInputAreaList2: "このリンクをクリックしてPCから選択する"
|
|
||||||
emojiInputAreaList3: "このリンクをクリックしてドライブから選択する"
|
|
||||||
confirmRegisterEmojisDescription: "リストに表示されている絵文字を新たなカスタム絵文字として登録します。よろしいですか?(負荷を避けるため、一度の操作で登録可能な絵文字は{count}件までです)"
|
confirmRegisterEmojisDescription: "リストに表示されている絵文字を新たなカスタム絵文字として登録します。よろしいですか?(負荷を避けるため、一度の操作で登録可能な絵文字は{count}件までです)"
|
||||||
confirmClearEmojisDescription: "編集内容を破棄し、リストに表示されている絵文字をクリアします。よろしいですか?"
|
confirmClearEmojisDescription: "編集内容を破棄し、リストに表示されている絵文字をクリアします。よろしいですか?"
|
||||||
confirmUploadEmojisDescription: "ドラッグ&ドロップされた{count}個のファイルをドライブにアップロードします。実行しますか?"
|
confirmUploadEmojisDescription: "ドラッグ&ドロップされた{count}個のファイルをドライブにアップロードします。実行しますか?"
|
||||||
|
|
|
@ -18,8 +18,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<MkRadio v-model="radio" value="pleroma">Pleroma</MkRadio>
|
<MkRadio v-model="radio" value="pleroma">Pleroma</MkRadio>
|
||||||
</div>
|
</div>
|
||||||
<div :class="$style.preview__content1__button">
|
<div :class="$style.preview__content1__button">
|
||||||
<MkButton inline>This is</MkButton>
|
<MkButton inline>This is</MkButton>
|
||||||
<MkButton inline primary>the button</MkButton>
|
<MkButton inline primary>the button</MkButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div :class="$style.preview__content2" style="pointer-events: none;">
|
<div :class="$style.preview__content2" style="pointer-events: none;">
|
||||||
|
@ -36,13 +36,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import * as config from '@@/js/config.js';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import MkInput from '@/components/MkInput.vue';
|
import MkInput from '@/components/MkInput.vue';
|
||||||
import MkSwitch from '@/components/MkSwitch.vue';
|
import MkSwitch from '@/components/MkSwitch.vue';
|
||||||
import MkTextarea from '@/components/MkTextarea.vue';
|
import MkTextarea from '@/components/MkTextarea.vue';
|
||||||
import MkRadio from '@/components/MkRadio.vue';
|
import MkRadio from '@/components/MkRadio.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import * as config from '@@/js/config.js';
|
|
||||||
import { $i } from '@/i.js';
|
import { $i } from '@/i.js';
|
||||||
|
|
||||||
const text = ref('');
|
const text = ref('');
|
||||||
|
@ -79,7 +79,9 @@ const openForm = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const openDrive = async () => {
|
const openDrive = async () => {
|
||||||
await os.selectDriveFile(false);
|
await os.selectDriveFile({
|
||||||
|
multiple: false,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectUser = async () => {
|
const selectUser = async () => {
|
||||||
|
|
|
@ -37,7 +37,6 @@ import MkInput from '@/components/MkInput.vue';
|
||||||
import MkTextarea from '@/components/MkTextarea.vue';
|
import MkTextarea from '@/components/MkTextarea.vue';
|
||||||
import FormSlot from '@/components/form/slot.vue';
|
import FormSlot from '@/components/form/slot.vue';
|
||||||
import MkInfo from '@/components/MkInfo.vue';
|
import MkInfo from '@/components/MkInfo.vue';
|
||||||
import { chooseFileFromPcAndUpload } from '@/utility/select-file.js';
|
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { ensureSignin } from '@/i.js';
|
import { ensureSignin } from '@/i.js';
|
||||||
|
|
||||||
|
|
|
@ -594,10 +594,10 @@ export async function selectUser(opts: { includeSelf?: boolean; localOnly?: bool
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function selectDriveFile(multiple: boolean): Promise<Misskey.entities.DriveFile[]> {
|
export async function selectDriveFile(options: { multiple?: boolean; } = {}): Promise<Misskey.entities.DriveFile[]> {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkDriveFileSelectDialog.vue')), {
|
const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkDriveFileSelectDialog.vue')), {
|
||||||
multiple,
|
multiple: options.multiple,
|
||||||
}, {
|
}, {
|
||||||
done: files => {
|
done: files => {
|
||||||
if (files) {
|
if (files) {
|
||||||
|
|
|
@ -300,21 +300,20 @@ async function onClearClicked() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onFileSelectClicked() {
|
async function onFileSelectClicked() {
|
||||||
const driveFiles = await chooseFileFromPcAndUpload(
|
const driveFiles = await chooseFileFromPcAndUpload({
|
||||||
true,
|
multiple: true,
|
||||||
{
|
folderId: selectedFolderId.value,
|
||||||
uploadFolder: selectedFolderId.value,
|
// 拡張子は消す
|
||||||
keepOriginal: true,
|
nameConverter: (file) => file.name.replace(/\.[a-zA-Z0-9]+$/, ''),
|
||||||
// 拡張子は消す
|
});
|
||||||
nameConverter: (file) => file.name.replace(/\.[a-zA-Z0-9]+$/, ''),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
gridItems.value.push(...driveFiles.map(fromDriveFile));
|
gridItems.value.push(...driveFiles.map(fromDriveFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onDriveSelectClicked() {
|
async function onDriveSelectClicked() {
|
||||||
const driveFiles = await chooseFileFromDrive(true);
|
const driveFiles = await chooseFileFromDrive({
|
||||||
|
multiple: true,
|
||||||
|
});
|
||||||
gridItems.value.push(...driveFiles.map(fromDriveFile));
|
gridItems.value.push(...driveFiles.map(fromDriveFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
/* eslint-disable vue/no-mutating-props */
|
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import XContainer from '../page-editor.container.vue';
|
import XContainer from '../page-editor.container.vue';
|
||||||
|
@ -41,7 +41,7 @@ const emit = defineEmits<{
|
||||||
const file = ref<Misskey.entities.DriveFile | null>(null);
|
const file = ref<Misskey.entities.DriveFile | null>(null);
|
||||||
|
|
||||||
async function choose() {
|
async function choose() {
|
||||||
os.selectDriveFile(false).then((fileResponse) => {
|
os.selectDriveFile({ multiple: false }).then((fileResponse) => {
|
||||||
file.value = fileResponse[0];
|
file.value = fileResponse[0];
|
||||||
emit('update:modelValue', {
|
emit('update:modelValue', {
|
||||||
...props.modelValue,
|
...props.modelValue,
|
||||||
|
|
|
@ -298,7 +298,7 @@ function changeAvatar(ev) {
|
||||||
text: i18n.ts.fromDrive,
|
text: i18n.ts.fromDrive,
|
||||||
icon: 'ti ti-cloud',
|
icon: 'ti ti-cloud',
|
||||||
action: () => {
|
action: () => {
|
||||||
os.selectDriveFile(false).then(files => {
|
os.selectDriveFile({ multiple: false }).then(files => {
|
||||||
done(files[0]);
|
done(files[0]);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -346,7 +346,7 @@ function changeBanner(ev) {
|
||||||
text: i18n.ts.fromDrive,
|
text: i18n.ts.fromDrive,
|
||||||
icon: 'ti ti-cloud',
|
icon: 'ti ti-cloud',
|
||||||
action: () => {
|
action: () => {
|
||||||
os.selectDriveFile(false).then(files => {
|
os.selectDriveFile({ multiple: false }).then(files => {
|
||||||
done(files[0]);
|
done(files[0]);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -29,9 +29,13 @@ export function chooseFileFromPcAndUpload(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function chooseFileFromDrive(multiple: boolean): Promise<Misskey.entities.DriveFile[]> {
|
export function chooseFileFromDrive(options: {
|
||||||
|
multiple?: boolean;
|
||||||
|
} = {}): Promise<Misskey.entities.DriveFile[]> {
|
||||||
return new Promise((res, rej) => {
|
return new Promise((res, rej) => {
|
||||||
os.selectDriveFile(multiple).then(files => {
|
os.selectDriveFile({
|
||||||
|
multiple: options.multiple,
|
||||||
|
}).then(files => {
|
||||||
res(files);
|
res(files);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue