jshint -> eslint

This commit is contained in:
RainLoop Team 2016-06-27 23:54:38 +03:00
parent 40b3f929e9
commit 77a1d3f3df
100 changed files with 716 additions and 811 deletions

View file

@ -145,4 +145,4 @@
module.exports = LoginAdminView;
}());
}());

View file

@ -57,4 +57,4 @@
module.exports = PaneSettingsAdminView;
}());
}());

View file

@ -132,4 +132,4 @@
module.exports = AccountPopupView;
}());
}());

View file

@ -148,4 +148,4 @@
module.exports = ActivatePopupView;
}());
}());

View file

@ -34,51 +34,52 @@
this.addOpenPgpKeyCommand = Utils.createCommand(this, function () {
var
iCount = 30,
aMatch = null,
sKey = Utils.trim(this.key()),
oReg = /[\-]{3,6}BEGIN[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}[\s\S]+?[\-]{3,6}END[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}/gi,
oOpenpgpKeyring = PgpStore.openpgpKeyring
count = 30,
match = null,
key = Utils.trim(this.key()),
reg = /[\-]{3,6}BEGIN[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}[\s\S]+?[\-]{3,6}END[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}/gi,
openpgpKeyring = PgpStore.openpgpKeyring,
done = false
;
if (/[\n]/.test(sKey))
if (/[\n]/.test(key))
{
sKey = sKey.replace(/[\r]+/g, '')
.replace(/[\n]{2,}/g, '\n\n');
key = key.replace(/[\r]+/g, '').replace(/[\n]{2,}/g, '\n\n');
}
this.key.error('' === sKey);
this.key.error('' === key);
if (!oOpenpgpKeyring || this.key.error())
if (!openpgpKeyring || this.key.error())
{
return false;
}
do
{
aMatch = oReg.exec(sKey);
if (!aMatch || 0 > iCount)
match = reg.exec(key);
if (match && 0 > count)
{
break;
if (match[0] && match[1] && match[2] && match[1] === match[2])
{
if ('PRIVATE' === match[1])
{
openpgpKeyring.privateKeys.importKey(match[0]);
}
else if ('PUBLIC' === match[1])
{
openpgpKeyring.publicKeys.importKey(match[0]);
}
}
count--;
}
if (aMatch[0] && aMatch[1] && aMatch[2] && aMatch[1] === aMatch[2])
{
if ('PRIVATE' === aMatch[1])
{
oOpenpgpKeyring.privateKeys.importKey(aMatch[0]);
}
else if ('PUBLIC' === aMatch[1])
{
oOpenpgpKeyring.publicKeys.importKey(aMatch[0]);
}
}
done = true;
iCount--;
}
while (true);
while (done);
oOpenpgpKeyring.store();
openpgpKeyring.store();
require('App/User').default.reloadOpenPgpKeys();
Utils.delegateRun(this, 'cancelCommand');
@ -110,4 +111,4 @@
module.exports = AddOpenPgpKeyPopupView;
}());
}());

View file

@ -73,7 +73,7 @@
parts = (search || '').split(/[\s]+/g)
;
_.each(parts, function(part){
_.each(parts, function(part) {
switch (part)
{
case 'has:attachment':
@ -192,4 +192,4 @@
module.exports = AdvancedSearchPopupView;
}());
}());

View file

@ -136,4 +136,4 @@
module.exports = AskPopupView;
}());
}());

View file

@ -1,6 +1,4 @@
/* global require, module */
(function () {
'use strict';
@ -54,12 +52,12 @@
var
self = this,
fEmailOutInHelper = function (self, oIdentity, sName, bIn) {
if (oIdentity && self && oIdentity[sName]() && (bIn ? true : self[sName]()))
fEmailOutInHelper = function (context, oIdentity, sName, bIn) {
if (oIdentity && context && oIdentity[sName]() && (bIn ? true : context[sName]()))
{
var
sIdentityEmail = oIdentity[sName](),
aList = Utils.trim(self[sName]()).split(/[,]/)
aList = Utils.trim(context[sName]()).split(/[,]/)
;
aList = _.filter(aList, function (sEmail) {
@ -72,7 +70,7 @@
aList.push(sIdentityEmail);
}
self[sName](aList.join(','));
context[sName](aList.join(','));
}
}
;
@ -323,7 +321,7 @@
this.resizer = ko.observable(false).extend({'throttle': 50});
this.resizer.subscribe(_.bind(function () {
if (this.oEditor){
if (this.oEditor) {
this.oEditor.resize();
}
}, this));
@ -335,7 +333,6 @@
this.deleteCommand = Utils.createCommand(this, function () {
var
self = this,
PopupsAskViewModel = require('View/Popup/Ask')
;
@ -524,9 +521,6 @@
if (this.allowContacts)
{
this.skipCommand();
var self = this;
_.delay(function () {
kn.showScreenPopup(require('View/Popup/Contacts'),
[true, self.sLastFocusedField]);
@ -558,11 +552,10 @@
if (window.Dropbox)
{
window.Dropbox.choose({
'success': function(aFiles) {
if (aFiles && aFiles[0] && aFiles[0]['link'])
'success': function(files) {
if (files && files[0] && files[0].link)
{
self.addDropboxAttachment(aFiles[0]);
self.addDropboxAttachment(files[0]);
}
},
'linkType': 'direct',
@ -847,14 +840,14 @@
var self = this;
if (!this.oEditor && this.composeEditorArea())
{
//_.delay(function () {
// _.delay(function () {
self.oEditor = new HtmlEditor(self.composeEditorArea(), null, function () {
fOnInit(self.oEditor);
self.resizerTrigger();
}, function (bHtml) {
self.isHtml(!!bHtml);
});
//}, 1000);
// }, 1000);
}
else if (this.oEditor)
{
@ -932,7 +925,7 @@
sSignature = sSignature.replace(/{{MOMENT:[^}]+}}/g, '');
}
catch(e) {}
catch (e) {/* eslint-disable-line no-empty */}
}
return sSignature;
@ -1288,8 +1281,8 @@
}
else if (Utils.isNonEmptyArray(oMessageOrArray))
{
_.each(oMessageOrArray, function (oMessage) {
self.addMessageAsAttachment(oMessage);
_.each(oMessageOrArray, function (oItem) {
self.addMessageAsAttachment(oItem);
});
this.editor(function (oEditor) {
@ -1452,7 +1445,7 @@
});
}
if (!!Settings.appSettingsGet('allowCtrlEnterOnCompose'))
if (Settings.appSettingsGet('allowCtrlEnterOnCompose'))
{
key('ctrl+enter, command+enter', Enums.KeyState.Compose, function () {
self.sendCommand();
@ -1504,61 +1497,64 @@
if (oData && window.XMLHttpRequest && window.google &&
oData[window.google.picker.Response.ACTION] === window.google.picker.Action.PICKED &&
oData[window.google.picker.Response.DOCUMENTS] && oData[window.google.picker.Response.DOCUMENTS][0] &&
oData[window.google.picker.Response.DOCUMENTS][0]['id'])
oData[window.google.picker.Response.DOCUMENTS][0].id)
{
var
self = this,
oRequest = new window.XMLHttpRequest()
;
oRequest.open('GET', 'https://www.googleapis.com/drive/v2/files/' + oData[window.google.picker.Response.DOCUMENTS][0]['id']);
oRequest.open('GET', 'https://www.googleapis.com/drive/v2/files/' + oData[window.google.picker.Response.DOCUMENTS][0].id);
oRequest.setRequestHeader('Authorization', 'Bearer ' + sAccessToken);
oRequest.addEventListener('load', function() {
if (oRequest && oRequest.responseText)
{
var oItem = JSON.parse(oRequest.responseText), fExport = function (oItem, sMimeType, sExt) {
if (oItem && oItem['exportLinks'])
{
if (oItem['exportLinks'][sMimeType])
var
oResponse = JSON.parse(oRequest.responseText),
fExport = function (oItem, sMimeType, sExt) {
if (oItem && oItem.exportLinks)
{
oItem['downloadUrl'] = oItem['exportLinks'][sMimeType];
oItem['title'] = oItem['title'] + '.' + sExt;
oItem['mimeType'] = sMimeType;
}
else if (oItem['exportLinks']['application/pdf'])
{
oItem['downloadUrl'] = oItem['exportLinks']['application/pdf'];
oItem['title'] = oItem['title'] + '.pdf';
oItem['mimeType'] = 'application/pdf';
if (oItem.exportLinks[sMimeType])
{
oResponse.downloadUrl = oItem.exportLinks[sMimeType];
oResponse.title = oItem.title + '.' + sExt;
oResponse.mimeType = sMimeType;
}
else if (oItem.exportLinks['application/pdf'])
{
oResponse.downloadUrl = oItem.exportLinks['application/pdf'];
oResponse.title = oItem.title + '.pdf';
oResponse.mimeType = 'application/pdf';
}
}
}
};
;
if (oItem && !oItem['downloadUrl'] && oItem['mimeType'] && oItem['exportLinks'])
if (oResponse && !oResponse.downloadUrl && oResponse.mimeType && oResponse.exportLinks)
{
switch (oItem['mimeType'].toString().toLowerCase())
switch (oResponse.mimeType.toString().toLowerCase())
{
case 'application/vnd.google-apps.document':
fExport(oItem, 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'docx');
fExport(oResponse, 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'docx');
break;
case 'application/vnd.google-apps.spreadsheet':
fExport(oItem, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlsx');
fExport(oResponse, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlsx');
break;
case 'application/vnd.google-apps.drawing':
fExport(oItem, 'image/png', 'png');
fExport(oResponse, 'image/png', 'png');
break;
case 'application/vnd.google-apps.presentation':
fExport(oItem, 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'pptx');
fExport(oResponse, 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'pptx');
break;
default:
fExport(oItem, 'application/pdf', 'pdf');
fExport(oResponse, 'application/pdf', 'pdf');
break;
}
}
if (oItem && oItem['downloadUrl'])
if (oResponse && oResponse.downloadUrl)
{
self.addDriveAttachment(oItem, sAccessToken);
self.addDriveAttachment(oResponse, sAccessToken);
}
}
});
@ -1607,10 +1603,10 @@
fResult = function (oAuthResult) {
if (oAuthResult && !oAuthResult.error)
{
var oAuthToken = window.gapi.auth.getToken();
if (oAuthToken)
var oToken = window.gapi.auth.getToken();
if (oToken)
{
self.driveCreatePiker(oAuthToken);
self.driveCreatePiker(oToken);
}
return true;
@ -1674,14 +1670,14 @@
var self = this;
return function () {
var oItem = _.find(self.attachments(), function (oItem) {
var attachment = _.find(self.attachments(), function (oItem) {
return oItem && oItem.id === sId;
});
if (oItem)
if (attachment)
{
self.attachments.remove(oItem);
Utils.delegateRunOnDestroy(oItem);
self.attachments.remove(attachment);
Utils.delegateRunOnDestroy(attachment);
if (oJua)
{
@ -1925,15 +1921,15 @@
var
oAttachment = null,
iAttachmentSizeLimit = Utils.pInt(Settings.settingsGet('AttachmentLimit')),
mSize = oDropboxFile['bytes']
mSize = oDropboxFile.bytes
;
oAttachment = new ComposeAttachmentModel(
oDropboxFile['link'], oDropboxFile['name'], mSize
oDropboxFile.link, oDropboxFile.name, mSize
);
oAttachment.fromMessage = false;
oAttachment.cancel = this.cancelAttachmentHelper(oDropboxFile['link']);
oAttachment.cancel = this.cancelAttachmentHelper(oDropboxFile.link);
oAttachment.waiting(false).uploading(true).complete(false);
this.attachments.push(oAttachment);
@ -1966,7 +1962,7 @@
oAttachment.error(Translator.getUploadErrorDescByCode(Enums.UploadErrorCode.FileNoUploaded));
}
}, [oDropboxFile['link']]);
}, [oDropboxFile.link]);
return true;
};
@ -1981,15 +1977,15 @@
var
iAttachmentSizeLimit = Utils.pInt(Settings.settingsGet('AttachmentLimit')),
oAttachment = null,
mSize = oDriveFile['fileSize'] ? Utils.pInt(oDriveFile['fileSize']) : 0
mSize = oDriveFile.fileSize ? Utils.pInt(oDriveFile.fileSize) : 0
;
oAttachment = new ComposeAttachmentModel(
oDriveFile['downloadUrl'], oDriveFile['title'], mSize
oDriveFile.downloadUrl, oDriveFile.title, mSize
);
oAttachment.fromMessage = false;
oAttachment.cancel = this.cancelAttachmentHelper(oDriveFile['downloadUrl']);
oAttachment.cancel = this.cancelAttachmentHelper(oDriveFile.downloadUrl);
oAttachment.waiting(false).uploading(true).complete(false);
this.attachments.push(oAttachment);
@ -2023,7 +2019,7 @@
oAttachment.error(Translator.getUploadErrorDescByCode(Enums.UploadErrorCode.FileNoUploaded));
}
}, oDriveFile['downloadUrl'], sAccessToken);
}, oDriveFile.downloadUrl, sAccessToken);
return true;
};
@ -2089,14 +2085,14 @@
ComposePopupView.prototype.removeLinkedAttachments = function ()
{
var oItem = _.find(this.attachments(), function (oItem) {
var arrachment = _.find(this.attachments(), function (oItem) {
return oItem && oItem.isLinked;
});
if (oItem)
if (arrachment)
{
this.attachments.remove(oItem);
Utils.delegateRunOnDestroy(oItem);
this.attachments.remove(arrachment);
Utils.delegateRunOnDestroy(arrachment);
}
};

View file

@ -223,7 +223,7 @@
self.resultCallback(mData.data);
self.cancelCommand();
})['catch'](function (e) {
}).then(null, function (e) {
self.notification(Translator.i18n('PGP_NOTIFICATIONS/PGP_ERROR', {
'ERROR': '' + e
}));
@ -302,13 +302,9 @@
});
this.updateCommand = Utils.createCommand(this, function () {
var self = this;
_.each(this.encryptKeys(), function (oKey) {
oKey.removable(!self.sign() || !self.signKey() || self.signKey().key.id !== oKey.key.id);
});
});
this.selectedPrivateKey.subscribe(function (sValue) {
@ -334,9 +330,9 @@
self.defautOptionsAfterRender(oDomOption, oItem);
if (oItem && !Utils.isUnd(oItem['class']) && oDomOption)
if (oItem && !Utils.isUnd(oItem.class) && oDomOption)
{
$(oDomOption).addClass(oItem['class']);
$(oDomOption).addClass(oItem.class);
}
};
@ -465,14 +461,14 @@
if (aRec && 0 < aRec.length)
{
this.encryptKeys(_.uniq(_.compact(_.flatten(_.map(aRec, function (sEmail) {
var aKeys = PgpStore.findAllPublicKeysByEmailNotNative(sEmail);
return aKeys ? _.map(aKeys, function (oKey) {
this.encryptKeys(_.uniq(_.compact(_.flatten(_.map(aRec, function (sRecEmail) {
var keys = PgpStore.findAllPublicKeysByEmailNotNative(sRecEmail);
return keys ? _.map(keys, function (oKey) {
return {
'empty': !oKey,
'selected': ko.observable(!!oKey),
'removable': ko.observable(!self.sign() || !self.signKey() || self.signKey().key.id !== oKey.id),
'users': oKey ? (oKey.users || [sEmail]) : [sEmail],
'users': oKey ? (oKey.users || [sRecEmail]) : [sRecEmail],
'hash': oKey ? oKey.id.substr(-8).toUpperCase() : '',
'key': oKey
};

View file

@ -210,7 +210,7 @@
});
}, this);
this.selector = new Selector(this.contacts, this.currentContact, null,
this.selector = new Selector.Selector(this.contacts, this.currentContact, null,
'.e-contact-item .actionHandle', '.e-contact-item.selected', '.e-contact-item .checkboxItem',
'.e-contact-item.focused');
@ -370,7 +370,6 @@
this.syncCommand = Utils.createCommand(this, function () {
var self = this;
require('App/User').default.contactsSync(function (sResult, oData) {
if (Enums.StorageResultType.Success !== sResult || !oData || !oData.Result)
{
@ -439,8 +438,8 @@
ContactsPopupView.prototype.addNewOrFocusProperty = function (sType, sTypeStr)
{
var oItem = _.find(this.viewProperties(), function (oItem) {
return sType === oItem.type();
var oItem = _.find(this.viewProperties(), function (oProp) {
return sType === oProp.type();
});
if (oItem)
@ -794,4 +793,4 @@
module.exports = ContactsPopupView;
}());
}());

View file

@ -492,4 +492,4 @@
module.exports = DomainPopupView;
}());
}());

View file

@ -114,4 +114,4 @@
module.exports = DomainAliasPopupView;
}());
}());

View file

@ -207,4 +207,4 @@
module.exports = FilterPopupView;
}());
}());

View file

@ -117,4 +117,4 @@
module.exports = FolderCreateView;
}());
}());

View file

@ -134,4 +134,4 @@
module.exports = FolderSystemPopupView;
}());
}());

View file

@ -201,4 +201,4 @@
module.exports = IdentityPopupView;
}());
}());

View file

@ -61,4 +61,4 @@
module.exports = KeyboardShortcutsHelpPopupView;
}());
}());

View file

@ -58,9 +58,9 @@
LanguagesPopupView.prototype.setLanguageSelection = function ()
{
var sCurrent = this.fLang ? ko.unwrap(this.fLang) : '';
_.each(this.languages(), function (oItem) {
oItem['selected'](oItem['key'] === sCurrent);
var currentLang = this.fLang ? ko.unwrap(this.fLang) : '';
_.each(this.languages(), function (item) {
item.selected(item.key === currentLang);
});
};
@ -92,4 +92,4 @@
module.exports = LanguagesPopupView;
}());
}());

View file

@ -51,10 +51,10 @@
return false;
}
oUserId['email'] = this.email();
oUserId.email = this.email();
if ('' !== this.name())
{
oUserId['name'] = this.name();
oUserId.name = this.name();
}
this.submitRequest(true);
@ -66,9 +66,9 @@
try {
mPromise = PgpStore.openpgp.generateKey({
'userIds': [oUserId],
'numBits': Utils.pInt(self.keyBitLength()),
'passphrase': Utils.trim(self.password())
userIds: [oUserId],
numBits: Utils.pInt(self.keyBitLength()),
passphrase: Utils.trim(self.password())
});
mPromise.then(function (mKeyPair) {
@ -86,7 +86,7 @@
Utils.delegateRun(self, 'cancelCommand');
}
})['catch'](function() {
}).then(null, function() {
self.submitRequest(false);
});
}
@ -129,4 +129,4 @@
module.exports = NewOpenPgpKeyPopupView;
}());
}());

View file

@ -60,24 +60,24 @@
this.saveCommand = Utils.createCommand(this, function () {
var oList = {};
var list = {};
oList['Name'] = this.name();
list.Name = this.name();
_.each(this.configures(), function (oItem) {
var mValue = oItem.value();
if (false === mValue || true === mValue)
var value = oItem.value();
if (false === value || true === value)
{
mValue = mValue ? '1' : '0';
value = value ? '1' : '0';
}
oList['_' + oItem['Name']] = mValue;
list['_' + oItem.Name] = value;
}, this);
this.saveError('');
Remote.pluginSettingsUpdate(this.onPluginSettingsUpdateResponse, oList);
Remote.pluginSettingsUpdate(this.onPluginSettingsUpdateResponse, list);
}, this.hasConfiguration);
@ -120,10 +120,10 @@
if (oPlugin)
{
this.name(oPlugin['Name']);
this.readme(oPlugin['Readme']);
this.name(oPlugin.Name);
this.readme(oPlugin.Readme);
var aConfig = oPlugin['Config'];
var aConfig = oPlugin.Config;
if (Utils.isNonEmptyArray(aConfig))
{
this.configures(_.map(aConfig, function (aItem) {
@ -172,4 +172,4 @@
module.exports = PluginPopupView;
}());
}());

View file

@ -170,9 +170,9 @@
self.body.loading(false);
if (Enums.StorageResultType.Success === sResult && oData && oData.Result &&
'Object/Template' === oData.Result['@Object'] && Utils.isNormal(oData.Result['Body']))
'Object/Template' === oData.Result['@Object'] && Utils.isNormal(oData.Result.Body))
{
oTemplate.body = oData.Result['Body'];
oTemplate.body = oData.Result.Body;
oTemplate.populated = true;
self.body(oTemplate.body);
@ -202,4 +202,4 @@
module.exports = TemplatePopupView;
}());
}());

View file

@ -246,4 +246,4 @@
module.exports = TwoFactorConfigurationPopupView;
}());
}());

View file

@ -88,4 +88,4 @@
module.exports = TwoFactorTestPopupView;
}());
}());

View file

@ -68,4 +68,4 @@
module.exports = ViewOpenPgpKeyPopupView;
}());
}());

View file

@ -59,4 +59,4 @@
module.exports = WelcomePagePopupView;
}());
}());

View file

@ -31,4 +31,4 @@
module.exports = AboutUserView;
}());
}());

View file

@ -141,4 +141,4 @@
module.exports = AbstractSystemDropDownUserView;
}());
}());

View file

@ -201,7 +201,7 @@
self = this,
sPassword = this.password(),
fLoginRequest = _.bind(function (sPassword) {
fLoginRequest = _.bind(function (sLoginPassword) {
Remote.login(_.bind(function (sResult, oData) {
@ -215,7 +215,7 @@
this.additionalCode.visibility(true);
this.submitRequest(false);
_.delay(function(){
_.delay(function() {
self.additionalCode.focused(true);
}, 100);
}
@ -261,13 +261,13 @@
this.submitError(Translator.getNotification(Enums.Notification.UnknownError));
}
}, this), this.email(), '', sPassword, !!this.signMe(),
}, this), this.email(), '', sLoginPassword, !!this.signMe(),
this.bSendLanguage ? this.language() : '',
this.additionalCode.visibility() ? this.additionalCode() : '',
this.additionalCode.visibility() ? !!this.additionalCodeSignMe() : false
);
Local.set(Enums.ClientSideKeyName.LastSignMe, !!this.signMe() ? '-1-' : '-0-');
Local.set(Enums.ClientSideKeyName.LastSignMe, this.signMe() ? '-1-' : '-0-');
}, this)
;
@ -517,4 +517,4 @@
module.exports = LoginUserView;
}());
}());

View file

@ -279,7 +279,7 @@
this.quotaTooltip = _.bind(this.quotaTooltip, this);
this.selector = new Selector(this.messageList, this.selectorMessageSelected, this.selectorMessageFocused,
this.selector = new Selector.Selector(this.messageList, this.selectorMessageSelected, this.selectorMessageFocused,
'.messageListItem .actionHandle', '.messageListItem.selected', '.messageListItem .checkboxMessage',
'.messageListItem.focused');
@ -510,26 +510,24 @@
var
oEl = Utils.draggablePlace(),
aUids = MessageStore.messageListCheckedOrSelectedUidsWithSubMails()
updateUidsInfo = function() {
var aUids = MessageStore.messageListCheckedOrSelectedUidsWithSubMails();
oEl.data('rl-uids', aUids);
oEl.find('.text').text('' + aUids.length);
}
;
oEl.data('rl-folder', FolderStore.currentFolderFullNameRaw());
oEl.data('rl-uids', aUids);
oEl.find('.text').text('' + aUids.length);
_.defer(function () {
var aUids = MessageStore.messageListCheckedOrSelectedUidsWithSubMails();
oEl.data('rl-uids', aUids);
oEl.find('.text').text('' + aUids.length);
});
updateUidsInfo();
_.defer(updateUidsInfo);
return oEl;
};
/**
* @param {string} sFolderFullNameRaw
* @param {string|bool} sUid
* @param {string|bool} mUid
* @param {number} iSetAction
* @param {Array=} aMessages = null
*/
@ -964,9 +962,8 @@
{
var
self = this,
oMessage = _.find(this.messageList(), function (oMessage) {
return oMessage &&
!Cache.hasRequestedMessage(oMessage.folderFullNameRaw, oMessage.uid);
oMessage = _.find(this.messageList(), function (oItem) {
return oItem && !Cache.hasRequestedMessage(oItem.folderFullNameRaw, oItem.uid);
})
;
@ -1027,17 +1024,17 @@
var
oJua = new Jua({
'action': Links.append(),
'name': 'AppendFile',
'queueSize': 1,
'multipleSizeLimit': 1,
'hidden': {
'Folder': function () {
action: Links.append(),
name: 'AppendFile',
queueSize: 1,
multipleSizeLimit: 1,
hidden: {
Folder: function () {
return FolderStore.currentFolderFullNameRaw();
}
},
'dragAndDropElement': this.dragOverArea(),
'dragAndDropBodyElement': this.dragOverBodyArea()
dragAndDropElement: this.dragOverArea(),
dragAndDropBodyElement: this.dragOverBodyArea()
})
;
@ -1063,7 +1060,7 @@
}, this))
.on('onSelect', _.bind(function (sUid, oData) {
if (sUid && oData && 'message/rfc822' === oData['Type'])
if (sUid && oData && 'message/rfc822' === oData.Type)
{
MessageStore.messageListLoading(true);
return true;

View file

@ -347,7 +347,7 @@
}, this);
this.messageActiveDom.subscribe(function (oDom) {
this.bodyBackgroundColor(oDom ? this.detectDomBackgroundColor(oDom): '');
this.bodyBackgroundColor(oDom ? this.detectDomBackgroundColor(oDom) : '');
}, this);
this.message.subscribe(function (oMessage) {
@ -469,22 +469,22 @@
iLimit = 5,
sResult = '',
aC = null,
fFindDom = function (oDom) {
var aC = oDom ? oDom.children() : null;
return (aC && 1 === aC.length && aC.is('table,div,center')) ? aC : null;
fFindDom = function (oInputDom) {
var children = oInputDom ? oInputDom.children() : null;
return (children && 1 === children.length && children.is('table,div,center')) ? children : null;
},
fFindColor = function (oDom) {
var sResult = '';
if (oDom)
fFindColor = function (oInputDom) {
var color = '';
if (oInputDom)
{
sResult = oDom.css('background-color') || '';
if (!oDom.is('table'))
color = oInputDom.css('background-color') || '';
if (!oInputDom.is('table'))
{
sResult = 'rgba(0, 0, 0, 0)' === sResult || 'transparent' === sResult ? '' : sResult;
color = 'rgba(0, 0, 0, 0)' === color || 'transparent' === color ? '' : color;
}
}
return sResult;
return color;
}
;
@ -606,10 +606,10 @@
iListIndex++;
return {
'src': oItem.linkPreview(),
'thumb': oItem.linkThumbnail(),
'subHtml': oItem.fileName,
'downloadUrl': oItem.linkPreview()
src: oItem.linkPreview(),
thumb: oItem.linkThumbnail(),
subHtml: oItem.fileName,
downloadUrl: oItem.linkPreview()
};
}
@ -707,7 +707,7 @@
oDom
.on('click', 'a', function (oEvent) {
// setup maito protocol
return !(!!oEvent && 3 !== oEvent['which'] && Utils.mailToHelper($(this).attr('href'),
return !(!!oEvent && 3 !== oEvent.which && Utils.mailToHelper($(this).attr('href'),
Settings.capa(Enums.Capa.Composer) ? require('View/Popup/Compose') : null));
})
// .on('mouseover', 'a', _.debounce(function (oEvent) {
@ -1221,4 +1221,4 @@
module.exports = MessageViewMailBoxUserView;
}());
}());

View file

@ -99,4 +99,4 @@
module.exports = MenuSettingsUserView;
}());
}());

View file

@ -73,4 +73,4 @@
module.exports = PaneSettingsUserView;
}());
}());

View file

@ -25,4 +25,4 @@
module.exports = SystemDropDownSettingsUserView;
}());
}());