mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Added auto logout option
This commit is contained in:
parent
76f319a07f
commit
bb551e4ec8
18 changed files with 171 additions and 33 deletions
|
|
@ -24,6 +24,11 @@
|
|||
this.accounts = ko.observableArray([]);
|
||||
this.accounts.loading = ko.observable(false).extend({'throttle': 100});
|
||||
|
||||
this.computers();
|
||||
}
|
||||
|
||||
AccountUserStore.prototype.computers = function ()
|
||||
{
|
||||
this.accountsEmails = ko.computed(function () {
|
||||
return _.compact(_.map(this.accounts(), function (oItem) {
|
||||
return oItem ? oItem.email : null;
|
||||
|
|
@ -44,7 +49,7 @@
|
|||
return iResult;
|
||||
|
||||
}, this);
|
||||
}
|
||||
};
|
||||
|
||||
AccountUserStore.prototype.populate = function ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@
|
|||
this.trashFolder = ko.observable('');
|
||||
this.archiveFolder = ko.observable('');
|
||||
|
||||
this.computed();
|
||||
this.subscribe();
|
||||
this.computers();
|
||||
this.subscribers();
|
||||
}
|
||||
|
||||
FolderUserStore.prototype.computed = function ()
|
||||
FolderUserStore.prototype.computers = function ()
|
||||
{
|
||||
this.draftFolderNotEnabled = ko.computed(function () {
|
||||
return '' === this.draftFolder() || Consts.Values.UnuseOptionValue === this.draftFolder();
|
||||
}, this);
|
||||
};
|
||||
|
||||
FolderUserStore.prototype.subscribe = function ()
|
||||
FolderUserStore.prototype.subscribers = function ()
|
||||
{
|
||||
var
|
||||
fRemoveSystemFolderType = function (observable) {
|
||||
|
|
|
|||
|
|
@ -126,12 +126,12 @@
|
|||
};
|
||||
}
|
||||
|
||||
this.computedProperies();
|
||||
this.computers();
|
||||
|
||||
this.initNotificationPlayer();
|
||||
}
|
||||
|
||||
NotificationUserStore.prototype.computedProperies = function ()
|
||||
NotificationUserStore.prototype.computers = function ()
|
||||
{
|
||||
this.isDesktopNotificationSupported = ko.computed(function () {
|
||||
return Enums.DesktopNotification.NotSupported !== this.desktopNotificationPermissions();
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
'use strict';
|
||||
|
||||
var
|
||||
window = require('window'),
|
||||
ko = require('ko'),
|
||||
|
||||
Consts = require('Common/Consts'),
|
||||
|
|
@ -20,6 +21,8 @@
|
|||
*/
|
||||
function SettingsUserStore()
|
||||
{
|
||||
this.iAutoLogoutTimer = 0;
|
||||
|
||||
this.layout = ko.observable(Enums.Layout.SidePreview)
|
||||
.extend({'limitedList': [
|
||||
Enums.Layout.SidePreview, Enums.Layout.BottomPreview, Enums.Layout.NoPreview
|
||||
|
|
@ -39,24 +42,27 @@
|
|||
this.useThreads = ko.observable(false);
|
||||
this.replySameFolder = ko.observable(false);
|
||||
|
||||
this.computedProperies();
|
||||
this.subscribes();
|
||||
this.autoLogout = ko.observable(30);
|
||||
|
||||
this.computers();
|
||||
this.subscribers();
|
||||
}
|
||||
|
||||
SettingsUserStore.prototype.computedProperies = function ()
|
||||
SettingsUserStore.prototype.computers = function ()
|
||||
{
|
||||
this.usePreviewPane = ko.computed(function () {
|
||||
return Enums.Layout.NoPreview !== this.layout();
|
||||
}, this);
|
||||
};
|
||||
|
||||
SettingsUserStore.prototype.subscribes = function ()
|
||||
SettingsUserStore.prototype.subscribers = function ()
|
||||
{
|
||||
this.layout.subscribe(function (nValue) {
|
||||
|
||||
Globals.$html.toggleClass('rl-no-preview-pane', Enums.Layout.NoPreview === nValue);
|
||||
Globals.$html.toggleClass('rl-side-preview-pane', Enums.Layout.SidePreview === nValue);
|
||||
Globals.$html.toggleClass('rl-bottom-preview-pane', Enums.Layout.BottomPreview === nValue);
|
||||
Globals.$html.toggleClass('rl-mobile-layout', Enums.Layout.Mobile === nValue);
|
||||
|
||||
Events.pub('layout', [nValue]);
|
||||
});
|
||||
|
|
@ -67,12 +73,27 @@
|
|||
this.layout(Utils.pInt(Settings.settingsGet('Layout')));
|
||||
this.editorDefaultType(Settings.settingsGet('EditorDefaultType'));
|
||||
|
||||
this.autoLogout(Utils.pInt(Settings.settingsGet('AutoLogout')));
|
||||
this.messagesPerPage(Settings.settingsGet('MPP'));
|
||||
|
||||
this.showImages(!!Settings.settingsGet('ShowImages'));
|
||||
this.useCheckboxesInList(!!Settings.settingsGet('UseCheckboxesInList'));
|
||||
this.useThreads(!!Settings.settingsGet('UseThreads'));
|
||||
this.replySameFolder(!!Settings.settingsGet('ReplySameFolder'));
|
||||
|
||||
var self = this;
|
||||
|
||||
Events.sub('rl.auto-logout-refresh', function () {
|
||||
window.clearTimeout(self.iAutoLogoutTimer);
|
||||
if (0 < self.autoLogout())
|
||||
{
|
||||
self.iAutoLogoutTimer = window.setTimeout(function () {
|
||||
Events.pub('rl.auto-logout');
|
||||
}, self.autoLogout() * 1000 * 60);
|
||||
}
|
||||
});
|
||||
|
||||
Events.pub('rl.auto-logout-refresh');
|
||||
};
|
||||
|
||||
module.exports = new SettingsUserStore();
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@
|
|||
this.templatesNames = ko.observableArray([]).extend({'throttle': 1000});
|
||||
this.templatesNames.skipFirst = true;
|
||||
|
||||
this.subscribers();
|
||||
}
|
||||
|
||||
TemplateUserStore.prototype.subscribers = function ()
|
||||
{
|
||||
this.templates.subscribe(function (aList) {
|
||||
this.templatesNames(_.compact(_.map(aList, function (oItem) {
|
||||
return oItem ? oItem.name : null;
|
||||
|
|
@ -37,7 +42,7 @@
|
|||
// Remote.templatesSortOrder(null, aList);
|
||||
// }
|
||||
// }, this);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = new TemplateUserStore();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue