+
@@ -15,21 +15,27 @@ export default Vue.extend({
type: Boolean,
required: false,
default: false
+ },
+ noGrow: {
+ type: Boolean,
+ required: false,
+ default: false
}
}
});
diff --git a/src/client/app/desktop/api/update-avatar.ts b/src/client/app/desktop/api/update-avatar.ts
index ae8b723ea6..e0215aa34f 100644
--- a/src/client/app/desktop/api/update-avatar.ts
+++ b/src/client/app/desktop/api/update-avatar.ts
@@ -8,12 +8,9 @@ export default ($root: any) => {
const regex = RegExp('\.(jpg|jpeg|png|gif|webp|bmp|tiff)$');
if (!regex.test(file.name) ) {
- $root.$dialog({
+ $root.alert({
title: '%fa:info-circle% %i18n:desktop.invalid-filetype%',
- text: null,
- actions: [{
- text: '%i18n:common.got-it%'
- }]
+ text: null
});
return reject('invalid-filetype');
}
@@ -90,12 +87,9 @@ export default ($root: any) => {
value: i.avatarUrl
});
- $root.$dialog({
+ $root.alert({
title: '%fa:info-circle% %i18n:desktop.avatar-updated%',
- text: null,
- actions: [{
- text: '%i18n:common.got-it%'
- }]
+ text: null
});
return i;
diff --git a/src/client/app/desktop/api/update-banner.ts b/src/client/app/desktop/api/update-banner.ts
index c338d4e95c..36582684ec 100644
--- a/src/client/app/desktop/api/update-banner.ts
+++ b/src/client/app/desktop/api/update-banner.ts
@@ -10,10 +10,7 @@ export default ($root: any) => {
if (!regex.test(file.name) ) {
$root.dialog({
title: '%fa:info-circle% %i18n:desktop.invalid-filetype%',
- text: null,
- actions: [{
- text: '%i18n:common.got-it%'
- }]
+ text: null
});
return reject('invalid-filetype');
}
@@ -90,12 +87,9 @@ export default ($root: any) => {
value: i.bannerUrl
});
- $root.$dialog({
+ $root.alert({
title: '%fa:info-circle% %i18n:desktop.banner-updated%',
- text: null,
- actions: [{
- text: '%i18n:common.got-it%'
- }]
+ text: null
});
return i;
diff --git a/src/client/app/desktop/script.ts b/src/client/app/desktop/script.ts
index f2d27fa16e..cb23613164 100644
--- a/src/client/app/desktop/script.ts
+++ b/src/client/app/desktop/script.ts
@@ -34,7 +34,6 @@ import PostFormWindow from './views/components/post-form-window.vue';
import RenoteFormWindow from './views/components/renote-form-window.vue';
import MkChooseFileFromDriveWindow from './views/components/choose-file-from-drive-window.vue';
import MkChooseFolderFromDriveWindow from './views/components/choose-folder-from-drive-window.vue';
-import Dialog from './views/components/dialog.vue';
import InputDialog from './views/components/input-dialog.vue';
import Notification from './views/components/ui-notification.vue';
@@ -114,21 +113,6 @@ init(async (launch) => {
});
},
- $dialog(opts) {
- return new Promise
((res, rej) => {
- const o = opts || {};
- const d = this.$root.new(Dialog, {
- title: o.title,
- text: o.text,
- modal: o.modal,
- buttons: o.actions
- });
- d.$once('clicked', id => {
- res(id);
- });
- });
- },
-
$input(opts) {
return new Promise((res, rej) => {
const o = opts || {};
diff --git a/src/client/app/desktop/views/components/dialog.vue b/src/client/app/desktop/views/components/dialog.vue
deleted file mode 100644
index 2664105bdc..0000000000
--- a/src/client/app/desktop/views/components/dialog.vue
+++ /dev/null
@@ -1,168 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/client/app/desktop/views/components/drive.file.vue b/src/client/app/desktop/views/components/drive.file.vue
index 7840d7e748..a643064078 100644
--- a/src/client/app/desktop/views/components/drive.file.vue
+++ b/src/client/app/desktop/views/components/drive.file.vue
@@ -170,12 +170,9 @@ export default Vue.extend({
copyUrl() {
copyToClipboard(this.file.url);
- this.$dialog({
+ this.$root.alert({
title: this.$t('contextmenu.copied'),
- text: this.$t('contextmenu.copied-url-to-clipboard'),
- actions: [{
- text: this.$t('@.ok')
- }]
+ text: this.$t('contextmenu.copied-url-to-clipboard')
});
},
diff --git a/src/client/app/desktop/views/components/drive.folder.vue b/src/client/app/desktop/views/components/drive.folder.vue
index fe9bad2c28..5558f65c3e 100644
--- a/src/client/app/desktop/views/components/drive.folder.vue
+++ b/src/client/app/desktop/views/components/drive.folder.vue
@@ -155,12 +155,9 @@ export default Vue.extend({
}).catch(err => {
switch (err) {
case 'detected-circular-definition':
- this.$dialog({
+ this.$root.alert({
title: this.$t('unable-to-process'),
- text: this.$t('circular-reference-detected'),
- actions: [{
- text: this.$t('@.ok')
- }]
+ text: this.$t('circular-reference-detected')
});
break;
default:
diff --git a/src/client/app/desktop/views/components/drive.vue b/src/client/app/desktop/views/components/drive.vue
index 08dbfd2fa9..c4e9e102d5 100644
--- a/src/client/app/desktop/views/components/drive.vue
+++ b/src/client/app/desktop/views/components/drive.vue
@@ -313,12 +313,9 @@ export default Vue.extend({
}).catch(err => {
switch (err) {
case 'detected-circular-definition':
- this.$dialog({
+ this.$root.alert({
title: this.$t('unable-to-process'),
- text: this.$t('circular-reference-detected'),
- actions: [{
- text: this.$t('@.ok')
- }]
+ text: this.$t('circular-reference-detected')
});
break;
default:
@@ -343,12 +340,9 @@ export default Vue.extend({
folderId: this.folder ? this.folder.id : undefined
});
- this.$dialog({
+ this.$root.alert({
title: this.$t('url-upload-requested'),
- text: this.$t('may-take-time'),
- actions: [{
- text: this.$t('@.ok')
- }]
+ text: this.$t('may-take-time')
});
});
},
diff --git a/src/client/app/desktop/views/components/home.vue b/src/client/app/desktop/views/components/home.vue
index 500773ee9f..492edc67d6 100644
--- a/src/client/app/desktop/views/components/home.vue
+++ b/src/client/app/desktop/views/components/home.vue
@@ -186,12 +186,9 @@ export default Vue.extend({
methods: {
hint() {
- this.$dialog({
+ this.$root.alert({
title: this.$t('@.customization-tips.title'),
- text: this.$t('@.customization-tips.paragraph'),
- actions: [{
- text: this.$t('@.customization-tips.gotit')
- }]
+ text: this.$t('@.customization-tips.paragraph')
});
},
diff --git a/src/client/app/desktop/views/components/settings.vue b/src/client/app/desktop/views/components/settings.vue
index d652c2def1..99e8064cea 100644
--- a/src/client/app/desktop/views/components/settings.vue
+++ b/src/client/app/desktop/views/components/settings.vue
@@ -549,12 +549,12 @@ export default Vue.extend({
this.checkingForUpdate = false;
this.latestVersion = newer;
if (newer == null) {
- this.$dialog({
+ this.$root.alert({
title: this.$t('no-updates'),
text: this.$t('no-updates-desc')
});
} else {
- this.$dialog({
+ this.$root.alert({
title: this.$t('update-available'),
text: this.$t('update-available-desc')
});
@@ -563,7 +563,7 @@ export default Vue.extend({
},
clean() {
localStorage.clear();
- this.$dialog({
+ this.$root.alert({
title: this.$t('cache-cleared'),
text: this.$t('cache-cleared-desc')
});
diff --git a/src/client/app/desktop/views/pages/deck/deck.user-column.vue b/src/client/app/desktop/views/pages/deck/deck.user-column.vue
index 27da5427b9..8336828c0c 100644
--- a/src/client/app/desktop/views/pages/deck/deck.user-column.vue
+++ b/src/client/app/desktop/views/pages/deck/deck.user-column.vue
@@ -87,7 +87,6 @@ import XNotes from './deck.notes.vue';
import XNote from '../../components/note.vue';
import Menu from '../../../../common/views/components/menu.vue';
import MkUserListsWindow from '../../components/user-lists-window.vue';
-import Ok from '../../../../common/views/components/ok.vue';
import { concat } from '../../../../../../prelude/array';
import * as ApexCharts from 'apexcharts';
@@ -308,7 +307,8 @@ export default Vue.extend({
listId: list.id,
userId: this.user.id
});
- this.$root.new(Ok);
+ // TODO
+ //this.$root.new(Ok);
});
}
}];
diff --git a/src/client/app/desktop/views/pages/user/user.profile.vue b/src/client/app/desktop/views/pages/user/user.profile.vue
index e369d724e8..63bb60bcb3 100644
--- a/src/client/app/desktop/views/pages/user/user.profile.vue
+++ b/src/client/app/desktop/views/pages/user/user.profile.vue
@@ -101,7 +101,7 @@ export default Vue.extend({
listId: list.id,
userId: this.user.id
});
- this.$dialog({
+ this.$root.alert({
title: 'Done!',
text: this.$t('list-pushed').replace('{user}', this.user.name).replace('{list}', list.title)
});
diff --git a/src/client/app/init.ts b/src/client/app/init.ts
index d1ac060564..60f4ab31fe 100644
--- a/src/client/app/init.ts
+++ b/src/client/app/init.ts
@@ -7,7 +7,6 @@ import Vuex from 'vuex';
import VueRouter from 'vue-router';
import VAnimateCss from 'v-animate-css';
import VModal from 'vue-js-modal';
-import VueSweetalert2 from 'vue-sweetalert2';
import VueI18n from 'vue-i18n';
import VueHotkey from './common/hotkey';
@@ -16,6 +15,7 @@ import checkForUpdate from './common/scripts/check-for-update';
import MiOS from './mios';
import { clientVersion as version, codename, lang } from './config';
import { builtinThemes, lightTheme, applyTheme } from './theme';
+import Alert from './common/views/components/alert.vue';
if (localStorage.getItem('theme') == null) {
applyTheme(lightTheme);
@@ -258,7 +258,6 @@ Vue.use(VueRouter);
Vue.use(VAnimateCss);
Vue.use(VModal);
Vue.use(VueHotkey);
-Vue.use(VueSweetalert2);
Vue.use(VueI18n);
Vue.component('fa', FontAwesomeIcon);
@@ -430,6 +429,13 @@ export default (callback: (launch: (router: VueRouter) => [Vue, MiOS]) => void,
document.body.appendChild(x.$el);
return x;
},
+ alert(opts) {
+ return new Promise((res) => {
+ const vm = this.new(Alert, opts);
+ vm.$once('ok', () => res(true));
+ vm.$once('cancel', () => res(false));
+ });
+ }
},
router,
render: createEl => createEl(App)
diff --git a/src/client/app/mobile/script.ts b/src/client/app/mobile/script.ts
index 5622e233df..116ffce1dc 100644
--- a/src/client/app/mobile/script.ts
+++ b/src/client/app/mobile/script.ts
@@ -35,7 +35,6 @@ import MkFollow from '../common/views/pages/follow.vue';
import PostForm from './views/components/post-form-dialog.vue';
import FileChooser from './views/components/drive-file-chooser.vue';
import FolderChooser from './views/components/drive-folder-chooser.vue';
-import Dialog from './views/components/dialog.vue';
/**
* init
@@ -99,21 +98,6 @@ init((launch) => {
});
},
- $dialog(opts) {
- return new Promise((res, rej) => {
- const o = opts || {};
- const d = this.$root.new(Dialog, {
- title: o.title,
- text: o.text,
- modal: o.modal,
- buttons: o.actions
- });
- d.$once('clicked', id => {
- res(id);
- });
- });
- },
-
$notify(message) {
alert(message);
}
diff --git a/src/client/app/mobile/views/components/dialog.vue b/src/client/app/mobile/views/components/dialog.vue
deleted file mode 100644
index ca9ccd8246..0000000000
--- a/src/client/app/mobile/views/components/dialog.vue
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/client/app/mobile/views/pages/settings.vue b/src/client/app/mobile/views/pages/settings.vue
index 2bd64b6270..fceaebc66d 100644
--- a/src/client/app/mobile/views/pages/settings.vue
+++ b/src/client/app/mobile/views/pages/settings.vue
@@ -360,12 +360,12 @@ export default Vue.extend({
this.checkingForUpdate = false;
this.latestVersion = newer;
if (newer == null) {
- this.$dialog({
+ this.$root.alert({
title: this.$t('no-updates'),
text: this.$t('no-updates-desc')
});
} else {
- this.$dialog({
+ this.$root.alert({
title: this.$t('update-available'),
text: this.$t('update-available-desc')
});