From 3f79c9ae4927d4186c708e130ecbb1ea4f72d9fa Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 9 Nov 2018 16:00:29 +0900 Subject: Refactor client (#3178) * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip --- src/client/app/mobile/api/choose-drive-file.ts | 18 ------------------ src/client/app/mobile/api/choose-drive-folder.ts | 17 ----------------- src/client/app/mobile/api/dialog.ts | 18 ------------------ src/client/app/mobile/api/input.ts | 8 -------- src/client/app/mobile/api/notify.ts | 3 --- src/client/app/mobile/api/post.ts | 24 ------------------------ 6 files changed, 88 deletions(-) delete mode 100644 src/client/app/mobile/api/choose-drive-file.ts delete mode 100644 src/client/app/mobile/api/choose-drive-folder.ts delete mode 100644 src/client/app/mobile/api/dialog.ts delete mode 100644 src/client/app/mobile/api/input.ts delete mode 100644 src/client/app/mobile/api/notify.ts delete mode 100644 src/client/app/mobile/api/post.ts (limited to 'src/client/app/mobile/api') diff --git a/src/client/app/mobile/api/choose-drive-file.ts b/src/client/app/mobile/api/choose-drive-file.ts deleted file mode 100644 index b1a78f2364..0000000000 --- a/src/client/app/mobile/api/choose-drive-file.ts +++ /dev/null @@ -1,18 +0,0 @@ -import Chooser from '../views/components/drive-file-chooser.vue'; - -export default function(opts) { - return new Promise((res, rej) => { - const o = opts || {}; - const w = new Chooser({ - propsData: { - title: o.title, - multiple: o.multiple, - initFolder: o.currentFolder - } - }).$mount(); - w.$once('selected', file => { - res(file); - }); - document.body.appendChild(w.$el); - }); -} diff --git a/src/client/app/mobile/api/choose-drive-folder.ts b/src/client/app/mobile/api/choose-drive-folder.ts deleted file mode 100644 index d1f97d1487..0000000000 --- a/src/client/app/mobile/api/choose-drive-folder.ts +++ /dev/null @@ -1,17 +0,0 @@ -import Chooser from '../views/components/drive-folder-chooser.vue'; - -export default function(opts) { - return new Promise((res, rej) => { - const o = opts || {}; - const w = new Chooser({ - propsData: { - title: o.title, - initFolder: o.currentFolder - } - }).$mount(); - w.$once('selected', folder => { - res(folder); - }); - document.body.appendChild(w.$el); - }); -} diff --git a/src/client/app/mobile/api/dialog.ts b/src/client/app/mobile/api/dialog.ts deleted file mode 100644 index 23f35b7aa9..0000000000 --- a/src/client/app/mobile/api/dialog.ts +++ /dev/null @@ -1,18 +0,0 @@ -import OS from '../../mios'; -import Dialog from '../views/components/dialog.vue'; - -export default (os: OS) => opts => { - return new Promise((res, rej) => { - const o = opts || {}; - const d = os.new(Dialog, { - title: o.title, - text: o.text, - modal: o.modal, - buttons: o.actions - }); - d.$once('clicked', id => { - res(id); - }); - document.body.appendChild(d.$el); - }); -}; diff --git a/src/client/app/mobile/api/input.ts b/src/client/app/mobile/api/input.ts deleted file mode 100644 index 38d0fb61eb..0000000000 --- a/src/client/app/mobile/api/input.ts +++ /dev/null @@ -1,8 +0,0 @@ -export default function(opts) { - return new Promise((res, rej) => { - const x = window.prompt(opts.title); - if (x) { - res(x); - } - }); -} diff --git a/src/client/app/mobile/api/notify.ts b/src/client/app/mobile/api/notify.ts deleted file mode 100644 index 82780d196f..0000000000 --- a/src/client/app/mobile/api/notify.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default function(message) { - alert(message); -} diff --git a/src/client/app/mobile/api/post.ts b/src/client/app/mobile/api/post.ts deleted file mode 100644 index a64ed1c43e..0000000000 --- a/src/client/app/mobile/api/post.ts +++ /dev/null @@ -1,24 +0,0 @@ -import PostForm from '../views/components/post-form-dialog.vue'; - -export default (os) => (opts) => { - const o = opts || {}; - - document.documentElement.style.overflow = 'hidden'; - - function recover() { - document.documentElement.style.overflow = 'auto'; - } - - const vm = new PostForm({ - parent: os.app, - propsData: { - reply: o.reply, - renote: o.renote - } - }).$mount(); - vm.$once('cancel', recover); - vm.$once('posted', recover); - if (o.cb) vm.$once('closed', o.cb); - document.body.appendChild(vm.$el); - (vm as any).focus(); -}; -- cgit v1.2.3-freya