Small fixes

This commit is contained in:
RainLoop Team 2016-08-09 20:27:04 +03:00
parent 2e96eeb5db
commit 51b9e400d2
3 changed files with 18 additions and 33 deletions

View file

@ -3,7 +3,6 @@ filter:
- 'rainloop-webmail/rainloop/v/0.0.0/app/libraries/MailSo/*' - 'rainloop-webmail/rainloop/v/0.0.0/app/libraries/MailSo/*'
- 'rainloop-webmail/rainloop/v/0.0.0/app/libraries/RainLoop/*' - 'rainloop-webmail/rainloop/v/0.0.0/app/libraries/RainLoop/*'
- 'dev/*' - 'dev/*'
- 'plugins/*'
excluded_paths: excluded_paths:
- '*.min.js' - '*.min.js'
- '*/min/*' - '*/min/*'

View file

@ -261,7 +261,6 @@ PgpUserStore.prototype.findKeyExternal = function(sEmail, fCallback)
PgpUserStore.prototype.verifyMessage = function(oMessage, fCallback) PgpUserStore.prototype.verifyMessage = function(oMessage, fCallback)
{ {
var var
oValid = null,
aResult = [], aResult = [],
aPublicKeys = [], aPublicKeys = [],
aSigningKeyIds = []; aSigningKeyIds = [];
@ -281,7 +280,7 @@ PgpUserStore.prototype.verifyMessage = function(oMessage, fCallback)
try try
{ {
aResult = oMessage.verify(aPublicKeys); aResult = oMessage.verify(aPublicKeys);
oValid = _.find(_.isArray(aResult) ? aResult : [], function(oItem) { var oValid = _.find(_.isArray(aResult) ? aResult : [], function(oItem) {
return oItem && oItem.valid && oItem.keyid; return oItem && oItem.valid && oItem.keyid;
}); });

View file

@ -355,8 +355,7 @@ function ComposePopupView()
sTo = Utils.trim(this.to()), sTo = Utils.trim(this.to()),
sCc = Utils.trim(this.cc()), sCc = Utils.trim(this.cc()),
sBcc = Utils.trim(this.bcc()), sBcc = Utils.trim(this.bcc()),
sSentFolder = FolderStore.sentFolder(), sSentFolder = FolderStore.sentFolder();
aFlagsCache = [];
this.attachmentsInProcessError(false); this.attachmentsInProcessError(false);
this.attachmentsInErrorError(false); this.attachmentsInErrorError(false);
@ -404,7 +403,7 @@ function ComposePopupView()
if (Utils.isArray(this.aDraftInfo) && 3 === this.aDraftInfo.length) if (Utils.isArray(this.aDraftInfo) && 3 === this.aDraftInfo.length)
{ {
aFlagsCache = Cache.getMessageFlagsFromCache(this.aDraftInfo[2], this.aDraftInfo[1]); var aFlagsCache = Cache.getMessageFlagsFromCache(this.aDraftInfo[2], this.aDraftInfo[1]);
if (aFlagsCache) if (aFlagsCache)
{ {
if ('forward' === this.aDraftInfo[0]) if ('forward' === this.aDraftInfo[0])
@ -767,9 +766,7 @@ ComposePopupView.prototype.sendMessageResponse = function(sResult, oData)
ComposePopupView.prototype.saveMessageResponse = function(sResult, oData) ComposePopupView.prototype.saveMessageResponse = function(sResult, oData)
{ {
var var bResult = false;
bResult = false,
oMessage = null;
this.saving(false); this.saving(false);
@ -781,7 +778,7 @@ ComposePopupView.prototype.saveMessageResponse = function(sResult, oData)
if (this.bFromDraft) if (this.bFromDraft)
{ {
oMessage = MessageStore.message(); var oMessage = MessageStore.message();
if (oMessage && this.draftFolder() === oMessage.folderFullNameRaw && this.draftUid() === oMessage.uid) if (oMessage && this.draftFolder() === oMessage.folderFullNameRaw && this.draftUid() === oMessage.uid)
{ {
MessageStore.message(null); MessageStore.message(null);
@ -854,7 +851,6 @@ ComposePopupView.prototype.converSignature = function(sSignature)
{ {
var var
iLimit = 10, iLimit = 10,
oMatch = null,
aMoments = [], aMoments = [],
oMomentRegx = /{{MOMENT:([^}]+)}}/g, oMomentRegx = /{{MOMENT:([^}]+)}}/g,
sFrom = ''; sFrom = '';
@ -893,6 +889,7 @@ ComposePopupView.prototype.converSignature = function(sSignature)
{ {
try try
{ {
var oMatch = null;
while (null !== (oMatch = oMomentRegx.exec(sSignature))) // eslint-disable-line no-cond-assign while (null !== (oMatch = oMomentRegx.exec(sSignature))) // eslint-disable-line no-cond-assign
{ {
if (oMatch && oMatch[0] && oMatch[1]) if (oMatch && oMatch[0] && oMatch[1])
@ -1057,14 +1054,11 @@ ComposePopupView.prototype.initOnShow = function(sType, oMessageOrArray,
sCc = '', sCc = '',
sDate = '', sDate = '',
sSubject = '', sSubject = '',
oText = null,
sText = '', sText = '',
sReplyTitle = '', sReplyTitle = '',
aResplyAllParts = [],
oExcludeEmail = {}, oExcludeEmail = {},
oIdentity = null, oIdentity = null,
mEmail = AccountStore.email(), mEmail = AccountStore.email(),
aDownloads = [],
aDraftInfo = null, aDraftInfo = null,
oMessage = null, oMessage = null,
sComposeType = sType || Enums.ComposeType.Empty; sComposeType = sType || Enums.ComposeType.Empty;
@ -1112,7 +1106,7 @@ ComposePopupView.prototype.initOnShow = function(sType, oMessageOrArray,
sSubject = oMessage.subject(); sSubject = oMessage.subject();
aDraftInfo = oMessage.aDraftInfo; aDraftInfo = oMessage.aDraftInfo;
oText = $(oMessage.body).clone(); var oText = $(oMessage.body).clone();
if (oText) if (oText)
{ {
Utils.clearBqSwitcher(oText); Utils.clearBqSwitcher(oText);
@ -1135,7 +1129,7 @@ ComposePopupView.prototype.initOnShow = function(sType, oMessageOrArray,
break; break;
case Enums.ComposeType.ReplyAll: case Enums.ComposeType.ReplyAll:
aResplyAllParts = oMessage.replyAllEmails(oExcludeEmail); var aResplyAllParts = oMessage.replyAllEmails(oExcludeEmail);
this.to(this.emailArrayToStringLineHelper(aResplyAllParts[0])); this.to(this.emailArrayToStringLineHelper(aResplyAllParts[0]));
this.cc(this.emailArrayToStringLineHelper(aResplyAllParts[1])); this.cc(this.emailArrayToStringLineHelper(aResplyAllParts[1]));
this.subject(Utils.replySubjectAdd('Re', sSubject)); this.subject(Utils.replySubjectAdd('Re', sSubject));
@ -1302,10 +1296,10 @@ ComposePopupView.prototype.initOnShow = function(sType, oMessageOrArray,
this.setFocusInPopup(); this.setFocusInPopup();
} }
aDownloads = this.getAttachmentsDownloadsForUpload(); var downloads = this.getAttachmentsDownloadsForUpload();
if (Utils.isNonEmptyArray(aDownloads)) if (Utils.isNonEmptyArray(downloads))
{ {
Remote.messageUploadAttachments(this.onMessageUploadAttachments, aDownloads); Remote.messageUploadAttachments(this.onMessageUploadAttachments, downloads);
} }
if (oIdentity) if (oIdentity)
@ -1320,24 +1314,17 @@ ComposePopupView.prototype.onMessageUploadAttachments = function(sResult, oData)
{ {
if (Enums.StorageResultType.Success === sResult && oData && oData.Result) if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{ {
var var self = this;
oAttachment = null,
sTempName = '';
if (!this.viewModelVisibility()) if (!this.viewModelVisibility())
{ {
for (sTempName in oData.Result) _.each(oData.Result, function(id, tempName) {
{ var attachment = self.getAttachmentById(id);
if (Utils.has(oData.Result, sTempName)) if (attachment)
{ {
oAttachment = this.getAttachmentById(oData.Result[sTempName]); attachment.tempName(tempName);
if (oAttachment) attachment.waiting(false).uploading(false).complete(true);
{
oAttachment.tempName(sTempName);
oAttachment.waiting(false).uploading(false).complete(true);
}
} }
} });
} }
} }
else else