summaryrefslogtreecommitdiff
path: root/src/web/app/init.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-02-18 12:35:18 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-02-18 12:35:18 +0900
commit99b34993640eb91a591faa4bccf7d7b6f176ad97 (patch)
treef45bd1e385dc9a78f5322e233767cbb44e3fa2cf /src/web/app/init.ts
parentwip (diff)
downloadmisskey-99b34993640eb91a591faa4bccf7d7b6f176ad97.tar.gz
misskey-99b34993640eb91a591faa4bccf7d7b6f176ad97.tar.bz2
misskey-99b34993640eb91a591faa4bccf7d7b6f176ad97.zip
wip
Diffstat (limited to 'src/web/app/init.ts')
-rw-r--r--src/web/app/init.ts49
1 files changed, 31 insertions, 18 deletions
diff --git a/src/web/app/init.ts b/src/web/app/init.ts
index 450327a588..8abb7f7aa5 100644
--- a/src/web/app/init.ts
+++ b/src/web/app/init.ts
@@ -78,37 +78,50 @@ if (localStorage.getItem('should-refresh') == 'true') {
type API = {
chooseDriveFile: (opts: {
- title: string;
- currentFolder: any;
- multiple: boolean;
+ title?: string;
+ currentFolder?: any;
+ multiple?: boolean;
}) => Promise<any>;
chooseDriveFolder: (opts: {
- title: string;
- currentFolder: any;
+ title?: string;
+ currentFolder?: any;
}) => Promise<any>;
+
+ dialog: (opts: {
+ title: string;
+ text: string;
+ actions: Array<{
+ text: string;
+ id: string;
+ }>;
+ }) => Promise<string>;
+
+ input: (opts: {
+ title: string;
+ placeholder?: string;
+ default?: string;
+ }) => Promise<string>;
};
// MiOSを初期化してコールバックする
export default (callback: (launch: (api: API) => Vue) => void, sw = false) => {
- const mios = new MiOS(sw);
+ const os = new MiOS(sw);
- Vue.mixin({
- data: {
- $os: mios
- }
- });
-
- mios.init(() => {
+ os.init(() => {
// アプリ基底要素マウント
document.body.innerHTML = '<div id="app"></div>';
const launch = (api: API) => {
+ Vue.mixin({
+ created() {
+ (this as any).os = os;
+ (this as any).api = os.api;
+ (this as any).apis = api;
+ }
+ });
+
return new Vue({
- data: {
- os: mios,
- api: api
- },
router: new VueRouter({
mode: 'history'
}),
@@ -124,7 +137,7 @@ export default (callback: (launch: (api: API) => Vue) => void, sw = false) => {
// 更新チェック
setTimeout(() => {
- checkForUpdate(mios);
+ checkForUpdate(os);
}, 3000);
});
};