mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Resolve Nextcloud save issue and added mockup code for files browser
https://github.com/the-djmaze/snappymail/issues/96#issuecomment-1282589485
This commit is contained in:
parent
640f75da8d
commit
a41afb17ad
4 changed files with 61 additions and 3 deletions
|
|
@ -87,9 +87,53 @@
|
|||
});
|
||||
}
|
||||
|
||||
class NextcloudFilesPopupView extends rl.pluginPopupView {
|
||||
constructor() {
|
||||
super('NextcloudFiles');
|
||||
this.addObservables({
|
||||
folder: '',
|
||||
files: false
|
||||
});
|
||||
}
|
||||
|
||||
onShow(files, fResolve) {
|
||||
this.files(!!files);
|
||||
this.fResolve = fResolve;
|
||||
}
|
||||
|
||||
select() {
|
||||
this.close();
|
||||
this.fResolve(this.folder());
|
||||
}
|
||||
|
||||
onClose() {
|
||||
this.close();
|
||||
this.fResolve();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
rl.ncFiles = new class {
|
||||
async getDirectoryContents(path) {
|
||||
return await fetchFiles(propertyRequestBody, path);
|
||||
}
|
||||
|
||||
selectFolder() {
|
||||
return new Promise(resolve => {
|
||||
NextcloudFilesPopupView.showModal([
|
||||
false,
|
||||
folder => resolve(folder),
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
selectFiles() {
|
||||
return new Promise(resolve => {
|
||||
NextcloudFilesPopupView.showModal([
|
||||
true,
|
||||
files => resolve(files),
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
})(window.rl);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue