diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2020-07-11 10:13:11 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-11 10:13:11 +0900 |
| commit | cf3fc97202588e835ade5d6ab1a3c087e46958ad (patch) | |
| tree | b3fe472b455bf913a47df4d41b1363c7122bf1d9 /src/client/init.ts | |
| parent | タイムライン上でTwitterウィジットを展開できるようにな... (diff) | |
| download | misskey-cf3fc97202588e835ade5d6ab1a3c087e46958ad.tar.gz misskey-cf3fc97202588e835ade5d6ab1a3c087e46958ad.tar.bz2 misskey-cf3fc97202588e835ade5d6ab1a3c087e46958ad.zip | |
Deck (#6504)
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
Diffstat (limited to 'src/client/init.ts')
| -rw-r--r-- | src/client/init.ts | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/client/init.ts b/src/client/init.ts index 21f233cc91..d00b4f5cca 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -1,5 +1,5 @@ /** - * App entry point + * Client entry point */ import Vue from 'vue'; @@ -12,11 +12,13 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; import VueHotkey from './scripts/hotkey'; import App from './app.vue'; +import Deck from './deck.vue'; import MiOS from './mios'; -import { version, langs, instanceName, getLocale } from './config'; +import { version, langs, instanceName, getLocale, deckmode } from './config'; import PostFormDialog from './components/post-form-dialog.vue'; import Dialog from './components/dialog.vue'; import Menu from './components/menu.vue'; +import Form from './components/form-window.vue'; import { router } from './router'; import { applyTheme, lightTheme } from './scripts/theme'; import { isDeviceDarkmode } from './scripts/is-device-darkmode'; @@ -165,6 +167,7 @@ os.init(async () => { i18n // TODO: 消せないか考える SEE: https://github.com/syuilo/misskey/pull/6396#discussion_r429511030 }; }, + // TODO: ここらへんのメソッド全部Vuexに移したい methods: { api: (endpoint: string, data: { [x: string]: any } = {}, token?) => store.dispatch('api', { endpoint, data, token }), signout: os.signout, @@ -194,6 +197,13 @@ os.init(async () => { }); return p; }, + form(title, form) { + const vm = this.new(Form, { title, form }); + return new Promise((res) => { + vm.$once('ok', result => res({ canceled: false, result })); + vm.$once('cancel', () => res({ canceled: true })); + }); + }, post(opts, cb) { if (!this.$store.getters.isSignedIn) return; const vm = this.new(PostFormDialog, opts); @@ -210,11 +220,9 @@ os.init(async () => { } }, router: router, - render: createEl => createEl(App) + render: createEl => createEl(deckmode ? Deck : App) }); - os.app = app; - // マウント app.$mount('#app'); |