mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 22:17:03 +03:00
Move to plugin #385
This commit is contained in:
parent
86ac71ea2e
commit
9789a2509f
13 changed files with 197 additions and 67 deletions
54
plugins/kolab/js/settings.js
Normal file
54
plugins/kolab/js/settings.js
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
(rl => {
|
||||
|
||||
const getFolders = type => {
|
||||
const
|
||||
aResult = [{
|
||||
id: '',
|
||||
name: '',
|
||||
}],
|
||||
foldersWalk = folders => {
|
||||
folders.forEach(oItem => {
|
||||
if (type === oItem.kolabType()) {
|
||||
aResult.push({
|
||||
id: oItem.fullName,
|
||||
name: oItem.fullName
|
||||
});
|
||||
}
|
||||
if (oItem.subFolders.length) {
|
||||
foldersWalk(oItem.subFolders());
|
||||
}
|
||||
});
|
||||
};
|
||||
foldersWalk(rl.app.folderList());
|
||||
return aResult;
|
||||
};
|
||||
|
||||
|
||||
class KolabSettings /* extends AbstractViewSettings */
|
||||
{
|
||||
constructor() {
|
||||
this.contactFolder = ko.observable(rl.settings.get('KolabContactFolder'));
|
||||
// rl.app.FolderUserStore.hasCapability('METADATA');
|
||||
this.contactFolder.subscribe(value => {
|
||||
rl.pluginRemoteRequest(()=>{}, 'KolabFolder', {
|
||||
contact: value
|
||||
});
|
||||
});
|
||||
this.contactFoldersList = ko.computed(() => getFolders('contact'), {'pure':true});
|
||||
// this.eventFoldersList = ko.computed(() => getFolders('event'), {'pure':true});
|
||||
// this.taskFoldersList = ko.computed(() => getFolders('task'), {'pure':true});
|
||||
// this.noteFoldersList = ko.computed(() => getFolders('note'), {'pure':true});
|
||||
// this.fileFoldersList = ko.computed(() => getFolders('file'), {'pure':true});
|
||||
// this.journalFoldersList = ko.computed(() => getFolders('journal'), {'pure':true});
|
||||
// this.configFoldersList = ko.computed(() => getFolders('configuration'), {'pure':true});
|
||||
}
|
||||
}
|
||||
|
||||
rl.addSettingsViewModel(
|
||||
KolabSettings,
|
||||
'KolabSettings',
|
||||
'Kolab',
|
||||
'kolab'
|
||||
);
|
||||
|
||||
})(window.rl);
|
||||
Loading…
Add table
Add a link
Reference in a new issue