mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Added individual signatures for every identity.
This commit is contained in:
parent
996703311b
commit
1119022916
45 changed files with 1353 additions and 337 deletions
|
|
@ -9,6 +9,7 @@
|
|||
ko = require('ko'),
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
Translator = require('Common/Translator'),
|
||||
Links = require('Common/Links'),
|
||||
|
||||
|
|
@ -34,33 +35,8 @@
|
|||
return '' === this.processText() ? 'hidden' : 'visible';
|
||||
}, this);
|
||||
|
||||
this.accountForDeletion = ko.observable(null).extend({'falseTimeout': 3000}).extend({'toggleSubscribe': [this,
|
||||
function (oPrev) {
|
||||
if (oPrev)
|
||||
{
|
||||
oPrev.deleteAccess(false);
|
||||
}
|
||||
}, function (oNext) {
|
||||
if (oNext)
|
||||
{
|
||||
oNext.deleteAccess(true);
|
||||
}
|
||||
}
|
||||
]});
|
||||
|
||||
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.accountForDeletion = ko.observable(null).deleteAccessHelper();
|
||||
this.identityForDeletion = ko.observable(null).deleteAccessHelper();
|
||||
}
|
||||
|
||||
AccountsUserSettings.prototype.scrollableOptions = function ()
|
||||
|
|
@ -158,6 +134,12 @@
|
|||
}
|
||||
};
|
||||
|
||||
AccountsUserSettings.prototype.accountsAndIdentitiesAfterMove = function ()
|
||||
{
|
||||
Remote.accountsAndIdentitiesSortOrder(null,
|
||||
AccountStore.accountsEmails.peek(), IdentityStore.identitiesIDS.peek());
|
||||
};
|
||||
|
||||
AccountsUserSettings.prototype.onBuild = function (oDom)
|
||||
{
|
||||
var self = this;
|
||||
|
|
|
|||
105
dev/Settings/User/Templates.js
Normal file
105
dev/Settings/User/Templates.js
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko'),
|
||||
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
TemplateStore = require('Stores/User/Template'),
|
||||
|
||||
Remote = require('Storage/User/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function TemplatesUserSettings()
|
||||
{
|
||||
this.templates = TemplateStore.templates;
|
||||
|
||||
this.processText = ko.computed(function () {
|
||||
return TemplateStore.templates.loading() ? Translator.i18n('SETTINGS_TEMPLETS/LOADING_PROCESS') : '';
|
||||
}, this);
|
||||
|
||||
this.visibility = ko.computed(function () {
|
||||
return '' === this.processText() ? 'hidden' : 'visible';
|
||||
}, this);
|
||||
|
||||
this.templateForDeletion = ko.observable(null).deleteAccessHelper();
|
||||
}
|
||||
|
||||
TemplatesUserSettings.prototype.scrollableOptions = function ()
|
||||
{
|
||||
return {
|
||||
handle: '.drag-handle'
|
||||
};
|
||||
};
|
||||
|
||||
TemplatesUserSettings.prototype.addNewTemplate = function ()
|
||||
{
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Template'));
|
||||
};
|
||||
|
||||
TemplatesUserSettings.prototype.editTemplate = function (oTemplateItem)
|
||||
{
|
||||
if (oTemplateItem)
|
||||
{
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Template'), [oTemplateItem]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {AccountModel} oTemplateToRemove
|
||||
*/
|
||||
TemplatesUserSettings.prototype.deleteTemplate = function (oTemplateToRemove)
|
||||
{
|
||||
if (oTemplateToRemove && oTemplateToRemove.deleteAccess())
|
||||
{
|
||||
this.templateForDeletion(null);
|
||||
|
||||
var
|
||||
self = this,
|
||||
fRemoveAccount = function (oAccount) {
|
||||
return oTemplateToRemove === oAccount;
|
||||
}
|
||||
;
|
||||
|
||||
if (oTemplateToRemove)
|
||||
{
|
||||
this.templates.remove(fRemoveAccount);
|
||||
|
||||
Remote.templateDelete(function () {
|
||||
self.reloadTemplates();
|
||||
}, oTemplateToRemove.id);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
TemplatesUserSettings.prototype.reloadTemplates = function ()
|
||||
{
|
||||
require('App/User').templates();
|
||||
};
|
||||
|
||||
TemplatesUserSettings.prototype.onBuild = function (oDom)
|
||||
{
|
||||
var self = this;
|
||||
|
||||
oDom
|
||||
.on('click', '.templates-list .template-item .e-action', function () {
|
||||
var oTemplateItem = ko.dataFor(this);
|
||||
if (oTemplateItem)
|
||||
{
|
||||
self.editTemplate(oTemplateItem);
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
this.reloadTemplates();
|
||||
};
|
||||
|
||||
module.exports = TemplatesUserSettings;
|
||||
|
||||
}());
|
||||
Loading…
Add table
Add a link
Reference in a new issue