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: { methods: {
async setAntenna() { async setAntenna() {
const antennas = await this.$root.api('antennas/list'); 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'), title: this.$t('selectAntenna'),
type: null, type: null,
select: { select: {

View File

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

View File

@ -60,7 +60,7 @@ export default defineComponent({
methods: { methods: {
async setList() { async setList() {
const lists = await this.$root.api('users/lists/list'); 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'), title: this.$t('selectList'),
type: null, type: null,
select: { select: {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -100,13 +100,13 @@ export default defineComponent({
const t = this.$t('selectList'); // null const t = this.$t('selectList'); // null
const lists = await this.$root.api('users/lists/list'); const lists = await this.$root.api('users/lists/list');
if (lists.length === 0) { if (lists.length === 0) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: this.$t('youHaveNoLists') text: this.$t('youHaveNoLists')
}); });
return; return;
} }
const { canceled, result: listId } = await this.$root.showDialog({ const { canceled, result: listId } = await this.$store.dispatch('showDialog', {
type: null, type: null,
title: t, title: t,
select: { select: {
@ -121,12 +121,12 @@ export default defineComponent({
listId: listId, listId: listId,
userId: this.user.id userId: this.user.id
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
@ -136,13 +136,13 @@ export default defineComponent({
async inviteGroup() { async inviteGroup() {
const groups = await this.$root.api('users/groups/owned'); const groups = await this.$root.api('users/groups/owned');
if (groups.length === 0) { if (groups.length === 0) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: this.$t('youHaveNoGroups') text: this.$t('youHaveNoGroups')
}); });
return; return;
} }
const { canceled, result: groupId } = await this.$root.showDialog({ const { canceled, result: groupId } = await this.$store.dispatch('showDialog', {
type: null, type: null,
title: this.$t('group'), title: this.$t('group'),
select: { select: {
@ -157,12 +157,12 @@ export default defineComponent({
groupId: groupId, groupId: groupId,
userId: this.user.id userId: this.user.id
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
@ -174,12 +174,12 @@ export default defineComponent({
userId: this.user.id userId: this.user.id
}).then(() => { }).then(() => {
this.user.isMuted = !this.user.isMuted; this.user.isMuted = !this.user.isMuted;
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}, e => { }, e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
@ -193,12 +193,12 @@ export default defineComponent({
userId: this.user.id userId: this.user.id
}).then(() => { }).then(() => {
this.user.isBlocking = !this.user.isBlocking; this.user.isBlocking = !this.user.isBlocking;
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}, e => { }, e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
@ -212,12 +212,12 @@ export default defineComponent({
userId: this.user.id userId: this.user.id
}).then(() => { }).then(() => {
this.user.isSilenced = !this.user.isSilenced; this.user.isSilenced = !this.user.isSilenced;
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}, e => { }, e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
@ -231,12 +231,12 @@ export default defineComponent({
userId: this.user.id userId: this.user.id
}).then(() => { }).then(() => {
this.user.isSuspended = !this.user.isSuspended; this.user.isSuspended = !this.user.isSuspended;
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}, e => { }, e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
@ -244,7 +244,7 @@ export default defineComponent({
}, },
async getConfirmed(text: string): Promise<Boolean> { async getConfirmed(text: string): Promise<Boolean> {
const confirm = await this.$root.showDialog({ const confirm = await this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
showCancelButton: true, showCancelButton: true,
title: 'confirm', title: 'confirm',

View File

@ -141,7 +141,7 @@ export default defineComponent({
search() { search() {
if (this.searching) return; if (this.searching) return;
this.$root.showDialog({ this.$store.dispatch('showDialog', {
title: this.$t('search'), title: this.$t('search'),
input: true input: true
}).then(async ({ canceled, result: query }) => { }).then(async ({ canceled, result: query }) => {
@ -183,7 +183,7 @@ export default defineComponent({
'direct', 'direct',
]; ];
const { canceled, result: column } = await this.$root.showDialog({ const { canceled, result: column } = await this.$store.dispatch('showDialog', {
title: this.$t('_deck.addColumn'), title: this.$t('_deck.addColumn'),
type: null, type: null,
select: { select: {

View File

@ -301,7 +301,7 @@ export default defineComponent({
search() { search() {
if (this.searching) return; if (this.searching) return;
this.$root.showDialog({ this.$store.dispatch('showDialog', {
title: this.$t('search'), title: this.$t('search'),
input: true input: true
}).then(async ({ canceled, result: query }) => { }).then(async ({ canceled, result: query }) => {
@ -351,7 +351,7 @@ export default defineComponent({
}, },
async addWidget(place) { async addWidget(place) {
const { canceled, result: widget } = await this.$root.showDialog({ const { canceled, result: widget } = await this.$store.dispatch('showDialog', {
type: null, type: null,
title: this.$t('chooseWidget'), title: this.$t('chooseWidget'),
select: { select: {

View File

@ -92,7 +92,7 @@ export default defineComponent({
params.channelId = this.channelId; params.channelId = this.channelId;
this.$root.api('channels/update', params) this.$root.api('channels/update', params)
.then(channel => { .then(channel => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
@ -100,7 +100,7 @@ export default defineComponent({
} else { } else {
this.$root.api('channels/create', params) this.$root.api('channels/create', params)
.then(channel => { .then(channel => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -11,7 +11,7 @@ export default defineComponent({
const acct = new URL(location.href).searchParams.get('acct'); const acct = new URL(location.href).searchParams.get('acct');
if (acct == null) return; if (acct == null) return;
const dialog = this.$root.showDialog({ const dialog = this.$store.dispatch('showDialog', {
type: 'waiting', type: 'waiting',
text: this.$t('fetchingAsApObject') + '...', text: this.$t('fetchingAsApObject') + '...',
showOkButton: false, showOkButton: false,
@ -26,7 +26,7 @@ export default defineComponent({
if (res.type == 'User') { if (res.type == 'User') {
this.follow(res.object); this.follow(res.object);
} else { } else {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: 'Not a user' text: 'Not a user'
}).then(() => { }).then(() => {
@ -34,7 +34,7 @@ export default defineComponent({
}); });
} }
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}).then(() => { }).then(() => {
@ -47,7 +47,7 @@ export default defineComponent({
this.$root.api('users/show', parseAcct(acct)).then(user => { this.$root.api('users/show', parseAcct(acct)).then(user => {
this.follow(user); this.follow(user);
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}).then(() => { }).then(() => {
@ -61,7 +61,7 @@ export default defineComponent({
methods: { methods: {
async follow(user) { async follow(user) {
const { canceled } = await this.$root.showDialog({ const { canceled } = await this.$store.dispatch('showDialog', {
type: 'question', type: 'question',
text: this.$t('followConfirm', { name: user.name || user.username }), text: this.$t('followConfirm', { name: user.name || user.username }),
showCancelButton: true showCancelButton: true
@ -75,14 +75,14 @@ export default defineComponent({
this.$root.api('following/create', { this.$root.api('following/create', {
userId: user.id userId: user.id
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}).then(() => { }).then(() => {
window.close(); window.close();
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}).then(() => { }).then(() => {

View File

@ -57,7 +57,7 @@ export default defineComponent({
}).catch(() => { }).catch(() => {
this.submitting = false; this.submitting = false;
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: this.$t('error') text: this.$t('error')
}); });

View File

@ -68,7 +68,7 @@ export default defineComponent({
}, },
remove(announcement) { remove(announcement) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
text: this.$t('removeAreYouSure', { x: announcement.title }), text: this.$t('removeAreYouSure', { x: announcement.title }),
showCancelButton: true showCancelButton: true
@ -82,24 +82,24 @@ export default defineComponent({
save(announcement) { save(announcement) {
if (announcement.id == null) { if (announcement.id == null) {
this.$root.api('admin/announcements/create', announcement).then(() => { this.$root.api('admin/announcements/create', announcement).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
text: this.$t('saved') text: this.$t('saved')
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
}); });
} else { } else {
this.$root.api('admin/announcements/update', announcement).then(() => { this.$root.api('admin/announcements/update', announcement).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
text: this.$t('saved') text: this.$t('saved')
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });

View File

@ -128,7 +128,7 @@ export default defineComponent({
async add(e) { async add(e) {
const files = await selectFile(this, e.currentTarget || e.target, null, true); const files = await selectFile(this, e.currentTarget || e.target, null, true);
const dialog = this.$root.showDialog({ const dialog = this.$store.dispatch('showDialog', {
type: 'waiting', type: 'waiting',
text: this.$t('doing') + '...', text: this.$t('doing') + '...',
showOkButton: false, showOkButton: false,
@ -141,7 +141,7 @@ export default defineComponent({
}))) })))
.then(() => { .then(() => {
this.$refs.emojis.reload(); this.$refs.emojis.reload();
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
@ -159,7 +159,7 @@ export default defineComponent({
aliases: this.aliases.split(' '), aliases: this.aliases.split(' '),
}); });
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
@ -168,7 +168,7 @@ export default defineComponent({
}, },
async del() { async del() {
const { canceled } = await this.$root.showDialog({ const { canceled } = await this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
text: this.$t('removeAreYouSure', { x: this.selected.name }), text: this.$t('removeAreYouSure', { x: this.selected.name }),
showCancelButton: true showCancelButton: true
@ -187,12 +187,12 @@ export default defineComponent({
emojiId: this.selectedRemote.id, emojiId: this.selectedRemote.id,
}).then(() => { }).then(() => {
this.$refs.emojis.reload(); this.$refs.emojis.reload();
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });

View File

@ -34,7 +34,7 @@ export default defineComponent({
methods: { methods: {
clear() { clear() {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
text: this.$t('clearCachedFilesConfirm'), text: this.$t('clearCachedFilesConfirm'),
showCancelButton: true showCancelButton: true
@ -42,7 +42,7 @@ export default defineComponent({
if (canceled) return; if (canceled) return;
this.$root.api('admin/drive/clean-remote-files', {}).then(() => { this.$root.api('admin/drive/clean-remote-files', {}).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -578,7 +578,7 @@ export default defineComponent({
deleteAllLogs() { deleteAllLogs() {
this.$root.api('admin/delete-logs').then(() => { this.$root.api('admin/delete-logs').then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -255,7 +255,7 @@ export default defineComponent({
this.$root.api('admin/federation/remove-all-following', { this.$root.api('admin/federation/remove-all-following', {
host: this.instance.host host: this.instance.host
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
@ -266,7 +266,7 @@ export default defineComponent({
this.$root.api('admin/federation/delete-all-files', { this.$root.api('admin/federation/delete-all-files', {
host: this.instance.host host: this.instance.host
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -57,7 +57,7 @@ export default defineComponent({
methods: { methods: {
clear() { clear() {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
title: this.$t('clearQueueConfirmTitle'), title: this.$t('clearQueueConfirmTitle'),
text: this.$t('clearQueueConfirmText'), text: this.$t('clearQueueConfirmText'),
@ -66,7 +66,7 @@ export default defineComponent({
if (canceled) return; if (canceled) return;
this.$root.api('admin/queue/clear', {}).then(() => { this.$root.api('admin/queue/clear', {}).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -61,7 +61,7 @@ export default defineComponent({
}).then((relay: any) => { }).then((relay: any) => {
this.refresh(); this.refresh();
}).catch((e: any) => { }).catch((e: any) => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e.message || e text: e.message || e
}); });
@ -74,7 +74,7 @@ export default defineComponent({
}).then(() => { }).then(() => {
this.refresh(); this.refresh();
}).catch((e: any) => { }).catch((e: any) => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e.message || e text: e.message || e
}); });

View File

@ -402,7 +402,7 @@ export default defineComponent({
mounted() { mounted() {
this.$refs.enableHcaptcha.$on('change', () => { this.$refs.enableHcaptcha.$on('change', () => {
if (this.enableHcaptcha && this.enableRecaptcha) { if (this.enableHcaptcha && this.enableRecaptcha) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'question', // warning cancel type: 'question', // warning cancel
showCancelButton: true, showCancelButton: true,
title: this.$t('settingGuide'), title: this.$t('settingGuide'),
@ -419,7 +419,7 @@ export default defineComponent({
this.$refs.enableRecaptcha.$on('change', () => { this.$refs.enableRecaptcha.$on('change', () => {
if (this.enableRecaptcha && this.enableHcaptcha) { if (this.enableRecaptcha && this.enableHcaptcha) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'question', // warning cancel type: 'question', // warning cancel
showCancelButton: true, showCancelButton: true,
title: this.$t('settingGuide'), title: this.$t('settingGuide'),
@ -438,12 +438,12 @@ export default defineComponent({
methods: { methods: {
invite() { invite() {
this.$root.api('admin/invite').then(x => { this.$root.api('admin/invite').then(x => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'info', type: 'info',
text: x.code text: x.code
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
@ -472,12 +472,12 @@ export default defineComponent({
subject: 'Test email', subject: 'Test email',
text: 'Yo' text: 'Yo'
}).then(x => { }).then(x => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
splash: true splash: true
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
@ -546,13 +546,13 @@ export default defineComponent({
}).then(() => { }).then(() => {
this.$store.dispatch('instance/fetch'); this.$store.dispatch('instance/fetch');
if (withDialog) { if (withDialog) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
} }
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });

View File

@ -89,7 +89,7 @@ export default defineComponent({
async updateRemoteUser() { async updateRemoteUser() {
await this.$root.api('admin/update-remote-user', { userId: this.user.id }).then(res => { await this.$root.api('admin/update-remote-user', { userId: this.user.id }).then(res => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
@ -98,7 +98,7 @@ export default defineComponent({
}, },
async resetPassword() { async resetPassword() {
const dialog = this.$root.showDialog({ const dialog = this.$store.dispatch('showDialog', {
type: 'waiting', type: 'waiting',
iconOnly: true iconOnly: true
}); });
@ -106,12 +106,12 @@ export default defineComponent({
this.$root.api('admin/reset-password', { this.$root.api('admin/reset-password', {
userId: this.user.id, userId: this.user.id,
}).then(({ password }) => { }).then(({ password }) => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
text: this.$t('newPasswordIs', { password }) text: this.$t('newPasswordIs', { password })
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
@ -121,7 +121,7 @@ export default defineComponent({
}, },
async toggleSilence() { async toggleSilence() {
const confirm = await this.$root.showDialog({ const confirm = await this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
showCancelButton: true, showCancelButton: true,
text: this.silenced ? this.$t('silenceConfirm') : this.$t('unsilenceConfirm'), text: this.silenced ? this.$t('silenceConfirm') : this.$t('unsilenceConfirm'),
@ -135,7 +135,7 @@ export default defineComponent({
}, },
async toggleSuspend() { async toggleSuspend() {
const confirm = await this.$root.showDialog({ const confirm = await this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
showCancelButton: true, showCancelButton: true,
text: this.suspended ? this.$t('suspendConfirm') : this.$t('unsuspendConfirm'), text: this.suspended ? this.$t('suspendConfirm') : this.$t('unsuspendConfirm'),
@ -154,7 +154,7 @@ export default defineComponent({
}, },
async deleteAllFiles() { async deleteAllFiles() {
const confirm = await this.$root.showDialog({ const confirm = await this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
showCancelButton: true, showCancelButton: true,
text: this.$t('deleteAllFilesConfirm'), text: this.$t('deleteAllFilesConfirm'),
@ -162,13 +162,13 @@ export default defineComponent({
if (confirm.canceled) return; if (confirm.canceled) return;
const process = async () => { const process = async () => {
await this.$root.api('admin/delete-all-files-of-a-user', { userId: this.user.id }); await this.$root.api('admin/delete-all-files-of-a-user', { userId: this.user.id });
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}; };
await process().catch(e => { await process().catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e.toString() text: e.toString()
}); });

View File

@ -152,7 +152,7 @@ export default defineComponent({
let _notFound = false; let _notFound = false;
const notFound = () => { const notFound = () => {
if (_notFound) { if (_notFound) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: this.$t('noSuchUser') text: this.$t('noSuchUser')
}); });
@ -185,19 +185,19 @@ export default defineComponent({
}, },
async addUser() { async addUser() {
const { canceled: canceled1, result: username } = await this.$root.showDialog({ const { canceled: canceled1, result: username } = await this.$store.dispatch('showDialog', {
title: this.$t('username'), title: this.$t('username'),
input: true input: true
}); });
if (canceled1) return; if (canceled1) return;
const { canceled: canceled2, result: password } = await this.$root.showDialog({ const { canceled: canceled2, result: password } = await this.$store.dispatch('showDialog', {
title: this.$t('password'), title: this.$t('password'),
input: { type: 'password' } input: { type: 'password' }
}); });
if (canceled2) return; if (canceled2) return;
const dialog = this.$root.showDialog({ const dialog = this.$store.dispatch('showDialog', {
type: 'waiting', type: 'waiting',
iconOnly: true iconOnly: true
}); });
@ -207,12 +207,12 @@ export default defineComponent({
password: password, password: password,
}).then(res => { }).then(res => {
this.$refs.users.reload(); this.$refs.users.reload();
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e.id text: e.id
}); });

View File

@ -140,14 +140,14 @@ export default defineComponent({
const groups1 = await this.$root.api('users/groups/owned'); const groups1 = await this.$root.api('users/groups/owned');
const groups2 = await this.$root.api('users/groups/joined'); const groups2 = await this.$root.api('users/groups/joined');
if (groups1.length === 0 && groups2.length === 0) { if (groups1.length === 0 && groups2.length === 0) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
title: this.$t('youHaveNoGroups'), title: this.$t('youHaveNoGroups'),
text: this.$t('joinOrCreateGroup'), text: this.$t('joinOrCreateGroup'),
}); });
return; return;
} }
const { canceled, result: group } = await this.$root.showDialog({ const { canceled, result: group } = await this.$store.dispatch('showDialog', {
type: null, type: null,
title: this.$t('group'), title: this.$t('group'),
select: { select: {

View File

@ -97,7 +97,7 @@ export default defineComponent({
const ext = lio >= 0 ? file.name.slice(lio) : ''; const ext = lio >= 0 ? file.name.slice(lio) : '';
const formatted = `${formatTimeString(new Date(file.lastModified), this.$store.state.settings.pastedFileName).replace(/{{number}}/g, '1')}${ext}`; const formatted = `${formatTimeString(new Date(file.lastModified), this.$store.state.settings.pastedFileName).replace(/{{number}}/g, '1')}${ext}`;
const name = this.$store.state.settings.pasteDialog const name = this.$store.state.settings.pasteDialog
? await this.$root.showDialog({ ? await this.$store.dispatch('showDialog', {
title: this.$t('enterFileName'), title: this.$t('enterFileName'),
input: { input: {
default: formatted default: formatted
@ -109,7 +109,7 @@ export default defineComponent({
} }
} else { } else {
if (items[0].kind == 'file') { if (items[0].kind == 'file') {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: this.$t('onlyOneFileCanBeAttached') text: this.$t('onlyOneFileCanBeAttached')
}); });
@ -134,7 +134,7 @@ export default defineComponent({
return; return;
} else if (e.dataTransfer.files.length > 1) { } else if (e.dataTransfer.files.length > 1) {
e.preventDefault(); e.preventDefault();
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: this.$t('onlyOneFileCanBeAttached') text: this.$t('onlyOneFileCanBeAttached')
}); });

View File

@ -144,7 +144,7 @@ export default defineComponent({
this.form.upload(e.dataTransfer.files[0]); this.form.upload(e.dataTransfer.files[0]);
return; return;
} else if (e.dataTransfer.files.length > 1) { } else if (e.dataTransfer.files.length > 1) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: this.$t('onlyOneFileCanBeAttached') text: this.$t('onlyOneFileCanBeAttached')
}); });

View File

@ -150,14 +150,14 @@ export default defineComponent({
}); });
} }
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}, },
async deleteAntenna() { async deleteAntenna() {
const { canceled } = await this.$root.showDialog({ const { canceled } = await this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
text: this.$t('removeAreYouSure', { x: this.antenna.name }), text: this.$t('removeAreYouSure', { x: this.antenna.name }),
showCancelButton: true showCancelButton: true
@ -168,7 +168,7 @@ export default defineComponent({
antennaId: this.antenna.id, antennaId: this.antenna.id,
}); });
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -93,12 +93,12 @@ export default defineComponent({
groupId: this.group.id, groupId: this.group.id,
userId: user.id userId: user.id
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
@ -116,7 +116,7 @@ export default defineComponent({
}, },
async renameGroup() { async renameGroup() {
const { canceled, result: name } = await this.$root.showDialog({ const { canceled, result: name } = await this.$store.dispatch('showDialog', {
title: this.$t('groupName'), title: this.$t('groupName'),
input: { input: {
default: this.group.name default: this.group.name
@ -138,12 +138,12 @@ export default defineComponent({
groupId: this.group.id, groupId: this.group.id,
userId: user.id userId: user.id
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
@ -152,7 +152,7 @@ export default defineComponent({
}, },
async deleteGroup() { async deleteGroup() {
const { canceled } = await this.$root.showDialog({ const { canceled } = await this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
text: this.$t('removeAreYouSure', { x: this.group.name }), text: this.$t('removeAreYouSure', { x: this.group.name }),
showCancelButton: true showCancelButton: true
@ -162,7 +162,7 @@ export default defineComponent({
await this.$root.api('users/groups/delete', { await this.$root.api('users/groups/delete', {
groupId: this.group.id groupId: this.group.id
}); });
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -82,14 +82,14 @@ export default defineComponent({
methods: { methods: {
async create() { async create() {
const { canceled, result: name } = await this.$root.showDialog({ const { canceled, result: name } = await this.$store.dispatch('showDialog', {
title: this.$t('groupName'), title: this.$t('groupName'),
input: true input: true
}); });
if (canceled) return; if (canceled) return;
await this.$root.api('users/groups/create', { name: name }); await this.$root.api('users/groups/create', { name: name });
this.$refs.owned.reload(); this.$refs.owned.reload();
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
@ -98,7 +98,7 @@ export default defineComponent({
this.$root.api('users/groups/invitations/accept', { this.$root.api('users/groups/invitations/accept', {
invitationId: invitation.id invitationId: invitation.id
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -42,14 +42,14 @@ export default defineComponent({
methods: { methods: {
async create() { async create() {
const { canceled, result: name } = await this.$root.showDialog({ const { canceled, result: name } = await this.$store.dispatch('showDialog', {
title: this.$t('enterListName'), title: this.$t('enterListName'),
input: true input: true
}); });
if (canceled) return; if (canceled) return;
await this.$root.api('users/lists/create', { name: name }); await this.$root.api('users/lists/create', { name: name });
this.$refs.list.reload(); this.$refs.list.reload();
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -93,12 +93,12 @@ export default defineComponent({
userId: user.id userId: user.id
}).then(() => { }).then(() => {
this.users.push(user); this.users.push(user);
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
@ -116,7 +116,7 @@ export default defineComponent({
}, },
async renameList() { async renameList() {
const { canceled, result: name } = await this.$root.showDialog({ const { canceled, result: name } = await this.$store.dispatch('showDialog', {
title: this.$t('enterListName'), title: this.$t('enterListName'),
input: { input: {
default: this.list.name default: this.list.name
@ -133,7 +133,7 @@ export default defineComponent({
}, },
async deleteList() { async deleteList() {
const { canceled } = await this.$root.showDialog({ const { canceled } = await this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
text: this.$t('removeAreYouSure', { x: this.list.name }), text: this.$t('removeAreYouSure', { x: this.list.name }),
showCancelButton: true showCancelButton: true
@ -143,7 +143,7 @@ export default defineComponent({
await this.$root.api('users/lists/delete', { await this.$root.api('users/lists/delete', {
listId: this.list.id listId: this.list.id
}); });
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -89,7 +89,7 @@ export default defineComponent({
}, },
methods: { methods: {
register() { register() {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
title: this.$t('password'), title: this.$t('password'),
input: { input: {
type: 'password' type: 'password'
@ -105,7 +105,7 @@ export default defineComponent({
}, },
unregister() { unregister() {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
title: this.$t('password'), title: this.$t('password'),
input: { input: {
type: 'password' type: 'password'
@ -118,7 +118,7 @@ export default defineComponent({
this.usePasswordLessLogin = false; this.usePasswordLessLogin = false;
this.updatePasswordLessLogin(); this.updatePasswordLessLogin();
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
@ -131,13 +131,13 @@ export default defineComponent({
this.$root.api('i/2fa/done', { this.$root.api('i/2fa/done', {
token: this.token token: this.token
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
this.$store.state.i.twoFactorEnabled = true; this.$store.state.i.twoFactorEnabled = true;
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
@ -156,7 +156,7 @@ export default defineComponent({
}).then(key => { }).then(key => {
this.registration = null; this.registration = null;
key.lastUsed = new Date(); key.lastUsed = new Date();
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
@ -164,7 +164,7 @@ export default defineComponent({
}, },
unregisterKey(key) { unregisterKey(key) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
title: this.$t('password'), title: this.$t('password'),
input: { input: {
type: 'password' type: 'password'
@ -178,7 +178,7 @@ export default defineComponent({
this.usePasswordLessLogin = false; this.usePasswordLessLogin = false;
this.updatePasswordLessLogin(); this.updatePasswordLessLogin();
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
@ -187,7 +187,7 @@ export default defineComponent({
}, },
addSecurityKey() { addSecurityKey() {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
title: this.$t('password'), title: this.$t('password'),
input: { input: {
type: 'password' type: 'password'

View File

@ -33,7 +33,7 @@ export default defineComponent({
permission: permissions, permission: permissions,
}); });
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
title: this.$t('token'), title: this.$t('token'),
text: token text: token
@ -41,7 +41,7 @@ export default defineComponent({
}); });
}, },
regenerateToken() { regenerateToken() {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
title: this.$t('password'), title: this.$t('password'),
input: { input: {
type: 'password' type: 'password'

View File

@ -39,7 +39,7 @@ export default defineComponent({
chooseUploadFolder() { chooseUploadFolder() {
selectDriveFolder(this.$root, false).then(async folder => { selectDriveFolder(this.$root, false).then(async folder => {
await this.$store.dispatch('settings/set', { key: 'uploadFolder', value: folder ? folder.id : null }); await this.$store.dispatch('settings/set', { key: 'uploadFolder', value: folder ? folder.id : null });
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -45,12 +45,12 @@ export default defineComponent({
this.exportTarget == 'user-lists' ? 'i/export-user-lists' : this.exportTarget == 'user-lists' ? 'i/export-user-lists' :
null, {}) null, {})
.then(() => { .then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'info', type: 'info',
text: this.$t('exportRequested') text: this.$t('exportRequested')
}); });
}).catch((e: any) => { }).catch((e: any) => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e.message text: e.message
}); });
@ -68,7 +68,7 @@ export default defineComponent({
data.append('file', file); data.append('file', file);
data.append('i', this.$store.state.i.token); data.append('i', this.$store.state.i.token);
const dialog = this.$root.showDialog({ const dialog = this.$store.dispatch('showDialog', {
type: 'waiting', type: 'waiting',
text: this.$t('uploading') + '...', text: this.$t('uploading') + '...',
showOkButton: false, showOkButton: false,
@ -85,7 +85,7 @@ export default defineComponent({
this.reqImport(f); this.reqImport(f);
}) })
.catch(e => { .catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });
@ -102,12 +102,12 @@ export default defineComponent({
null, { null, {
fileId: file.id fileId: file.id
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'info', type: 'info',
text: this.$t('importRequested') text: this.$t('importRequested')
}); });
}).catch((e: any) => { }).catch((e: any) => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e.message text: e.message
}); });

View File

@ -122,7 +122,7 @@ export default defineComponent({
}).then(i => { }).then(i => {
this.$store.state.i.includingNotificationTypes = i.includingNotificationTypes; this.$store.state.i.includingNotificationTypes = i.includingNotificationTypes;
}).catch(err => { }).catch(err => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: err.message text: err.message
}); });

View File

@ -160,14 +160,14 @@ export default defineComponent({
this.$store.state.i.bannerUrl = i.bannerUrl; this.$store.state.i.bannerUrl = i.bannerUrl;
if (notify) { if (notify) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
} }
}).catch(err => { }).catch(err => {
this.saving = false; this.saving = false;
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: err.id text: err.id
}); });

View File

@ -25,7 +25,7 @@ export default defineComponent({
methods: { methods: {
async change() { async change() {
const { canceled: canceled1, result: currentPassword } = await this.$root.showDialog({ const { canceled: canceled1, result: currentPassword } = await this.$store.dispatch('showDialog', {
title: this.$t('currentPassword'), title: this.$t('currentPassword'),
input: { input: {
type: 'password' type: 'password'
@ -33,7 +33,7 @@ export default defineComponent({
}); });
if (canceled1) return; if (canceled1) return;
const { canceled: canceled2, result: newPassword } = await this.$root.showDialog({ const { canceled: canceled2, result: newPassword } = await this.$store.dispatch('showDialog', {
title: this.$t('newPassword'), title: this.$t('newPassword'),
input: { input: {
type: 'password' type: 'password'
@ -41,7 +41,7 @@ export default defineComponent({
}); });
if (canceled2) return; if (canceled2) return;
const { canceled: canceled3, result: newPassword2 } = await this.$root.showDialog({ const { canceled: canceled3, result: newPassword2 } = await this.$store.dispatch('showDialog', {
title: this.$t('newPasswordRetype'), title: this.$t('newPasswordRetype'),
input: { input: {
type: 'password' type: 'password'
@ -50,14 +50,14 @@ export default defineComponent({
if (canceled3) return; if (canceled3) return;
if (newPassword !== newPassword2) { if (newPassword !== newPassword2) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: this.$t('retypedNotMatch') text: this.$t('retypedNotMatch')
}); });
return; return;
} }
const dialog = this.$root.showDialog({ const dialog = this.$store.dispatch('showDialog', {
type: 'waiting', type: 'waiting',
iconOnly: true iconOnly: true
}); });
@ -66,12 +66,12 @@ export default defineComponent({
currentPassword, currentPassword,
newPassword newPassword
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}).catch(e => { }).catch(e => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });

View File

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

View File

@ -62,7 +62,7 @@ export default defineComponent({
methods: { methods: {
async rename() { async rename() {
const { canceled, result: title } = await this.$root.showDialog({ const { canceled, result: title } = await this.$store.dispatch('showDialog', {
title: 'Enter title', title: 'Enter title',
input: { input: {
type: 'text', type: 'text',
@ -75,7 +75,7 @@ export default defineComponent({
}, },
async add() { async add() {
const { canceled, result: type } = await this.$root.showDialog({ const { canceled, result: type } = await this.$store.dispatch('showDialog', {
type: null, type: null,
title: this.$t('_pages.chooseBlock'), title: this.$t('_pages.chooseBlock'),
select: { select: {

View File

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

View File

@ -239,14 +239,14 @@ export default defineComponent({
const onError = err => { const onError = err => {
if (err.id == '3d81ceae-475f-4600-b2a8-2bc116157532') { if (err.id == '3d81ceae-475f-4600-b2a8-2bc116157532') {
if (err.info.param == 'name') { if (err.info.param == 'name') {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
title: this.$t('_pages.invalidNameTitle'), title: this.$t('_pages.invalidNameTitle'),
text: this.$t('_pages.invalidNameText') text: this.$t('_pages.invalidNameText')
}); });
} }
} else if (err.code == 'NAME_ALREADY_EXISTS') { } else if (err.code == 'NAME_ALREADY_EXISTS') {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: this.$t('_pages.nameAlreadyExists') text: this.$t('_pages.nameAlreadyExists')
}); });
@ -258,7 +258,7 @@ export default defineComponent({
this.$root.api('pages/update', options) this.$root.api('pages/update', options)
.then(page => { .then(page => {
this.currentName = this.name.trim(); this.currentName = this.name.trim();
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
text: this.$t('_pages.updated') text: this.$t('_pages.updated')
}); });
@ -268,7 +268,7 @@ export default defineComponent({
.then(page => { .then(page => {
this.pageId = page.id; this.pageId = page.id;
this.currentName = this.name.trim(); this.currentName = this.name.trim();
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
text: this.$t('_pages.created') text: this.$t('_pages.created')
}); });
@ -278,7 +278,7 @@ export default defineComponent({
}, },
del() { del() {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
text: this.$t('removeAreYouSure', { x: this.title.trim() }), text: this.$t('removeAreYouSure', { x: this.title.trim() }),
showCancelButton: true showCancelButton: true
@ -287,7 +287,7 @@ export default defineComponent({
this.$root.api('pages/delete', { this.$root.api('pages/delete', {
pageId: this.pageId, pageId: this.pageId,
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
text: this.$t('_pages.deleted') text: this.$t('_pages.deleted')
}); });
@ -297,7 +297,7 @@ export default defineComponent({
}, },
async add() { async add() {
const { canceled, result: type } = await this.$root.showDialog({ const { canceled, result: type } = await this.$store.dispatch('showDialog', {
type: null, type: null,
title: this.$t('_pages.chooseBlock'), title: this.$t('_pages.chooseBlock'),
select: { select: {
@ -312,7 +312,7 @@ export default defineComponent({
}, },
async addVariable() { async addVariable() {
let { canceled, result: name } = await this.$root.showDialog({ let { canceled, result: name } = await this.$store.dispatch('showDialog', {
title: this.$t('_pages.enterVariableName'), title: this.$t('_pages.enterVariableName'),
input: { input: {
type: 'text', type: 'text',
@ -324,7 +324,7 @@ export default defineComponent({
name = name.trim(); name = name.trim();
if (this.hpml.isUsedName(name)) { if (this.hpml.isUsedName(name)) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: this.$t('_pages.variableNameIsAlreadyUsed') text: this.$t('_pages.variableNameIsAlreadyUsed')
}); });

View File

@ -105,7 +105,7 @@ export default defineComponent({
this.$root.api('i/update', { this.$root.api('i/update', {
pinnedPageId: pin ? this.page.id : null, pinnedPageId: pin ? this.page.id : null,
}).then(() => { }).then(() => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -295,7 +295,7 @@ export default defineComponent({
watch: { watch: {
lang() { lang() {
const dialog = this.$root.showDialog({ const dialog = this.$store.dispatch('showDialog', {
type: 'waiting', type: 'waiting',
iconOnly: true iconOnly: true
}); });
@ -306,7 +306,7 @@ export default defineComponent({
.then(() => location.reload()) .then(() => location.reload())
.catch(() => { .catch(() => {
dialog.close(); dialog.close();
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
iconOnly: true, iconOnly: true,
autoClose: true autoClose: true

View File

@ -85,7 +85,7 @@ export default defineComponent({
try { try {
ast = parse(this.script); ast = parse(this.script);
} catch (e) { } catch (e) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: 'Syntax error :(' text: 'Syntax error :('
}); });
@ -93,7 +93,7 @@ export default defineComponent({
} }
const meta = AiScript.collectMetadata(ast); const meta = AiScript.collectMetadata(ast);
if (meta == null) { if (meta == null) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: 'No metadata found :(' text: 'No metadata found :('
}); });
@ -101,7 +101,7 @@ export default defineComponent({
} }
const data = meta.get(null); const data = meta.get(null);
if (data == null) { if (data == null) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: 'No metadata found :(' text: 'No metadata found :('
}); });
@ -109,7 +109,7 @@ export default defineComponent({
} }
const { name, version, author, description, permissions, config } = data; const { name, version, author, description, permissions, config } = data;
if (name == null || version == null || author == null) { if (name == null || version == null || author == null) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: 'Required property not found :(' text: 'Required property not found :('
}); });
@ -142,7 +142,7 @@ export default defineComponent({
ast: serialize(ast) ast: serialize(ast)
}); });
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
@ -154,7 +154,7 @@ export default defineComponent({
uninstall() { uninstall() {
this.$store.commit('deviceUser/uninstallPlugin', this.selectedPluginId); this.$store.commit('deviceUser/uninstallPlugin', this.selectedPluginId);
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -61,7 +61,7 @@ export default defineComponent({
methods: { methods: {
async addItem() { async addItem() {
const menu = Object.keys(this.menuDef).filter(k => !this.$store.state.deviceUser.menu.includes(k)); const menu = Object.keys(this.menuDef).filter(k => !this.$store.state.deviceUser.menu.includes(k));
const { canceled, result: item } = await this.$root.showDialog({ const { canceled, result: item } = await this.$store.dispatch('showDialog', {
type: null, type: null,
title: this.$t('addItem'), title: this.$t('addItem'),
select: { select: {

View File

@ -194,7 +194,7 @@ export default defineComponent({
copyThemeCode() { copyThemeCode() {
copyToClipboard(this.selectedThemeCode); copyToClipboard(this.selectedThemeCode);
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
@ -206,21 +206,21 @@ export default defineComponent({
try { try {
theme = JSON5.parse(code); theme = JSON5.parse(code);
} catch (e) { } catch (e) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: this.$t('_theme.invalid') text: this.$t('_theme.invalid')
}); });
return false; return false;
} }
if (!validateTheme(theme)) { if (!validateTheme(theme)) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: this.$t('_theme.invalid') text: this.$t('_theme.invalid')
}); });
return false; return false;
} }
if (this.$store.state.device.themes.some(t => t.id === theme.id)) { if (this.$store.state.device.themes.some(t => t.id === theme.id)) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'info', type: 'info',
text: this.$t('_theme.alreadyInstalled') text: this.$t('_theme.alreadyInstalled')
}); });
@ -242,7 +242,7 @@ export default defineComponent({
this.$store.commit('device/set', { this.$store.commit('device/set', {
key: 'themes', value: themes key: 'themes', value: themes
}); });
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
text: this.$t('_theme.installed', { name: theme.name }) text: this.$t('_theme.installed', { name: theme.name })
}); });
@ -254,7 +254,7 @@ export default defineComponent({
this.$store.commit('device/set', { this.$store.commit('device/set', {
key: 'themes', value: themes key: 'themes', value: themes
}); });
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -141,7 +141,7 @@ export default defineComponent({
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
if (this.changed) { if (this.changed) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
text: this.$t('leaveConfirm'), text: this.$t('leaveConfirm'),
showCancelButton: true showCancelButton: true
@ -171,7 +171,7 @@ export default defineComponent({
}, },
async add() { async add() {
const { canceled, result: id } = await this.$root.showDialog({ const { canceled, result: id } = await this.$store.dispatch('showDialog', {
type: null, type: null,
title: this.$t('_rooms.addFurniture'), title: this.$t('_rooms.addFurniture'),
select: { select: {
@ -198,12 +198,12 @@ export default defineComponent({
room: room.getRoomInfo() room: room.getRoomInfo()
}).then(() => { }).then(() => {
this.changed = false; this.changed = false;
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
}).catch((e: any) => { }).catch((e: any) => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e.message text: e.message
}); });
@ -211,7 +211,7 @@ export default defineComponent({
}, },
clear() { clear() {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
text: this.$t('_rooms.clearConfirm'), text: this.$t('_rooms.clearConfirm'),
showCancelButton: true showCancelButton: true

View File

@ -77,7 +77,7 @@ export default defineComponent({
}), { }), {
in: (q) => { in: (q) => {
return new Promise(ok => { return new Promise(ok => {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
title: q, title: q,
input: {} input: {}
}).then(({ canceled, result: a }) => { }).then(({ canceled, result: a }) => {
@ -108,7 +108,7 @@ export default defineComponent({
try { try {
ast = parse(this.code); ast = parse(this.code);
} catch (e) { } catch (e) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: 'Syntax error :(' text: 'Syntax error :('
}); });
@ -117,7 +117,7 @@ export default defineComponent({
try { try {
await aiscript.exec(ast); await aiscript.exec(ast);
} catch (e) { } catch (e) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });

View File

@ -64,7 +64,7 @@ export default defineComponent({
initialText: text.trim() initialText: text.trim()
}).$once('posted', () => { }).$once('posted', () => {
this.posted = true; this.posted = true;
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });

View File

@ -155,7 +155,7 @@ export default defineComponent({
}, },
async confirm(): Promise<boolean> { async confirm(): Promise<boolean> {
const { canceled } = await this.$root.showDialog({ const { canceled } = await this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
text: this.$t('leaveConfirm'), text: this.$t('leaveConfirm'),
showCancelButton: true showCancelButton: true
@ -172,7 +172,7 @@ export default defineComponent({
}, },
async del(i: number) { async del(i: number) {
const { canceled } = await this.$root.showDialog({ const { canceled } = await this.$store.dispatch('showDialog', {
type: 'warning', type: 'warning',
showCancelButton: true, showCancelButton: true,
text: this.$t('_theme.deleteConstantConfirm', { const: this.theme[i][0] }), text: this.$t('_theme.deleteConstantConfirm', { const: this.theme[i][0] }),
@ -182,7 +182,7 @@ export default defineComponent({
}, },
async addConst() { async addConst() {
const { canceled, result } = await this.$root.showDialog({ const { canceled, result } = await this.$store.dispatch('showDialog', {
title: this.$t('_theme.inputConstantName'), title: this.$t('_theme.inputConstantName'),
input: true input: true
}); });
@ -196,7 +196,7 @@ export default defineComponent({
this.$store.commit('device/set', { this.$store.commit('device/set', {
key: 'themes', value: themes key: 'themes', value: themes
}); });
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'success', type: 'success',
text: this.$t('_theme.installed', { name: theme.name }) text: this.$t('_theme.installed', { name: theme.name })
}); });
@ -208,7 +208,7 @@ export default defineComponent({
try { try {
applyTheme(theme, false); applyTheme(theme, false);
} catch (e) { } catch (e) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e.message text: e.message
}); });
@ -229,7 +229,7 @@ export default defineComponent({
this.theme = convertToViewModel(theme); this.theme = convertToViewModel(theme);
this.themeToImport = ''; this.themeToImport = '';
} catch (e) { } catch (e) {
this.$root.showDialog({ this.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e.message text: e.message
}); });

View File

@ -9,14 +9,14 @@ export function createAiScriptEnv(vm, opts) {
USER_NAME: vm.$store.getters.isSignedIn ? values.STR(vm.$store.state.i.name) : values.NULL, USER_NAME: vm.$store.getters.isSignedIn ? values.STR(vm.$store.state.i.name) : values.NULL,
USER_USERNAME: vm.$store.getters.isSignedIn ? values.STR(vm.$store.state.i.username) : values.NULL, USER_USERNAME: vm.$store.getters.isSignedIn ? values.STR(vm.$store.state.i.username) : values.NULL,
'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => { 'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => {
await vm.$root.showDialog({ await vm.$store.dispatch('showDialog', {
type: type ? type.value : 'info', type: type ? type.value : 'info',
title: title.value, title: title.value,
text: text.value, text: text.value,
}); });
}), }),
'Mk:confirm': values.FN_NATIVE(async ([title, text, type]) => { 'Mk:confirm': values.FN_NATIVE(async ([title, text, type]) => {
const confirm = await vm.$root.showDialog({ const confirm = await vm.$store.dispatch('showDialog', {
type: type ? type.value : 'question', type: type ? type.value : 'question',
showCancelButton: true, showCancelButton: true,
title: title.value, title: title.value,

View File

@ -42,7 +42,7 @@ export class Hpml {
}), ...initLib(this)}, { }), ...initLib(this)}, {
in: (q) => { in: (q) => {
return new Promise(ok => { return new Promise(ok => {
vm.$root.showDialog({ vm.$store.dispatch('showDialog', {
title: q, title: q,
input: {} input: {}
}).then(({ canceled, result: a }) => { }).then(({ canceled, result: a }) => {

View File

@ -1,7 +1,7 @@
export default ($root: any) => { export default ($root: any) => {
if ($root.$store.getters.isSignedIn) return; if ($root.$store.getters.isSignedIn) return;
$root.showDialog({ $store.dispatch('showDialog', {
title: $root.$t('signinRequired'), title: $root.$t('signinRequired'),
text: null text: null
}); });

View File

@ -26,7 +26,7 @@ export async function search(v: any, q: string) {
} }
v.$root.$emit('warp', date); v.$root.$emit('warp', date);
v.$root.showDialog({ v.$store.dispatch('showDialog', {
icon: faHistory, icon: faHistory,
iconOnly: true, autoClose: true iconOnly: true, autoClose: true
}); });
@ -34,7 +34,7 @@ export async function search(v: any, q: string) {
} }
if (q.startsWith('https://')) { if (q.startsWith('https://')) {
const dialog = v.$root.showDialog({ const dialog = v.$store.dispatch('showDialog', {
type: 'waiting', type: 'waiting',
text: v.$t('fetchingAsApObject') + '...', text: v.$t('fetchingAsApObject') + '...',
showOkButton: false, showOkButton: false,

View File

@ -10,7 +10,7 @@ export function selectFile(component: any, src: any, label: string | null, multi
input.type = 'file'; input.type = 'file';
input.multiple = multiple; input.multiple = multiple;
input.onchange = () => { input.onchange = () => {
const dialog = component.$root.showDialog({ const dialog = component.$store.dispatch('showDialog', {
type: 'waiting', type: 'waiting',
text: component.$t('uploading') + '...', text: component.$t('uploading') + '...',
showOkButton: false, showOkButton: false,
@ -35,7 +35,7 @@ export function selectFile(component: any, src: any, label: string | null, multi
Promise.all(promises).then(driveFiles => { Promise.all(promises).then(driveFiles => {
res(multiple ? driveFiles : driveFiles[0]); res(multiple ? driveFiles : driveFiles[0]);
}).catch(e => { }).catch(e => {
component.$root.showDialog({ component.$store.dispatch('showDialog', {
type: 'error', type: 'error',
text: e text: e
}); });