wip
This commit is contained in:
parent
3d4fccef45
commit
abf1c30ce6
9 changed files with 108 additions and 18 deletions
18
src/web/app/mobile/api/choose-drive-file.ts
Normal file
18
src/web/app/mobile/api/choose-drive-file.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
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);
|
||||
});
|
||||
}
|
||||
17
src/web/app/mobile/api/choose-drive-folder.ts
Normal file
17
src/web/app/mobile/api/choose-drive-folder.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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);
|
||||
});
|
||||
}
|
||||
5
src/web/app/mobile/api/dialog.ts
Normal file
5
src/web/app/mobile/api/dialog.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export default function(opts) {
|
||||
return new Promise<string>((res, rej) => {
|
||||
alert('dialog not implemented yet');
|
||||
});
|
||||
}
|
||||
5
src/web/app/mobile/api/input.ts
Normal file
5
src/web/app/mobile/api/input.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export default function(opts) {
|
||||
return new Promise<string>((res, rej) => {
|
||||
alert('input not implemented yet');
|
||||
});
|
||||
}
|
||||
14
src/web/app/mobile/api/post.ts
Normal file
14
src/web/app/mobile/api/post.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
export default opts => {
|
||||
const app = document.getElementById('app');
|
||||
app.style.display = 'none';
|
||||
|
||||
function recover() {
|
||||
app.style.display = 'block';
|
||||
}
|
||||
|
||||
const form = riot.mount(document.body.appendChild(document.createElement('mk-post-form')), opts)[0];
|
||||
form
|
||||
.on('cancel', recover)
|
||||
.on('post', recover);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue