mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Identities redesign
This commit is contained in:
parent
df1c369a9d
commit
44241b859c
22 changed files with 267 additions and 183 deletions
|
|
@ -7,12 +7,16 @@ function SettingsIdentities()
|
|||
{
|
||||
var oData = RL.data();
|
||||
|
||||
this.displayName = oData.displayName;
|
||||
this.signature = oData.signature;
|
||||
this.replyTo = oData.replyTo;
|
||||
|
||||
this.displayNameTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.replyTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
|
||||
this.identities = oData.identities;
|
||||
|
||||
this.legent = ko.computed(function () {
|
||||
return Utils.i18n('SETTINGS_IDENTITIES/LEGEND_IDENTITIES_FOR', {'EMAIL': oData.accountEmail()});
|
||||
}, this);
|
||||
|
||||
this.processText = ko.computed(function () {
|
||||
return oData.identitiesLoading() ? Utils.i18n('SETTINGS_IDENTITIES/LOADING_PROCESS') : '';
|
||||
}, this);
|
||||
|
|
@ -34,9 +38,6 @@ function SettingsIdentities()
|
|||
}
|
||||
}
|
||||
]});
|
||||
|
||||
this.signature = oData.signature;
|
||||
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
}
|
||||
|
||||
Utils.addSettingsViewModel(SettingsIdentities, 'SettingsIdentities', 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'identities');
|
||||
|
|
@ -52,7 +53,6 @@ SettingsIdentities.prototype.editIdentity = function (oIdentity)
|
|||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {IdentityModel} oIdentityToRemove
|
||||
*/
|
||||
SettingsIdentities.prototype.deleteIdentity = function (oIdentityToRemove)
|
||||
|
|
@ -96,11 +96,25 @@ SettingsIdentities.prototype.onBuild = function (oDom)
|
|||
|
||||
var
|
||||
oData = RL.data(),
|
||||
f1 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self)
|
||||
f1 = Utils.settingsSaveHelperSimpleFunction(self.displayNameTrigger, self),
|
||||
f2 = Utils.settingsSaveHelperSimpleFunction(self.replyTrigger, self),
|
||||
f3 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self)
|
||||
;
|
||||
|
||||
oData.signature.subscribe(function (sValue) {
|
||||
oData.displayName.subscribe(function (sValue) {
|
||||
RL.remote().saveSettings(f1, {
|
||||
'DisplayName': sValue
|
||||
});
|
||||
});
|
||||
|
||||
oData.replyTo.subscribe(function (sValue) {
|
||||
RL.remote().saveSettings(f2, {
|
||||
'ReplyTo': sValue
|
||||
});
|
||||
});
|
||||
|
||||
oData.signature.subscribe(function (sValue) {
|
||||
RL.remote().saveSettings(f3, {
|
||||
'Signature': sValue
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,29 +3,29 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsPersonal()
|
||||
function SettingsIdentity()
|
||||
{
|
||||
var oData = RL.data();
|
||||
|
||||
this.displayName = oData.displayName;
|
||||
this.replyTo = oData.replyTo;
|
||||
this.signature = oData.signature;
|
||||
this.replyTo = oData.replyTo;
|
||||
|
||||
this.nameTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.displayNameTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.replyTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
}
|
||||
|
||||
Utils.addSettingsViewModel(SettingsPersonal, 'SettingsPersonal', 'SETTINGS_LABELS/LABEL_PERSONAL_NAME', 'personal');
|
||||
Utils.addSettingsViewModel(SettingsIdentity, 'SettingsIdentity', 'SETTINGS_LABELS/LABEL_IDENTITY_NAME', 'identity');
|
||||
|
||||
SettingsPersonal.prototype.onBuild = function ()
|
||||
SettingsIdentity.prototype.onBuild = function ()
|
||||
{
|
||||
var self = this;
|
||||
_.delay(function () {
|
||||
|
||||
var
|
||||
oData = RL.data(),
|
||||
f1 = Utils.settingsSaveHelperSimpleFunction(self.nameTrigger, self),
|
||||
f1 = Utils.settingsSaveHelperSimpleFunction(self.displayNameTrigger, self),
|
||||
f2 = Utils.settingsSaveHelperSimpleFunction(self.replyTrigger, self),
|
||||
f3 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self)
|
||||
;
|
||||
Loading…
Add table
Add a link
Reference in a new issue