mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-09 06:28:28 +03:00
Merge all example plugins
This commit is contained in:
parent
f588c91570
commit
eb61563db4
23 changed files with 230 additions and 425 deletions
68
plugins/example/js/ExampleUserSettings.js
Normal file
68
plugins/example/js/ExampleUserSettings.js
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
|
||||
(rl => { if (rl) {
|
||||
|
||||
class ExampleUserSettings
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
this.userSkype = ko.observable('');
|
||||
this.userFacebook = ko.observable('');
|
||||
|
||||
this.loading = ko.observable(false);
|
||||
this.saving = ko.observable(false);
|
||||
|
||||
this.savingOrLoading = ko.computed(() => {
|
||||
return this.loading() || this.saving();
|
||||
});
|
||||
}
|
||||
|
||||
exampleJsonSaveData()
|
||||
{
|
||||
if (!this.saving()) {
|
||||
this.saving(true);
|
||||
|
||||
rl.pluginRemoteRequest((iError, oData) => {
|
||||
|
||||
this.saving(false);
|
||||
|
||||
if (iError) {
|
||||
console.error({
|
||||
iError: iError,
|
||||
oData: oData
|
||||
});
|
||||
} else {
|
||||
console.dir({
|
||||
iError: iError,
|
||||
oData: oData
|
||||
});
|
||||
}
|
||||
|
||||
}, 'JsonSaveExampleUserData', {
|
||||
'UserSkype': this.userSkype(),
|
||||
'UserFacebook': this.userFacebook()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onBuild()
|
||||
{
|
||||
this.loading(true);
|
||||
|
||||
rl.pluginRemoteRequest((iError, oData) => {
|
||||
|
||||
this.loading(false);
|
||||
|
||||
if (!iError) {
|
||||
self.userSkype(oData.Result.UserSkype || '');
|
||||
self.userFacebook(oData.Result.UserFacebook || '');
|
||||
}
|
||||
|
||||
}, 'JsonGetExampleUserData');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
rl.addSettingsViewModel(ExampleUserSettings, 'ExampleUserSettingsTab',
|
||||
'SETTINGS_EXAMPLE_PLUGIN/TAB_NAME', 'Example');
|
||||
|
||||
}})(window.rl);
|
||||
Loading…
Add table
Add a link
Reference in a new issue