wip
This commit is contained in:
@@ -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_USERNAME: vm.$store.getters.isSignedIn ? values.STR(vm.$store.state.i.username) : values.NULL,
|
||||
'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => {
|
||||
await vm.$root.showDialog({
|
||||
await vm.$store.dispatch('showDialog', {
|
||||
type: type ? type.value : 'info',
|
||||
title: title.value,
|
||||
text: text.value,
|
||||
});
|
||||
}),
|
||||
'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',
|
||||
showCancelButton: true,
|
||||
title: title.value,
|
||||
|
@@ -42,7 +42,7 @@ export class Hpml {
|
||||
}), ...initLib(this)}, {
|
||||
in: (q) => {
|
||||
return new Promise(ok => {
|
||||
vm.$root.showDialog({
|
||||
vm.$store.dispatch('showDialog', {
|
||||
title: q,
|
||||
input: {}
|
||||
}).then(({ canceled, result: a }) => {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
export default ($root: any) => {
|
||||
if ($root.$store.getters.isSignedIn) return;
|
||||
|
||||
$root.showDialog({
|
||||
$store.dispatch('showDialog', {
|
||||
title: $root.$t('signinRequired'),
|
||||
text: null
|
||||
});
|
||||
|
@@ -26,7 +26,7 @@ export async function search(v: any, q: string) {
|
||||
}
|
||||
|
||||
v.$root.$emit('warp', date);
|
||||
v.$root.showDialog({
|
||||
v.$store.dispatch('showDialog', {
|
||||
icon: faHistory,
|
||||
iconOnly: true, autoClose: true
|
||||
});
|
||||
@@ -34,7 +34,7 @@ export async function search(v: any, q: string) {
|
||||
}
|
||||
|
||||
if (q.startsWith('https://')) {
|
||||
const dialog = v.$root.showDialog({
|
||||
const dialog = v.$store.dispatch('showDialog', {
|
||||
type: 'waiting',
|
||||
text: v.$t('fetchingAsApObject') + '...',
|
||||
showOkButton: false,
|
||||
|
@@ -10,7 +10,7 @@ export function selectFile(component: any, src: any, label: string | null, multi
|
||||
input.type = 'file';
|
||||
input.multiple = multiple;
|
||||
input.onchange = () => {
|
||||
const dialog = component.$root.showDialog({
|
||||
const dialog = component.$store.dispatch('showDialog', {
|
||||
type: 'waiting',
|
||||
text: component.$t('uploading') + '...',
|
||||
showOkButton: false,
|
||||
@@ -35,7 +35,7 @@ export function selectFile(component: any, src: any, label: string | null, multi
|
||||
Promise.all(promises).then(driveFiles => {
|
||||
res(multiple ? driveFiles : driveFiles[0]);
|
||||
}).catch(e => {
|
||||
component.$root.showDialog({
|
||||
component.$store.dispatch('showDialog', {
|
||||
type: 'error',
|
||||
text: e
|
||||
});
|
||||
|
Reference in New Issue
Block a user