mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-09 06:28:28 +03:00
Code refactoring
Fixed owncloud password encoder/decoder (#291) Fixed ckeditor in ownCloud iframe (Closes #302) Release commit
This commit is contained in:
parent
7a374ebe03
commit
06274c6a7c
112 changed files with 2667 additions and 1862 deletions
|
|
@ -1,120 +0,0 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
window = require('window'),
|
||||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
key = require('key'),
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
*/
|
||||
function AbstractSystemDropDownViewModel()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Right', 'SystemDropDown');
|
||||
|
||||
this.accounts = Data.accounts;
|
||||
this.accountEmail = Data.accountEmail;
|
||||
this.accountsLoading = Data.accountsLoading;
|
||||
|
||||
this.accountMenuDropdownTrigger = ko.observable(false);
|
||||
|
||||
this.capaAdditionalAccounts = Settings.capa(Enums.Capa.AdditionalAccounts);
|
||||
|
||||
this.loading = ko.computed(function () {
|
||||
return this.accountsLoading();
|
||||
}, this);
|
||||
|
||||
this.accountClick = _.bind(this.accountClick, this);
|
||||
}
|
||||
|
||||
_.extend(AbstractSystemDropDownViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.accountClick = function (oAccount, oEvent)
|
||||
{
|
||||
if (oAccount && oEvent && !Utils.isUnd(oEvent.which) && 1 === oEvent.which)
|
||||
{
|
||||
var self = this;
|
||||
this.accountsLoading(true);
|
||||
_.delay(function () {
|
||||
self.accountsLoading(false);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.emailTitle = function ()
|
||||
{
|
||||
return Data.accountEmail();
|
||||
};
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.settingsClick = function ()
|
||||
{
|
||||
require('App:Knoin').setHash(LinkBuilder.settings());
|
||||
};
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.settingsHelp = function ()
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:KeyboardShortcutsHelp'));
|
||||
};
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.addAccountClick = function ()
|
||||
{
|
||||
if (this.capaAdditionalAccounts)
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:AddAccount'));
|
||||
}
|
||||
};
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.logoutClick = function ()
|
||||
{
|
||||
Remote.logout(function () {
|
||||
if (window.__rlah_clear)
|
||||
{
|
||||
window.__rlah_clear();
|
||||
}
|
||||
|
||||
require('App:RainLoop').loginAndLogoutReload(true,
|
||||
Settings.settingsGet('ParentEmail') && 0 < Settings.settingsGet('ParentEmail').length);
|
||||
});
|
||||
};
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.onBuild = function ()
|
||||
{
|
||||
var self = this;
|
||||
key('`', [Enums.KeyState.MessageList, Enums.KeyState.MessageView, Enums.KeyState.Settings], function () {
|
||||
if (self.viewModelVisibility())
|
||||
{
|
||||
self.accountMenuDropdownTrigger(true);
|
||||
}
|
||||
});
|
||||
|
||||
// shortcuts help
|
||||
key('shift+/', [Enums.KeyState.MessageList, Enums.KeyState.MessageView, Enums.KeyState.Settings], function () {
|
||||
if (self.viewModelVisibility())
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:KeyboardShortcutsHelp'));
|
||||
return false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = AbstractSystemDropDownViewModel;
|
||||
|
||||
}());
|
||||
Loading…
Add table
Add a link
Reference in a new issue