This commit is contained in:
syuilo
2020-09-05 13:09:34 +09:00
parent 138c9868e8
commit deb3df1536
67 changed files with 229 additions and 229 deletions

View File

@@ -60,7 +60,7 @@ export default defineComponent({
methods: {
async setAntenna() {
const antennas = await this.$root.api('antennas/list');
const { canceled, result: antenna } = await this.$root.showDialog({
const { canceled, result: antenna } = await this.$store.dispatch('showDialog', {
title: this.$t('selectAntenna'),
type: null,
select: {

View File

@@ -137,7 +137,7 @@ export default defineComponent({
icon: faPencilAlt,
text: this.$t('rename'),
action: () => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
title: this.$t('rename'),
input: {
default: this.column.name,

View File

@@ -60,7 +60,7 @@ export default defineComponent({
methods: {
async setList() {
const lists = await this.$root.api('users/lists/list');
const { canceled, result: list } = await this.$root.showDialog({
const { canceled, result: list } = await this.$store.dispatch('showDialog', {
title: this.$t('selectList'),
type: null,
select: {

View File

@@ -78,7 +78,7 @@ export default defineComponent({
methods: {
async setType() {
const { canceled, result: src } = await this.$root.showDialog({
const { canceled, result: src } = await this.$store.dispatch('showDialog', {
title: this.$t('timeline'),
type: null,
select: {

View File

@@ -128,7 +128,7 @@ export default defineComponent({
},
rename() {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
title: this.$t('renameFile'),
input: {
placeholder: this.$t('inputNewFileName'),
@@ -153,7 +153,7 @@ export default defineComponent({
copyUrl() {
copyToClipboard(this.file.url);
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
@@ -172,7 +172,7 @@ export default defineComponent({
},
async deleteFile() {
const { canceled } = await this.$root.showDialog({
const { canceled } = await this.$store.dispatch('showDialog', {
type: 'warning',
text: this.$t('driveFileDeleteConfirm', { name: this.file.name }),
showCancelButton: true

View File

@@ -149,13 +149,13 @@ export default defineComponent({
}).catch(err => {
switch (err) {
case 'detected-circular-definition':
this.$root.showDialog({
this.$store.dispatch('showDialog', {
title: this.$t('unableToProcess'),
text: this.$t('circularReferenceFolder')
});
break;
default:
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: this.$t('error')
});
@@ -189,7 +189,7 @@ export default defineComponent({
},
rename() {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
title: this.$t('renameFolder'),
input: {
placeholder: this.$t('inputNewFolderName'),
@@ -217,14 +217,14 @@ export default defineComponent({
}).catch(err => {
switch(err.id) {
case 'b0fc8a17-963c-405d-bfbc-859a487295e1':
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
title: this.$t('unableToDelete'),
text: this.$t('hasChildFilesOrFolders')
});
break;
default:
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: this.$t('unableToDelete')
});

View File

@@ -282,13 +282,13 @@ export default defineComponent({
}).catch(err => {
switch (err) {
case 'detected-circular-definition':
this.$root.showDialog({
this.$store.dispatch('showDialog', {
title: this.$t('unableToProcess'),
text: this.$t('circularReferenceFolder')
});
break;
default:
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: this.$t('error')
});
@@ -303,7 +303,7 @@ export default defineComponent({
},
urlUpload() {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
title: this.$t('uploadFromUrl'),
input: {
placeholder: this.$t('uploadFromUrlDescription')
@@ -315,7 +315,7 @@ export default defineComponent({
folderId: this.folder ? this.folder.id : undefined
});
this.$root.showDialog({
this.$store.dispatch('showDialog', {
title: this.$t('uploadFromUrlRequested'),
text: this.$t('uploadFromUrlMayTakeTime')
});
@@ -323,7 +323,7 @@ export default defineComponent({
},
createFolder() {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
title: this.$t('createFolder'),
input: {
placeholder: this.$t('folderName')
@@ -340,7 +340,7 @@ export default defineComponent({
},
renameFolder(folder) {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
title: this.$t('renameFolder'),
input: {
placeholder: this.$t('inputNewFolderName'),
@@ -367,14 +367,14 @@ export default defineComponent({
}).catch(err => {
switch(err.id) {
case 'b0fc8a17-963c-405d-bfbc-859a487295e1':
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
title: this.$t('unableToDelete'),
text: this.$t('hasChildFilesOrFolders')
});
break;
default:
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: this.$t('unableToDelete')
});

View File

@@ -91,7 +91,7 @@ export default defineComponent({
try {
if (this.isFollowing) {
const { canceled } = await this.$root.showDialog({
const { canceled } = await this.$store.dispatch('showDialog', {
type: 'warning',
text: this.$t('unfollowConfirm', { name: this.user.name || this.user.username }),
showCancelButton: true

View File

@@ -519,7 +519,7 @@ export default defineComponent({
this.$root.api('notes/favorites/create', {
noteId: this.appearNote.id
}).then(() => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
@@ -527,7 +527,7 @@ export default defineComponent({
},
del() {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'warning',
text: this.$t('noteDeleteConfirm'),
showCancelButton: true
@@ -541,7 +541,7 @@ export default defineComponent({
},
delEdit() {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'warning',
text: this.$t('deleteAndEditConfirm'),
showCancelButton: true
@@ -560,7 +560,7 @@ export default defineComponent({
this.$root.api(favorite ? 'notes/favorites/create' : 'notes/favorites/delete', {
noteId: this.appearNote.id
}).then(() => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
@@ -571,7 +571,7 @@ export default defineComponent({
this.$root.api(watch ? 'notes/watching/create' : 'notes/watching/delete', {
noteId: this.appearNote.id
}).then(() => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
@@ -716,7 +716,7 @@ export default defineComponent({
copyContent() {
copyToClipboard(this.appearNote.text);
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
@@ -724,7 +724,7 @@ export default defineComponent({
copyLink() {
copyToClipboard(`${url}/notes/${this.appearNote.id}`);
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
@@ -734,13 +734,13 @@ export default defineComponent({
this.$root.api(pin ? 'i/pin' : 'i/unpin', {
noteId: this.appearNote.id
}).then(() => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
}).catch(e => {
if (e.id === '72dab508-c64d-498f-8740-a8eec1ba385a') {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: this.$t('pinLimitExceeded')
});
@@ -749,7 +749,7 @@ export default defineComponent({
},
async promote() {
const { canceled, result: days } = await this.$root.showDialog({
const { canceled, result: days } = await this.$store.dispatch('showDialog', {
title: this.$t('numberOfDays'),
input: { type: 'number' }
});
@@ -760,12 +760,12 @@ export default defineComponent({
noteId: this.appearNote.id,
expiresAt: Date.now() + (86400000 * days)
}).then(() => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
}).catch(e => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: e
});

View File

@@ -134,7 +134,7 @@ export default defineComponent({
acceptGroupInvitation() {
this.groupInviteDone = true;
this.$root.api('users/groups/invitations/accept', { invitationId: this.notification.invitation.id });
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});

View File

@@ -24,7 +24,7 @@ export default defineComponent({
click() {
if (this.value.action === 'dialog') {
this.hpml.eval();
this.$root.showDialog({
this.$store.dispatch('showDialog', {
text: this.hpml.interpolate(this.value.content)
});
} else if (this.value.action === 'resetRandom') {
@@ -39,7 +39,7 @@ export default defineComponent({
} : {})
});
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
text: this.hpml.interpolate(this.value.message)
});

View File

@@ -44,7 +44,7 @@ export default defineComponent({
methods: {
upload() {
return new Promise((ok) => {
const dialog = this.$root.showDialog({
const dialog = this.$store.dispatch('showDialog', {
type: 'waiting',
text: this.$t('uploading') + '...',
showOkButton: false,
@@ -80,7 +80,7 @@ export default defineComponent({
fileIds: file ? [file.id] : undefined,
}).then(() => {
this.posted = true;
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});

View File

@@ -49,7 +49,7 @@ export default defineComponent({
ast = parse(this.page.script);
} catch (e) {
console.error(e);
/*this.$root.showDialog({
/*this.$store.dispatch('showDialog', {
type: 'error',
text: 'Syntax error :('
});*/
@@ -59,7 +59,7 @@ export default defineComponent({
this.hpml.eval();
}).catch(e => {
console.error(e);
/*this.$root.showDialog({
/*this.$store.dispatch('showDialog', {
type: 'error',
text: e
});*/

View File

@@ -62,7 +62,7 @@ export default defineComponent({
});
},
async rename(file) {
const { canceled, result } = await this.$root.showDialog({
const { canceled, result } = await this.$store.dispatch('showDialog', {
title: this.$t('enterFileName'),
input: {
default: file.name

View File

@@ -469,7 +469,7 @@ export default defineComponent({
if (!this.renote && !this.quoteId && paste.startsWith(url + '/notes/')) {
e.preventDefault();
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'info',
text: this.$t('quoteQuestion'),
showCancelButton: true

View File

@@ -127,7 +127,7 @@ export default defineComponent({
search() {
if (this.searching) return;
this.$root.showDialog({
this.$store.dispatch('showDialog', {
title: this.$t('search'),
input: true
}).then(async ({ canceled, result: query }) => {
@@ -277,7 +277,7 @@ export default defineComponent({
async addAcount() {
this.$root.new(await import('./signin-dialog.vue')).$once('login', res => {
this.$store.dispatch('addAcount', res);
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
@@ -297,7 +297,7 @@ export default defineComponent({
},
switchAccountWithToken(token: string) {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'waiting',
iconOnly: true
});

View File

@@ -145,7 +145,7 @@ export default defineComponent({
this.$emit('login', res);
}).catch(err => {
if (err === null) return;
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: this.$t('signinFailed')
});
@@ -166,7 +166,7 @@ export default defineComponent({
this.challengeData = res;
return this.queryKey();
}).catch(() => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: this.$t('signinFailed')
});
@@ -186,7 +186,7 @@ export default defineComponent({
}).then(res => {
this.$emit('login', res);
}).catch(() => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: this.$t('loginFailed')
});

View File

@@ -193,7 +193,7 @@ export default defineComponent({
this.$refs.hcaptcha?.reset?.();
this.$refs.recaptcha?.reset?.();
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: this.$t('error')
});

View File

@@ -100,13 +100,13 @@ export default defineComponent({
const t = this.$t('selectList'); // なぜか後で参照すると null になるので最初にメモリに確保しておく
const lists = await this.$root.api('users/lists/list');
if (lists.length === 0) {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: this.$t('youHaveNoLists')
});
return;
}
const { canceled, result: listId } = await this.$root.showDialog({
const { canceled, result: listId } = await this.$store.dispatch('showDialog', {
type: null,
title: t,
select: {
@@ -121,12 +121,12 @@ export default defineComponent({
listId: listId,
userId: this.user.id
}).then(() => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
}).catch(e => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: e
});
@@ -136,13 +136,13 @@ export default defineComponent({
async inviteGroup() {
const groups = await this.$root.api('users/groups/owned');
if (groups.length === 0) {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: this.$t('youHaveNoGroups')
});
return;
}
const { canceled, result: groupId } = await this.$root.showDialog({
const { canceled, result: groupId } = await this.$store.dispatch('showDialog', {
type: null,
title: this.$t('group'),
select: {
@@ -157,12 +157,12 @@ export default defineComponent({
groupId: groupId,
userId: this.user.id
}).then(() => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
}).catch(e => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: e
});
@@ -174,12 +174,12 @@ export default defineComponent({
userId: this.user.id
}).then(() => {
this.user.isMuted = !this.user.isMuted;
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
}, e => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: e
});
@@ -193,12 +193,12 @@ export default defineComponent({
userId: this.user.id
}).then(() => {
this.user.isBlocking = !this.user.isBlocking;
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
}, e => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: e
});
@@ -212,12 +212,12 @@ export default defineComponent({
userId: this.user.id
}).then(() => {
this.user.isSilenced = !this.user.isSilenced;
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
}, e => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: e
});
@@ -231,12 +231,12 @@ export default defineComponent({
userId: this.user.id
}).then(() => {
this.user.isSuspended = !this.user.isSuspended;
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'success',
iconOnly: true, autoClose: true
});
}, e => {
this.$root.showDialog({
this.$store.dispatch('showDialog', {
type: 'error',
text: e
});
@@ -244,7 +244,7 @@ export default defineComponent({
},
async getConfirmed(text: string): Promise<Boolean> {
const confirm = await this.$root.showDialog({
const confirm = await this.$store.dispatch('showDialog', {
type: 'warning',
showCancelButton: true,
title: 'confirm',