mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
More fixes for scrutinizer-ci
This commit is contained in:
parent
c7e97b78d6
commit
59b32241bf
16 changed files with 116 additions and 191 deletions
|
|
@ -118,13 +118,10 @@ FolderListMailBoxUserView.prototype.onBuild = function(oDom)
|
|||
oDom
|
||||
.on('click', '.b-folders .e-item .e-link .e-collapsed-sign', function(oEvent) {
|
||||
|
||||
var
|
||||
oFolder = ko.dataFor(this),
|
||||
bCollapsed = false;
|
||||
|
||||
var oFolder = ko.dataFor(this);
|
||||
if (oFolder && oEvent)
|
||||
{
|
||||
bCollapsed = oFolder.collapsed();
|
||||
var bCollapsed = oFolder.collapsed();
|
||||
require('App/User').default.setExpandedFolder(oFolder.fullNameHash, bCollapsed);
|
||||
|
||||
oFolder.collapsed(!bCollapsed);
|
||||
|
|
@ -142,13 +139,12 @@ FolderListMailBoxUserView.prototype.onBuild = function(oDom)
|
|||
key('up, down', Enums.KeyState.FolderList, function(event, handler) {
|
||||
|
||||
var
|
||||
iIndex = -1,
|
||||
iKeyCode = handler && 'up' === handler.shortcut ? Enums.EventKeyCode.Up : Enums.EventKeyCode.Down,
|
||||
$items = $('.b-folders .e-item .e-link:not(.hidden):visible', oDom);
|
||||
|
||||
if (event && $items.length)
|
||||
{
|
||||
iIndex = $items.index($items.filter('.focused'));
|
||||
var iIndex = $items.index($items.filter('.focused'));
|
||||
if (-1 < iIndex)
|
||||
{
|
||||
$items.eq(iIndex).removeClass('focused');
|
||||
|
|
@ -182,17 +178,13 @@ FolderListMailBoxUserView.prototype.onBuild = function(oDom)
|
|||
});
|
||||
|
||||
key('space', Enums.KeyState.FolderList, function() {
|
||||
var
|
||||
bCollapsed = true,
|
||||
oFolder = null,
|
||||
$items = $('.b-folders .e-item .e-link:not(.hidden).focused', oDom);
|
||||
|
||||
var $items = $('.b-folders .e-item .e-link:not(.hidden).focused', oDom);
|
||||
if ($items.length && $items[0])
|
||||
{
|
||||
oFolder = ko.dataFor($items[0]);
|
||||
var oFolder = ko.dataFor($items[0]);
|
||||
if (oFolder)
|
||||
{
|
||||
bCollapsed = oFolder.collapsed();
|
||||
var bCollapsed = oFolder.collapsed();
|
||||
require('App/User').default.setExpandedFolder(oFolder.fullNameHash, bCollapsed);
|
||||
oFolder.collapsed(!bCollapsed);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -538,14 +538,9 @@ MessageListMailBoxUserView.prototype.setAction = function(sFolderFullNameRaw, mU
|
|||
*/
|
||||
MessageListMailBoxUserView.prototype.setActionForAll = function(sFolderFullNameRaw, iSetAction)
|
||||
{
|
||||
var
|
||||
oFolder = null,
|
||||
aMessages = MessageStore.messageList();
|
||||
|
||||
if ('' !== sFolderFullNameRaw)
|
||||
{
|
||||
oFolder = Cache.getFolderFromCacheList(sFolderFullNameRaw);
|
||||
|
||||
var oFolder = Cache.getFolderFromCacheList(sFolderFullNameRaw);
|
||||
if (oFolder)
|
||||
{
|
||||
switch (iSetAction)
|
||||
|
|
@ -554,7 +549,7 @@ MessageListMailBoxUserView.prototype.setActionForAll = function(sFolderFullNameR
|
|||
oFolder = Cache.getFolderFromCacheList(sFolderFullNameRaw);
|
||||
if (oFolder)
|
||||
{
|
||||
_.each(aMessages, function(oMessage) {
|
||||
_.each(MessageStore.messageList(), function(oMessage) {
|
||||
oMessage.unseen(false);
|
||||
});
|
||||
|
||||
|
|
@ -568,7 +563,7 @@ MessageListMailBoxUserView.prototype.setActionForAll = function(sFolderFullNameR
|
|||
oFolder = Cache.getFolderFromCacheList(sFolderFullNameRaw);
|
||||
if (oFolder)
|
||||
{
|
||||
_.each(aMessages, function(oMessage) {
|
||||
_.each(MessageStore.messageList(), function(oMessage) {
|
||||
oMessage.unseen(true);
|
||||
});
|
||||
|
||||
|
|
@ -644,18 +639,15 @@ MessageListMailBoxUserView.prototype.flagMessages = function(oCurrentMessage)
|
|||
|
||||
MessageListMailBoxUserView.prototype.flagMessagesFast = function(bFlag)
|
||||
{
|
||||
var
|
||||
aChecked = this.messageListCheckedOrSelected(),
|
||||
aFlagged = [];
|
||||
|
||||
var aChecked = this.messageListCheckedOrSelected();
|
||||
if (0 < aChecked.length)
|
||||
{
|
||||
aFlagged = _.filter(aChecked, function(oMessage) {
|
||||
return oMessage.flagged();
|
||||
});
|
||||
|
||||
if (Utils.isUnd(bFlag))
|
||||
{
|
||||
var aFlagged = _.filter(aChecked, function(oMessage) {
|
||||
return oMessage.flagged();
|
||||
});
|
||||
|
||||
this.setAction(aChecked[0].folderFullNameRaw, true,
|
||||
aChecked.length === aFlagged.length ? Enums.MessageSetAction.UnsetFlag : Enums.MessageSetAction.SetFlag, aChecked);
|
||||
}
|
||||
|
|
@ -669,18 +661,15 @@ MessageListMailBoxUserView.prototype.flagMessagesFast = function(bFlag)
|
|||
|
||||
MessageListMailBoxUserView.prototype.seenMessagesFast = function(bSeen)
|
||||
{
|
||||
var
|
||||
aChecked = this.messageListCheckedOrSelected(),
|
||||
aUnseen = [];
|
||||
|
||||
var aChecked = this.messageListCheckedOrSelected();
|
||||
if (0 < aChecked.length)
|
||||
{
|
||||
aUnseen = _.filter(aChecked, function(oMessage) {
|
||||
return oMessage.unseen();
|
||||
});
|
||||
|
||||
if (Utils.isUnd(bSeen))
|
||||
{
|
||||
var aUnseen = _.filter(aChecked, function(oMessage) {
|
||||
return oMessage.unseen();
|
||||
});
|
||||
|
||||
this.setAction(aChecked[0].folderFullNameRaw, true,
|
||||
0 < aUnseen.length ? Enums.MessageSetAction.SetSeen : Enums.MessageSetAction.UnsetSeen, aChecked);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,25 +302,15 @@ function MessageViewMailBoxUserView()
|
|||
}, this);
|
||||
|
||||
this.viewFromDkimStatusIconClass = ko.computed(function() {
|
||||
|
||||
var sResult = 'icon-none iconcolor-display-none';
|
||||
// var sResult = 'icon-warning-alt iconcolor-grey';
|
||||
switch (this.viewFromDkimData()[0])
|
||||
{
|
||||
case 'none':
|
||||
break;
|
||||
return 'icon-none iconcolor-display-none';
|
||||
case 'pass':
|
||||
sResult = 'icon-ok iconcolor-green';
|
||||
// sResult = 'icon-warning-alt iconcolor-green';
|
||||
break;
|
||||
return 'icon-ok iconcolor-green';
|
||||
default:
|
||||
sResult = 'icon-warning-alt iconcolor-red';
|
||||
break;
|
||||
// no default
|
||||
return 'icon-warning-alt iconcolor-red';
|
||||
}
|
||||
|
||||
return sResult;
|
||||
|
||||
}, this);
|
||||
|
||||
this.viewFromDkimStatusTitle = ko.computed(function() {
|
||||
|
|
@ -465,7 +455,6 @@ MessageViewMailBoxUserView.prototype.detectDomBackgroundColor = function(oDom)
|
|||
var
|
||||
iLimit = 5,
|
||||
sResult = '',
|
||||
aC = null,
|
||||
fFindDom = function(oInputDom) {
|
||||
var children = oInputDom ? oInputDom.children() : null;
|
||||
return (children && 1 === children.length && children.is('table,div,center')) ? children : null;
|
||||
|
|
@ -486,7 +475,7 @@ MessageViewMailBoxUserView.prototype.detectDomBackgroundColor = function(oDom)
|
|||
|
||||
if (oDom && 1 === oDom.length)
|
||||
{
|
||||
aC = oDom;
|
||||
var aC = oDom;
|
||||
while ('' === sResult)
|
||||
{
|
||||
iLimit -= 1;
|
||||
|
|
@ -643,8 +632,7 @@ MessageViewMailBoxUserView.prototype.onBuild = function(oDom)
|
|||
{
|
||||
var
|
||||
self = this,
|
||||
oScript = null,
|
||||
// sErrorMessage = Translator.i18n('PREVIEW_POPUP/IMAGE_ERROR'),
|
||||
// sErrorMessage = Translator.i18n('PREVIEW_POPUP/IMAGE_ERROR'),
|
||||
fCheckHeaderHeight = _.bind(this.checkHeaderHeight, this);
|
||||
|
||||
this.oDom = oDom;
|
||||
|
|
@ -675,7 +663,7 @@ MessageViewMailBoxUserView.prototype.onBuild = function(oDom)
|
|||
|
||||
if (this.dropboxEnabled() && this.dropboxApiKey() && !window.Dropbox)
|
||||
{
|
||||
oScript = window.document.createElement('script');
|
||||
var oScript = window.document.createElement('script');
|
||||
oScript.type = 'text/javascript';
|
||||
oScript.src = 'https://www.dropbox.com/static/api/2/dropins.js';
|
||||
$(oScript).attr('id', 'dropboxjs').attr('data-app-key', self.dropboxApiKey());
|
||||
|
|
|
|||
|
|
@ -47,14 +47,12 @@ MenuSettingsUserView.prototype.onBuild = function(oDom)
|
|||
key('up, down', Enums.KeyState.Settings, _.throttle(function(event, handler) {
|
||||
|
||||
var
|
||||
sH = '',
|
||||
iIndex = -1,
|
||||
bUp = handler && 'up' === handler.shortcut,
|
||||
$items = $('.b-settings-menu .e-item', oDom);
|
||||
|
||||
if (event && $items.length)
|
||||
{
|
||||
iIndex = $items.index($items.filter('.selected'));
|
||||
var iIndex = $items.index($items.filter('.selected'));
|
||||
if (bUp && 0 < iIndex)
|
||||
{
|
||||
iIndex -= 1;
|
||||
|
|
@ -64,7 +62,7 @@ MenuSettingsUserView.prototype.onBuild = function(oDom)
|
|||
iIndex += 1;
|
||||
}
|
||||
|
||||
sH = $items.eq(iIndex).attr('href');
|
||||
var sH = $items.eq(iIndex).attr('href');
|
||||
if (sH)
|
||||
{
|
||||
kn.setHash(sH, false, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue