summaryrefslogtreecommitdiff
path: root/src/web/app/desktop/api/input.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/desktop/api/input.ts
parentwip (diff)
downloadsharkey-99b34993640eb91a591faa4bccf7d7b6f176ad97.tar.gz
sharkey-99b34993640eb91a591faa4bccf7d7b6f176ad97.tar.bz2
sharkey-99b34993640eb91a591faa4bccf7d7b6f176ad97.zip
wip
Diffstat (limited to 'src/web/app/desktop/api/input.ts')
-rw-r--r--src/web/app/desktop/api/input.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/web/app/desktop/api/input.ts b/src/web/app/desktop/api/input.ts
new file mode 100644
index 0000000000..a5ab07138a
--- /dev/null
+++ b/src/web/app/desktop/api/input.ts
@@ -0,0 +1,19 @@
+import InputDialog from '../views/components/input-dialog.vue';
+
+export default function(opts) {
+ return new Promise<string>((res, rej) => {
+ const o = opts || {};
+ const d = new InputDialog({
+ propsData: {
+ title: o.title,
+ placeholder: o.placeholder,
+ default: o.default,
+ type: o.type || 'text'
+ }
+ }).$mount();
+ d.$once('done', text => {
+ res(text);
+ });
+ document.body.appendChild(d.$el);
+ });
+}