mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Uploading and preparing the repository to the dev version.
Original unminified source code (dev folder - js, css, less) (fixes #6) Grunt build system Multiple identities correction (fixes #9) Compose html editor (fixes #12) New general settings - Loading Description New warning about default admin password Split general and login screen settings
This commit is contained in:
parent
afad45137e
commit
4cc2207513
846 changed files with 99453 additions and 2123 deletions
109
dev/Settings/Identities.js
Normal file
109
dev/Settings/Identities.js
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsIdentities()
|
||||
{
|
||||
var oData = RL.data();
|
||||
|
||||
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);
|
||||
|
||||
this.visibility = ko.computed(function () {
|
||||
return '' === this.processText() ? 'hidden' : 'visible';
|
||||
}, this);
|
||||
|
||||
this.identityForDeletion = ko.observable(null).extend({'falseTimeout': 3000}).extend({'toggleSubscribe': [this,
|
||||
function (oPrev) {
|
||||
if (oPrev)
|
||||
{
|
||||
oPrev.deleteAccess(false);
|
||||
}
|
||||
}, function (oNext) {
|
||||
if (oNext)
|
||||
{
|
||||
oNext.deleteAccess(true);
|
||||
}
|
||||
}
|
||||
]});
|
||||
|
||||
this.signature = oData.signature;
|
||||
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
}
|
||||
|
||||
Utils.addSettingsViewModel(SettingsIdentities, 'SettingsIdentities', 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'identities');
|
||||
|
||||
SettingsIdentities.prototype.addNewIdentity = function ()
|
||||
{
|
||||
kn.showScreenPopup(PopupsIdentityViewModel);
|
||||
};
|
||||
|
||||
SettingsIdentities.prototype.editIdentity = function (oIdentity)
|
||||
{
|
||||
kn.showScreenPopup(PopupsIdentityViewModel, [oIdentity]);
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {IdentityModel} oIdentityToRemove
|
||||
*/
|
||||
SettingsIdentities.prototype.deleteIdentity = function (oIdentityToRemove)
|
||||
{
|
||||
if (oIdentityToRemove && oIdentityToRemove.deleteAccess())
|
||||
{
|
||||
this.identityForDeletion(null);
|
||||
|
||||
var
|
||||
fRemoveFolder = function (oIdentity) {
|
||||
return oIdentityToRemove === oIdentity;
|
||||
}
|
||||
;
|
||||
|
||||
if (oIdentityToRemove)
|
||||
{
|
||||
this.identities.remove(fRemoveFolder);
|
||||
|
||||
RL.remote().identityDelete(function () {
|
||||
RL.accountsAndIdentities();
|
||||
}, oIdentityToRemove.id);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
SettingsIdentities.prototype.onBuild = function (oDom)
|
||||
{
|
||||
var self = this;
|
||||
|
||||
oDom
|
||||
.on('click', '.identity-item .e-action', function () {
|
||||
var oIdentityItem = ko.dataFor(this);
|
||||
if (oIdentityItem)
|
||||
{
|
||||
self.editIdentity(oIdentityItem);
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
_.delay(function () {
|
||||
|
||||
var
|
||||
oData = RL.data(),
|
||||
f1 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self)
|
||||
;
|
||||
|
||||
oData.signature.subscribe(function (sValue) {
|
||||
RL.remote().saveSettings(f1, {
|
||||
'Signature': sValue
|
||||
});
|
||||
});
|
||||
|
||||
}, 50);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue