Fix eslint warnings

This commit is contained in:
RainLoop Team 2016-04-20 20:12:51 +03:00
parent dd824179f1
commit 72ca818500
35 changed files with 510 additions and 290 deletions

156
.eslintrc Normal file
View file

@ -0,0 +1,156 @@
{
"parser": "babel-eslint",
"ecmaFeatures": {
"modules": true,
"arrowFunctions": true,
"blockBindings": true
},
"env": {
"node": true,
"es6": true,
"browser": true
},
"rules": {
"comma-dangle": [2, "never"],
"no-cond-assign": 2,
"no-console": 2,
"no-constant-condition": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-dupe-keys": 2,
"no-empty": 2,
"no-empty-character-class": 2,
"no-ex-assign": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": 0,
"no-extra-semi": 2,
"no-func-assign": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-negated-in-lhs": 2,
"no-obj-calls": 2,
"no-regex-spaces": 2,
"no-reserved-keys": 0,
"no-sparse-arrays": 2,
"no-unreachable": 2,
"use-isnan": 2,
"valid-jsdoc": 0,
"valid-typeof": 2,
// Best Practices
"block-scoped-var": 2,
"complexity": 0,
"consistent-return": 2,
"curly": 2,
// "default-case": 2,
"dot-notation": 2,
"eqeqeq": 2,
"guard-for-in": 2,
"no-alert": 2,
"no-caller": 2,
"no-div-regex": 2,
"no-else-return": 2,
"no-eq-null": 2,
"no-eval": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-implied-eval": 2,
"no-iterator": 2,
"no-labels": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-multi-spaces": 2,
"no-multi-str": 0,
"no-native-reassign": 2,
"no-new": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-process-env": 2,
"no-proto": 2,
"no-redeclare": 2,
"no-return-assign": 2,
"no-script-url": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-unused-expressions": 2,
"no-void": 0,
"no-warning-comments": 2,
"no-with": 2,
"radix": 2,
"vars-on-top": 0,
"wrap-iife": 2,
"yoda": 0,
// Strict Mode
"strict": 0,
// Variables
"no-catch-shadow": 2,
"no-delete-var": 2,
"no-label-var": 2,
"no-shadow": 2,
"no-shadow-restricted-names": 2,
"no-undef": 2,
"no-undef-init": 2,
"no-undefined": 2,
"no-unused-vars": 2,
"no-use-before-define": 2,
// Stylistic Issues
// "indent": [2, "tab", {
// "SwitchCase": 1,
// "VariableDeclarator": 1
// }],
"camelcase": 0,
"comma-spacing": 2,
"comma-style": 2,
"consistent-this": 0,
"eol-last": 2,
"func-names": 0,
"func-style": 0,
"key-spacing": [2, {
"beforeColon": false,
"afterColon": true
}],
"max-nested-callbacks": 0,
"new-cap": 2,
"new-parens": 2,
"no-array-constructor": 2,
"no-inline-comments": 0,
// "no-lonely-if": 2,
"no-mixed-spaces-and-tabs": 2,
// "no-nested-ternary": 2,
"no-new-object": 2,
"semi-spacing": [2, {
"before": false,
"after": true
}],
"no-spaced-func": 2,
"no-ternary": 0,
"no-trailing-spaces": 2,
"no-multiple-empty-lines": 2,
"no-underscore-dangle": 0,
"one-var": 0,
"operator-assignment": [2, "always"],
"padded-blocks": 0,
"quotes": [2, "single"],
"quote-props": [2, "as-needed"],
"semi": [2, "always"],
// "sort-vars": [2, {"ignoreCase": true}],
"space-before-blocks": 2,
"object-curly-spacing": [2, "never"],
"array-bracket-spacing": [2, "never"],
"space-in-parens": 2,
"space-infix-ops": 2,
"space-unary-ops": 2,
"spaced-comment": 2,
"wrap-regex": 0,
// Legacy
"max-depth": 0,
"max-len": [2, 200],
"max-params": 0,
"max-statements": 0,
"no-plusplus": 0
}
}

View file

@ -1,7 +1,7 @@
import {window, _, $, key} from 'common';
import Globals from 'Common/Globals';
import * as Enums from 'Common/Enums';
import * as Enums from 'Common/Enums';
import Utils from 'Common/Utils';
import Links from 'Common/Links';
import Events from 'Common/Events';
@ -64,7 +64,7 @@ class AbstractApp extends AbstractBoot
}, 50));
// DEBUG
// DEBUG
// Events.sub({
// 'window.resize': function () {
// window.console.log('window.resize');
@ -112,15 +112,15 @@ class AbstractApp extends AbstractBoot
if (Globals.sUserAgent && (Globals.sUserAgent.indexOf('chrome') > -1 || Globals.sUserAgent.indexOf('chrome') > -1))
{
const oLink = window.document.createElement('a');
oLink['href'] = link;
oLink.href = link;
if (window.document['createEvent'])
if (window.document && window.document.createEvent)
{
const oE = window.document['createEvent']('MouseEvents');
if (oE && oE['initEvent'] && oLink['dispatchEvent'])
const oE = window.document.createEvent.MouseEvents;
if (oE && oE.initEvent && oLink.dispatchEvent)
{
oE['initEvent']('click', true, true);
oLink['dispatchEvent'](oE);
oE.initEvent('click', true, true);
oLink.dispatchEvent(oE);
return true;
}
}
@ -179,14 +179,14 @@ class AbstractApp extends AbstractBoot
}
/**
* @param {string} key
* @param {string} token
*/
setClientSideToken(key) {
setClientSideToken(token) {
if (window.__rlah_set)
{
window.__rlah_set(key);
window.__rlah_set(token);
require('Storage/Settings').settingsSet('AuthAccountHash', key);
require('Storage/Settings').settingsSet('AuthAccountHash', token);
require('Common/Links').populateAuthSuffix();
}
}
@ -203,7 +203,7 @@ class AbstractApp extends AbstractBoot
inIframe = !!Settings.settingsGet('InIframe')
;
let customLogoutLink = Utils.pString(Settings.settingsGet('CustomLogoutLink'))
let customLogoutLink = Utils.pString(Settings.settingsGet('CustomLogoutLink'));
if (logout)
{
@ -273,7 +273,7 @@ class AbstractApp extends AbstractBoot
ko.components.register('x-script', require('Component/Script'));
// ko.components.register('svg-icon', require('Component/SvgIcon'));
if (/**false && /**/Settings.settingsGet('MaterialDesign') && Globals.bAnimationSupported)
if (Settings.settingsGet('MaterialDesign') && Globals.bAnimationSupported)
{
ko.components.register('Checkbox', require('Component/MaterialDesign/Checkbox'));
ko.components.register('CheckboxSimple', require('Component/Checkbox'));
@ -291,49 +291,49 @@ class AbstractApp extends AbstractBoot
_.delay(Utils.windowResizeCallback, 1000);
ssm.addState({
'id': 'mobile',
'maxWidth': 767,
'onEnter': () => {
id: 'mobile',
maxWidth: 767,
onEnter: () => {
Globals.$html.addClass('ssm-state-mobile');
Events.pub('ssm.mobile-enter');
},
'onLeave': () => {
onLeave: () => {
Globals.$html.removeClass('ssm-state-mobile');
Events.pub('ssm.mobile-leave');
}
});
ssm.addState({
'id': 'tablet',
'minWidth': 768,
'maxWidth': 999,
'onEnter': function() {
id: 'tablet',
minWidth: 768,
maxWidth: 999,
onEnter: function() {
Globals.$html.addClass('ssm-state-tablet');
},
'onLeave': function() {
onLeave: function() {
Globals.$html.removeClass('ssm-state-tablet');
}
});
ssm.addState({
'id': 'desktop',
'minWidth': 1000,
'maxWidth': 1400,
'onEnter': () => {
id: 'desktop',
minWidth: 1000,
maxWidth: 1400,
onEnter: () => {
Globals.$html.addClass('ssm-state-desktop');
},
'onLeave': () => {
onLeave: () => {
Globals.$html.removeClass('ssm-state-desktop');
}
});
ssm.addState({
'id': 'desktop-large',
'minWidth': 1400,
'onEnter': () => {
id: 'desktop-large',
minWidth: 1400,
onEnter: () => {
Globals.$html.addClass('ssm-state-desktop-large');
},
'onLeave': () => {
onLeave: () => {
Globals.$html.removeClass('ssm-state-desktop-large');
}
});
@ -360,7 +360,7 @@ class AbstractApp extends AbstractBoot
require('Stores/Language').populate();
require('Stores/Theme').populate();
require('Stores/Social').populate();
};
}
}
export {AbstractApp, AbstractApp as default};
export {AbstractApp, AbstractApp as default};

View file

@ -3,7 +3,7 @@ import {window, _} from 'common';
import ko from 'ko';
import progressJs from 'progressJs';
import * as Enums from 'Common/Enums';
import * as Enums from 'Common/Enums';
import Utils from 'Common/Utils';
import Links from 'Common/Links';
import Translator from 'Common/Translator';
@ -41,9 +41,9 @@ class AdminApp extends AbstractApp
{
DomainStore.domains(_.map(data.Result, (enabled, name) => {
return {
'name': name,
'disabled': ko.observable(!enabled),
'deleteAccess': ko.observable(false)
name: name,
disabled: ko.observable(!enabled),
deleteAccess: ko.observable(false)
};
}));
}
@ -58,9 +58,9 @@ class AdminApp extends AbstractApp
{
PluginStore.plugins(_.map(data.Result, (item) => {
return {
'name': item['Name'],
'disabled': ko.observable(!item['Enabled']),
'configured': ko.observable(!!item['Configured'])
name: item.Name,
disabled: ko.observable(!item.Enabled),
configured: ko.observable(!!item.Configured)
};
}));
}
@ -83,9 +83,9 @@ class AdminApp extends AbstractApp
;
_.each(PackageStore.packages(), (item) => {
if (item && item['loading']())
if (item && item.loading())
{
loading[item['file']] = item;
loading[item.file] = item;
}
});
@ -94,8 +94,8 @@ class AdminApp extends AbstractApp
list = _.compact(_.map(data.Result.List, (item) => {
if (item)
{
item['loading'] = ko.observable(!Utils.isUnd(loading[item['file']]));
return 'core' === item['type'] && !item['canBeInstalled'] ? null : item;
item.loading = ko.observable(!Utils.isUnd(loading[item.file]));
return 'core' === item.type && !item.canBeInstalled ? null : item;
}
return null;
}));
@ -170,10 +170,10 @@ class AdminApp extends AbstractApp
LicenseStore.licenseError('');
Remote.licensing((result, data) => {
LicenseStore.licensingProcess(false);
if (Enums.StorageResultType.Success === result && data && data.Result && Utils.isNormal(data.Result['Expired']))
if (Enums.StorageResultType.Success === result && data && data.Result && Utils.isNormal(data.Result.Expired))
{
LicenseStore.licenseValid(true);
LicenseStore.licenseExpired(Utils.pInt(data.Result['Expired']));
LicenseStore.licenseExpired(Utils.pInt(data.Result.Expired));
LicenseStore.licenseError('');
LicenseStore.licensing(true);
AppStore.prem(true);
@ -237,7 +237,7 @@ class AdminApp extends AbstractApp
}
else
{
if (!!Settings.settingsGet('Auth'))
if (Settings.settingsGet('Auth'))
{
kn.startScreens([
require('Screen/Admin/Settings')

View file

@ -1,6 +1,5 @@
import {window, _, $} from 'common';
import ko from 'ko';
import progressJs from 'progressJs';
import Tinycon from 'Tinycon';
@ -86,10 +85,15 @@ class AppUser extends AbstractApp
if (Settings.settingsGet('UserBackgroundHash'))
{
_.delay(() => {
$('#rl-bg').attr('style', 'background-image: none !important;')
.backstretch(Links.userBackground(Settings.settingsGet('UserBackgroundHash')), {
'fade': Globals.bAnimationSupported ? 1000 : 0, 'centeredX': true, 'centeredY': true
}).removeAttr('style');
$('#rl-bg')
.attr('style', 'background-image: none !important;')
.backstretch(Links.userBackground(Settings.settingsGet('UserBackgroundHash')), {
fade: Globals.bAnimationSupported ? 1000 : 0,
centeredX: true,
centeredY: true
})
.removeAttr('style')
;
}, 1000);
}
@ -205,12 +209,12 @@ class AppUser extends AbstractApp
_.each(this.oMoveCache, (oItem) => {
var
bSpam = sSpamFolder === oItem['To'],
bTrash = sTrashFolder === oItem['To'],
bHam = !bSpam && sSpamFolder === oItem['From'] && Cache.getFolderInboxName() === oItem['To']
bSpam = sSpamFolder === oItem.To,
bTrash = sTrashFolder === oItem.To,
bHam = !bSpam && sSpamFolder === oItem.From && Cache.getFolderInboxName() === oItem.To
;
Remote.messagesMove(this.moveOrDeleteResponseHelper, oItem['From'], oItem['To'], oItem['Uid'],
Remote.messagesMove(this.moveOrDeleteResponseHelper, oItem.From, oItem.To, oItem.Uid,
bSpam ? 'SPAM' : (bHam ? 'HAM' : ''), bSpam || bTrash);
});
@ -223,13 +227,13 @@ class AppUser extends AbstractApp
if (!this.oMoveCache[sH])
{
this.oMoveCache[sH] = {
'From': sFromFolderFullNameRaw,
'To': sToFolderFullNameRaw,
'Uid': []
From: sFromFolderFullNameRaw,
To: sToFolderFullNameRaw,
Uid: []
};
}
this.oMoveCache[sH]['Uid'] = _.union(this.oMoveCache[sH]['Uid'], aUidForMove);
this.oMoveCache[sH].Uid = _.union(this.oMoveCache[sH].Uid, aUidForMove);
this.messagesMoveTrigger();
}
@ -434,13 +438,13 @@ class AppUser extends AbstractApp
;
if (oItem.users) {
_.each(oItem.users, (oItem) => {
_.each(oItem.users, (item) => {
oEmail.clear();
oEmail.mailsoParse(oItem.userId.userid);
oEmail.mailsoParse(item.userId.userid);
if (oEmail.validate())
{
aEmails.push(oEmail.email);
aUsers.push(oItem.userId.userid);
aUsers.push(item.userId.userid);
}
});
}
@ -494,7 +498,7 @@ class AppUser extends AbstractApp
// });
// }
// });
};
}
accountsAndIdentities(bBoot) {
@ -516,7 +520,7 @@ class AppUser extends AbstractApp
sParentEmail = '' === sParentEmail ? sAccountEmail : sParentEmail;
if (Utils.isArray(oData.Result['Accounts']))
if (Utils.isArray(oData.Result.Accounts))
{
_.each(AccountStore.accounts(), (oAccount) => {
aCounts[oAccount.email] = oAccount.count();
@ -524,7 +528,7 @@ class AppUser extends AbstractApp
Utils.delegateRunOnDestroy(AccountStore.accounts());
AccountStore.accounts(_.map(oData.Result['Accounts'],
AccountStore.accounts(_.map(oData.Result.Accounts,
(sValue) => new AccountModel(sValue, sValue !== sParentEmail, aCounts[sValue] || 0)));
}
@ -534,23 +538,23 @@ class AppUser extends AbstractApp
Events.sub('interval.10m-after5m', () => this.accountsCounts());
}
if (Utils.isArray(oData.Result['Identities']))
if (Utils.isArray(oData.Result.Identities))
{
Utils.delegateRunOnDestroy(IdentityStore.identities());
IdentityStore.identities(_.map(oData.Result['Identities'], (oIdentityData) => {
IdentityStore.identities(_.map(oData.Result.Identities, (oIdentityData) => {
const
sId = Utils.pString(oIdentityData['Id']),
sEmail = Utils.pString(oIdentityData['Email']),
sId = Utils.pString(oIdentityData.Id),
sEmail = Utils.pString(oIdentityData.Email),
oIdentity = new IdentityModel(sId, sEmail)
;
oIdentity.name(Utils.pString(oIdentityData['Name']));
oIdentity.replyTo(Utils.pString(oIdentityData['ReplyTo']));
oIdentity.bcc(Utils.pString(oIdentityData['Bcc']));
oIdentity.signature(Utils.pString(oIdentityData['Signature']));
oIdentity.signatureInsertBefore(!!oIdentityData['SignatureInsertBefore']);
oIdentity.name(Utils.pString(oIdentityData.Name));
oIdentity.replyTo(Utils.pString(oIdentityData.ReplyTo));
oIdentity.bcc(Utils.pString(oIdentityData.Bcc));
oIdentity.signature(Utils.pString(oIdentityData.Signature));
oIdentity.signatureInsertBefore(!!oIdentityData.SignatureInsertBefore);
return oIdentity;
}));
@ -568,11 +572,11 @@ class AppUser extends AbstractApp
TemplateStore.templates.loading(false);
if (Enums.StorageResultType.Success === result && data.Result &&
Utils.isArray(data.Result['Templates']))
Utils.isArray(data.Result.Templates))
{
Utils.delegateRunOnDestroy(TemplateStore.templates());
TemplateStore.templates(_.compact(_.map(data.Result['Templates'], (templateData) => {
TemplateStore.templates(_.compact(_.map(data.Result.Templates, (templateData) => {
const template = new TemplateModel();
return template.parse(templateData) ? template : null;
})));
@ -606,15 +610,14 @@ class AppUser extends AbstractApp
{
let
uid = '',
list = [],
check = false,
unreadCountChange = false
;
const folder = Cache.getFolderFromCacheList(data.Result.Folder);
if (folder)
const folderFromCache = Cache.getFolderFromCacheList(data.Result.Folder);
if (folderFromCache)
{
folder.interval = Momentor.momentNowUnix();
folderFromCache.interval = Momentor.momentNowUnix();
if (data.Result.Hash)
{
@ -623,22 +626,22 @@ class AppUser extends AbstractApp
if (Utils.isNormal(data.Result.MessageCount))
{
folder.messageCountAll(data.Result.MessageCount);
folderFromCache.messageCountAll(data.Result.MessageCount);
}
if (Utils.isNormal(data.Result.MessageUnseenCount))
{
if (Utils.pInt(folder.messageCountUnread()) !== Utils.pInt(data.Result.MessageUnseenCount))
if (Utils.pInt(folderFromCache.messageCountUnread()) !== Utils.pInt(data.Result.MessageUnseenCount))
{
unreadCountChange = true;
}
folder.messageCountUnread(data.Result.MessageUnseenCount);
folderFromCache.messageCountUnread(data.Result.MessageUnseenCount);
}
if (unreadCountChange)
{
Cache.clearMessageFlagsFromCacheByFolder(folder.fullNameRaw);
Cache.clearMessageFlagsFromCacheByFolder(folderFromCache.fullNameRaw);
}
if (data.Result.Flags)
@ -649,8 +652,8 @@ class AppUser extends AbstractApp
{
check = true;
const flags = data.Result.Flags[uid];
Cache.storeMessageFlagsToCacheByFolderAndUid(folder.fullNameRaw, uid.toString(), [
!flags['IsSeen'], !!flags['IsFlagged'], !!flags['IsAnswered'], !!flags['IsForwarded'], !!flags['IsReadReceipt']
Cache.storeMessageFlagsToCacheByFolderAndUid(folderFromCache.fullNameRaw, uid.toString(), [
!flags.IsSeen, !!flags.IsFlagged, !!flags.IsAnswered, !!flags.IsForwarded, !!flags.IsReadReceipt
]);
}
}
@ -661,16 +664,16 @@ class AppUser extends AbstractApp
}
}
MessageStore.initUidNextAndNewMessages(folder.fullNameRaw, data.Result.UidNext, data.Result.NewMessages);
MessageStore.initUidNextAndNewMessages(folderFromCache.fullNameRaw, data.Result.UidNext, data.Result.NewMessages);
const hash = Cache.getFolderHash(data.Result.Folder);
if (data.Result.Hash !== hash || '' === hash || unreadCountChange)
{
if (folder.fullNameRaw === FolderStore.currentFolderFullNameRaw())
if (folderFromCache.fullNameRaw === FolderStore.currentFolderFullNameRaw())
{
this.reloadMessageList();
}
else if (Cache.getFolderInboxName() === folder.fullNameRaw)
else if (Cache.getFolderInboxName() === folderFromCache.fullNameRaw)
{
this.recacheInboxMessageList();
}
@ -680,7 +683,7 @@ class AppUser extends AbstractApp
}
}, folder, list);
}
};
}
/**
* @param {boolean=} boot = false
@ -762,7 +765,7 @@ class AppUser extends AbstractApp
}
}, folders);
}
};
}
/**
* @param {string} sFolderFullNameRaw
@ -873,9 +876,9 @@ class AppUser extends AbstractApp
if (Enums.StorageResultType.Success === result && data && data.Result)
{
SocialStore.google.userName(data.Result['Google'] || '');
SocialStore.facebook.userName(data.Result['Facebook'] || '');
SocialStore.twitter.userName(data.Result['Twitter'] || '');
SocialStore.google.userName(data.Result.Google || '');
SocialStore.facebook.userName(data.Result.Facebook || '');
SocialStore.twitter.userName(data.Result.Twitter || '');
}
else
{
@ -955,6 +958,21 @@ class AppUser extends AbstractApp
oTop = null,
oBottom = null,
fSetHeight = (height) => {
if (height)
{
if (oTop)
{
oTop.attr('style', 'height:' + height + 'px');
}
if (oBottom)
{
oBottom.attr('style', 'top:' + (55 /* top toolbar */ + height) + 'px');
}
}
},
fResizeCreateFunction = (event) => {
if (event && event.target)
{
@ -992,29 +1010,14 @@ class AppUser extends AbstractApp
},
oOptions = {
'helper': 'ui-resizable-helper-h',
'minHeight': iMinHeight,
'maxHeight': iMaxHeight,
'handles': 's',
'create': fResizeCreateFunction,
'resize': fResizeResizeFunction,
'start': fResizeStartFunction,
'stop': fResizeStopFunction
},
fSetHeight = (height) => {
if (height)
{
if (oTop)
{
oTop.attr('style', 'height:' + height + 'px');
}
if (oBottom)
{
oBottom.attr('style', 'top:' + (55 /* top toolbar */ + height) + 'px');
}
}
helper: 'ui-resizable-helper-h',
minHeight: iMinHeight,
maxHeight: iMaxHeight,
handles: 's',
create: fResizeCreateFunction,
resize: fResizeResizeFunction,
start: fResizeStartFunction,
stop: fResizeStopFunction
},
fDisable = (bDisable) => {
@ -1054,7 +1057,7 @@ class AppUser extends AbstractApp
Events.sub('layout', (layout) => {
fDisable(Enums.Layout.BottomPreview !== layout);
});
};
}
initVerticalLayoutResizer(sClientSideKeyName) {
@ -1070,11 +1073,11 @@ class AppUser extends AbstractApp
if (iWidth)
{
oLeft.css({
'width': '' + iWidth + 'px'
width: '' + iWidth + 'px'
});
oRight.css({
'left': '' + iWidth + 'px'
left: '' + iWidth + 'px'
});
}
},
@ -1118,7 +1121,7 @@ class AppUser extends AbstractApp
Local.set(sClientSideKeyName, oObject.size.width);
oRight.css({
'left': '' + oObject.size.width + 'px'
left: '' + oObject.size.width + 'px'
});
}
}
@ -1130,14 +1133,14 @@ class AppUser extends AbstractApp
}
oLeft.resizable({
'helper': 'ui-resizable-helper-w',
'minWidth': iMinWidth,
'maxWidth': 350,
'handles': 'e',
'create': fResizeCreateFunction,
'resize': fResizeResizeFunction,
'start': fResizeStartFunction,
'stop': fResizeStopFunction
helper: 'ui-resizable-helper-w',
minWidth: iMinWidth,
maxWidth: 350,
handles: 'e',
create: fResizeCreateFunction,
resize: fResizeResizeFunction,
start: fResizeStartFunction,
stop: fResizeStopFunction
});
Events.sub('left-panel.off', () => {
@ -1154,7 +1157,7 @@ class AppUser extends AbstractApp
this.loginAndLogoutReload(false, true,
Settings.settingsGet('ParentEmail') && 0 < Settings.settingsGet('ParentEmail').length);
});
};
}
bootstartTwoFactorScreen() {
kn.showScreenPopup(require('View/Popup/TwoFactorConfiguration'), [true]);
@ -1195,7 +1198,7 @@ class AppUser extends AbstractApp
{
kn.hideLoading();
progressJs.onbeforeend(() => {
progressJs.onbeforeend(() => {
$('.progressjs-container').hide();
_.delay(() => {
$('.progressjs-container').remove();
@ -1208,7 +1211,7 @@ class AppUser extends AbstractApp
{
kn.hideLoading();
}
};
}
bootstart() {
@ -1240,7 +1243,7 @@ class AppUser extends AbstractApp
});
this.setWindowTitle('');
if (!!Settings.settingsGet('Auth'))
if (Settings.settingsGet('Auth'))
{
Globals.$html.addClass('rl-user-auth');
@ -1255,7 +1258,7 @@ class AppUser extends AbstractApp
{
this.setWindowTitle(Translator.i18n('TITLES/LOADING'));
//require.ensure([], function() { // require code splitting
// require.ensure([], function() { // require code splitting
this.foldersReload((value) => {
@ -1319,8 +1322,8 @@ class AppUser extends AbstractApp
kn.startScreens([
require('Screen/User/MailBox'),
Settings.capa(Enums.Capa.Settings) ? require('Screen/User/Settings') : null,
false ? require('Screen/User/About') : null
Settings.capa(Enums.Capa.Settings) ? require('Screen/User/Settings') : null
// false ? require('Screen/User/About') : null
]);
if (bGoogle || bFacebook || bTwitter)
@ -1381,7 +1384,7 @@ class AppUser extends AbstractApp
window.navigator.registerProtocolHandler('mailto',
window.location.protocol + '//' + window.location.host + window.location.pathname + '?mailto&to=%s',
'' + (Settings.settingsGet('Title') || 'RainLoop'));
} catch(e) {}
} catch (e) {/* eslint-disable-line no-empty */}
if (Settings.settingsGet('MailToEmail'))
{
@ -1394,7 +1397,7 @@ class AppUser extends AbstractApp
{
_.defer(() => this.initVerticalLayoutResizer(Enums.ClientSideKeyName.FolderListSize));
if (Tinycon && Settings.settingsGet('FaviconStatus') && !Settings.settingsGet('Filtered') )
if (Tinycon && Settings.settingsGet('FaviconStatus') && !Settings.settingsGet('Filtered'))
{
Tinycon.setOptions({
fallback: false
@ -1412,7 +1415,7 @@ class AppUser extends AbstractApp
});
//}); // require code splitting
// }); // require code splitting
}
}

View file

@ -21,7 +21,7 @@ class Audio
this.player = this.createNewObject();
this.supported = !Globals.bMobileDevice && !Globals.bSafari && !!this.player && !!this.player.play;
if (this.supported && this.player.canPlayType)
if (this.supported && this.player.canPlayType)
{
this.supportedMp3 = '' !== this.player.canPlayType('audio/mpeg;').replace(/no/, '');
this.supportedWav = '' !== this.player.canPlayType('audio/wav; codecs="1"').replace(/no/, '');

View file

@ -4,7 +4,8 @@
const BASE_64_CHR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
/*jslint bitwise: true*/
/* jslint bitwise: true */
/* eslint-disable */
const Base64 = {
// public method for urlsafe encoding
@ -13,7 +14,7 @@ const Base64 = {
// public method for encoding
encode: (input) => {
let
output = '',
chr1, chr2, chr3, enc1, enc2, enc3, enc4,
@ -164,4 +165,5 @@ const Base64 = {
};
module.exports = Base64;
/*jslint bitwise: false*/
/* jslint bitwise: false */
/* eslint-enable */

View file

@ -1,5 +1,4 @@
import {_} from 'common';
import {Capa, MessageSetAction} from 'Common/Enums';
import Utils from 'Common/Utils';
@ -239,17 +238,17 @@ class CacheUserStorage
if (0 < message.threads().length)
{
const unseenSubUid = _.find(message.threads(), (sSubUid) => {
if (uid !== sSubUid){
const flags = this.getMessageFlagsFromCache(message.folderFullNameRaw, sSubUid);
return flags && 0 < flags.length && !!flags[0];
if (uid !== sSubUid) {
const subFlags = this.getMessageFlagsFromCache(message.folderFullNameRaw, sSubUid);
return subFlags && 0 < subFlags.length && !!subFlags[0];
}
return false;
});
const flaggedSubUid = _.find(message.threads(), (sSubUid) => {
if (uid !== sSubUid) {
const flags = this.getMessageFlagsFromCache(message.folderFullNameRaw, sSubUid);
return flags && 0 < flags.length && !!flags[1];
const subFlags = this.getMessageFlagsFromCache(message.folderFullNameRaw, sSubUid);
return subFlags && 0 < subFlags.length && !!subFlags[1];
}
return false;
});
@ -269,7 +268,7 @@ class CacheUserStorage
this.setMessageFlagsToCache(
message.folderFullNameRaw, message.uid,
[message.unseen(), message.flagged(), message.answered(), message.forwarded(),
message.isReadReceipt(), message.deletedMark()]
message.isReadReceipt(), message.deletedMark()]
);
}
}
@ -293,7 +292,7 @@ class CacheUserStorage
*/
storeMessageFlagsToCacheBySetAction(folder, uid, setAction) {
let unread = 0;
let unread = 0;
const flags = this.getMessageFlagsFromCache(folder, uid);
if (Utils.isArray(flags) && 0 < flags.length)

View file

@ -22,19 +22,25 @@ class CookieDriver
const storageValue = $.cookie(CLIENT_SIDE_STORAGE_INDEX_NAME);
storageResult = null === storageValue ? null : JSON.parse(storageValue);
}
catch (e) {}
catch (e)
{
// eslint-disable-line no-empty
}
(storageResult || (storageResult = {}))[key] = data;
try
{
$.cookie(CLIENT_SIDE_STORAGE_INDEX_NAME, JSON.stringify(storageResult), {
'expires': 30
expires: 30
});
result = true;
}
catch (e) {}
catch (e)
{
// eslint-disable-line no-empty
}
return result;
}
@ -43,7 +49,7 @@ class CookieDriver
* @param {string} key
* @return {*}
*/
get(sKey) {
get(key) {
let result = null;
@ -56,10 +62,13 @@ class CookieDriver
result = (storageResult && !Utils.isUnd(storageResult[key])) ? storageResult[key] : null;
}
catch (e) {}
catch (e)
{
// eslint-disable-line no-empty
}
return mResult;
};
return result;
}
/**
* @return {boolean}

View file

@ -22,7 +22,10 @@ class LocalStorageDriver
const storageValue = window.localStorage[CLIENT_SIDE_STORAGE_INDEX_NAME] || null;
storageResult = null === storageValue ? null : JSON.parse(storageValue);
}
catch (e) {}
catch (e)
{
// eslint-disable-line no-empty
}
(storageResult || (storageResult = {}))[key] = data;
@ -31,7 +34,10 @@ class LocalStorageDriver
window.localStorage[CLIENT_SIDE_STORAGE_INDEX_NAME] = JSON.stringify(storageResult);
result = true;
}
catch (e) {}
catch (e)
{
// eslint-disable-line no-empty
}
return result;
}
@ -41,19 +47,22 @@ class LocalStorageDriver
* @return {*}
*/
get(key) {
let result = null;
try
{
const
const
storageValue = window.localStorage[CLIENT_SIDE_STORAGE_INDEX_NAME] || null,
storageResult = null === storageValue ? null : JSON.parse(storageValue)
;
result = (storageResult && !Utils.isUnd(storageResult[key])) ? storageResult[key] : null
result = (storageResult && !Utils.isUnd(storageResult[key])) ? storageResult[key] : null;
}
catch (e)
{
// eslint-disable-line no-empty
}
catch (e) {}
return result;
}

View file

@ -1,7 +1,9 @@
/* eslint max-len: 0 */
export const MESSAGES_PER_PAGE = 20;
export const MESSAGES_PER_PAGE_VALUES = [10, 20, 30, 50, 100/*, 150, 200, 300*/];
export const MESSAGES_PER_PAGE_VALUES = [10, 20, 30, 50, 100];
export const CONTACTS_PER_PAGE = 50;

View file

@ -1,4 +1,6 @@
/* eslint quote-props: 0 */
/**
* @enum {string}
*/
@ -18,7 +20,7 @@ export const FileType = {
'Certificate': 'certificate',
'CertificateBin': 'certificate-bin',
'Archive': 'archive'
}
};
/**
* @enum {string}
@ -28,7 +30,7 @@ export const StorageResultType = {
'Abort': 'abort',
'Error': 'error',
'Unload': 'unload'
}
};
/**
* @enum {string}
@ -38,7 +40,7 @@ export const Focused = {
'MessageList': 'message-list',
'MessageView': 'message-view',
'FolderList': 'folder-list'
}
};
/**
* @enum {number}
@ -47,7 +49,7 @@ export const State = {
'Empty': 10,
'Login': 20,
'Auth': 30
}
};
/**
* @enum {number}
@ -55,7 +57,7 @@ export const State = {
export const StateType = {
'Webmail': 0,
'Admin': 1
}
};
/**
* @enum {string}
@ -87,7 +89,7 @@ export const Capa = {
'AutoLogout': 'AUTOLOGOUT',
'AdditionalAccounts': 'ADDITIONAL_ACCOUNTS',
'Identities': 'IDENTITIES'
}
};
/**
* @enum {string}
@ -107,7 +109,7 @@ export const KeyState = {
'PopupViewOpenPGP': 'view-open-pgp',
'PopupKeyboardShortcutsHelp': 'popup-keyboard-shortcuts-help',
'PopupAsk': 'popup-ask'
}
};
/**
* @enum {number}
@ -121,7 +123,7 @@ export const FolderType = {
'Archive': 15,
'NotSpam': 80,
'User': 99
}
};
/**
* @enum {number}
@ -136,7 +138,7 @@ export const ServerFolderType = {
'IMPORTANT': 10,
'FLAGGED': 11,
'ALL': 12
}
};
/**
* @enum {string}
@ -145,7 +147,7 @@ export const LoginSignMeTypeAsString = {
'DefaultOff': 'defaultoff',
'DefaultOn': 'defaulton',
'Unused': 'unused'
}
};
/**
* @enum {number}
@ -154,7 +156,7 @@ export const LoginSignMeType = {
'DefaultOff': 0,
'DefaultOn': 1,
'Unused': 2
}
};
/**
* @enum {string}
@ -167,7 +169,7 @@ export const ComposeType = {
'ForwardAsAttachment': 'forward-as-attachment',
'Draft': 'draft',
'EditAsNew': 'editasnew'
}
};
/**
* @enum {number}
@ -181,7 +183,7 @@ export const UploadErrorCode = {
'FileOnSaveingError': 5,
'FileType': 98,
'Unknown': 99
}
};
/**
* @enum {number}
@ -193,7 +195,7 @@ export const SetSystemFoldersNotification = {
'Spam': 3,
'Trash': 4,
'Archive': 5
}
};
/**
* @enum {number}
@ -208,7 +210,7 @@ export const ClientSideKeyName = {
'LastReplyAction': 6,
'LastSignMe': 7,
'ComposeLastIdentityID': 8
}
};
/**
* @enum {number}
@ -231,7 +233,7 @@ export const EventKeyCode = {
'Delete': 46,
'A': 65,
'S': 83
}
};
/**
* @enum {number}
@ -241,7 +243,7 @@ export const MessageSetAction = {
'UnsetSeen': 1,
'SetFlag': 2,
'UnsetFlag': 3
}
};
/**
* @enum {number}
@ -254,7 +256,7 @@ export const MessageSelectAction = {
'Seen': 4,
'Flagged': 5,
'Unflagged': 6
}
};
/**
* @enum {number}
@ -264,7 +266,7 @@ export const DesktopNotification = {
'NotAllowed': 1,
'Denied': 2,
'NotSupported': 9
}
};
/**
* @enum {number}
@ -273,7 +275,7 @@ export const MessagePriority = {
'Low': 5,
'Normal': 3,
'High': 1
}
};
/**
* @enum {string}
@ -283,7 +285,7 @@ export const EditorDefaultType = {
'Plain': 'Plain',
'HtmlForced': 'HtmlForced',
'PlainForced': 'PlainForced'
}
};
/**
* @enum {number}
@ -292,7 +294,7 @@ export const ServerSecure = {
'None': 0,
'SSL': 1,
'TLS': 2
}
};
/**
* @enum {number}
@ -302,7 +304,7 @@ export const SearchDateType = {
'Days3': 3,
'Days7': 7,
'Month': 30
}
};
/**
* @enum {number}
@ -312,7 +314,7 @@ export const SaveSettingsStep = {
'Idle': -1,
'TrueResult': 1,
'FalseResult': 0
}
};
/**
* @enum {number}
@ -322,7 +324,7 @@ export const Layout = {
'SidePreview': 1,
'BottomPreview': 2,
'Mobile': 3
}
};
/**
* @enum {string}
@ -333,7 +335,7 @@ export const FilterConditionField = {
'Subject': 'Subject',
'Header': 'Header',
'Size': 'Size'
}
};
/**
* @enum {string}
@ -345,7 +347,7 @@ export const FilterConditionType = {
'NotEqualTo': 'NotEqualTo',
'Over': 'Over',
'Under': 'Under'
}
};
/**
* @enum {string}
@ -357,7 +359,7 @@ export const FiltersAction = {
'Vacation': 'Vacation',
'Reject': 'Reject',
'Forward': 'Forward'
}
};
/**
* @enum {string}
@ -365,7 +367,7 @@ export const FiltersAction = {
export const FilterRulesType = {
'All': 'All',
'Any': 'Any'
}
};
/**
* @enum {number}
@ -377,7 +379,7 @@ export const SignedVerifyStatus = {
'Error': -1,
'None': 0,
'Success': 1
}
};
/**
* @enum {number}
@ -409,7 +411,7 @@ export const ContactPropertyType = {
'Note': 110,
'Custom': 250
}
};
/**
* @enum {number}
@ -489,4 +491,4 @@ export const Notification = {
'UnknownNotification': 999,
'UnknownError': 999
}
};

View file

@ -1,5 +1,5 @@
import {window, _} from 'common';
import {window, _, $} from 'common';
import Globals from 'Common/Globals';
import Settings from 'Storage/Settings';
@ -9,7 +9,7 @@ class HtmlEditor
$element = null;
blurTimer = 0;
onBlur = null;
onReady = null;
onModeChange = null;
@ -70,9 +70,9 @@ class HtmlEditor
if (this.editor)
{
this.editor.execCommand('insertSignature', {
'isHtml': html,
'insertBefore': insertBefore,
'signature': signature
isHtml: html,
insertBefore: insertBefore,
signature: signature
});
}
}
@ -117,12 +117,11 @@ class HtmlEditor
}
else
{
result = wrapIsHtml ?
result = wrapIsHtml ?
'<div data-html-editor-font-wrapper="true" style="font-family: arial, sans-serif; font-size: 13px;">' +
this.editor.getData() + '</div>' : this.editor.getData();
}
}
catch (e) {}
} catch (e) {/* eslint-disable-line no-empty */}
if (clearSignatureSigns)
{
@ -160,7 +159,7 @@ class HtmlEditor
this.editor.setMode('plain');
}
}
} catch(e) {}
} catch (e) {/* eslint-disable-line no-empty */}
if (resize)
{
@ -189,7 +188,7 @@ class HtmlEditor
try {
this.editor.setData(html);
} catch (e) {}
} catch (e) {/* eslint-disable-line no-empty */}
if (focus)
{
@ -204,7 +203,7 @@ class HtmlEditor
try {
this.editor.setData(
this.editor.getData().replace(find, replaceHtml));
} catch (e) {}
} catch (e) {/* eslint-disable-line no-empty */}
}
}
@ -214,13 +213,13 @@ class HtmlEditor
this.modeToggle(false);
if ('plain' === this.editor.mode && this.editor.plugins.plain && this.editor.__plain)
{
return this.editor.__plain.setRawData(plain);
this.editor.__plain.setRawData(plain);
}
else
{
try {
this.editor.setData(plain);
} catch (e) {}
} catch (e) {/* eslint-disable-line no-empty */}
}
if (focus)
@ -254,7 +253,7 @@ class HtmlEditor
if (!biti)
{
config.removePlugins += (config.removePlugins ? ',' : '') + 'bidi';
config.removePlugins += (config.removePlugins ? ',' : '') + 'bidi';
}
}
@ -294,7 +293,7 @@ class HtmlEditor
if (window.FileReader)
{
this.editor.on('drop', (event) => {
this.editor.on('drop', (event) => {
if (0 < event.data.dataTransfer.getFilesCount())
{
const file = event.data.dataTransfer.getFile(0);
@ -304,7 +303,7 @@ class HtmlEditor
var
id = event.data.dataTransfer.id,
imageId = `[img=${id}]`,
reader = new window.FileReader()
reader = new window.FileReader()
;
reader.onloadend = () => {
@ -361,7 +360,7 @@ class HtmlEditor
{
try {
this.editor.focus();
} catch (e) {}
} catch (e) {/* eslint-disable-line no-empty */}
}
}
@ -370,7 +369,7 @@ class HtmlEditor
{
try {
return !!this.editor.focusManager.hasFocus;
} catch (e) {}
} catch (e) {/* eslint-disable-line no-empty */}
}
return false;
@ -381,7 +380,7 @@ class HtmlEditor
{
try {
this.editor.focusManager.blur(true);
} catch (e) {}
} catch (e) {/* eslint-disable-line no-empty */}
}
}
@ -390,7 +389,7 @@ class HtmlEditor
{
try {
this.editor.resize(this.$element.width(), this.$element.innerHeight());
} catch (e) {}
} catch (e) {/* eslint-disable-line no-empty */}
}
}
@ -399,7 +398,7 @@ class HtmlEditor
{
try {
this.editor.setReadOnly(!!value);
} catch (e) {}
} catch (e) {/* eslint-disable-line no-empty */}
}
}

View file

@ -314,7 +314,7 @@ class Links
* @return {string}
*/
sound(fileName) {
return this.sStaticPrefix + 'sounds/' + fileName;
return this.sStaticPrefix + 'sounds/' + fileName;
}
/**

View file

@ -1,6 +1,8 @@
/* eslint key-spacing: 0 */
/* eslint quote-props: 0 */
module.exports = {
'eml' : 'message/rfc822',
'mime' : 'message/rfc822',
'txt' : 'text/plain',
@ -159,5 +161,4 @@ module.exports = {
// open office
'odt' : 'application/vnd.oasis.opendocument.text',
'ods' : 'application/vnd.oasis.opendocument.spreadsheet'
};

View file

@ -53,11 +53,11 @@ class Momentor
return m.fromNow();
case now.format('L') === m.format('L'):
return Translator.i18n('MESSAGE_LIST/TODAY_AT', {
'TIME': m.format('LT')
TIME: m.format('LT')
});
case now.clone().subtract('days', 1).format('L') === m.format('L'):
return Translator.i18n('MESSAGE_LIST/YESTERDAY_AT', {
'TIME': m.format('LT')
TIME: m.format('LT')
});
case now.year() === m.year():
return m.format('D MMM.');

View file

@ -23,7 +23,7 @@ class Selector
this.listChecked = ko.computed(() => {
return _.filter(this.list(), (item) => item.checked());
}, this).extend({'rateLimit': 0});
}, this).extend({rateLimit: 0});
this.isListChecked = ko.computed(() => 0 < this.listChecked().length);
@ -77,7 +77,7 @@ class Selector
}, this);
this.selectedItem = this.selectedItem.extend({'toggleSubscribe': [null,
this.selectedItem = this.selectedItem.extend({toggleSubscribe: [null,
(prev) => {
if (prev)
{
@ -91,7 +91,7 @@ class Selector
}
]});
this.focusedItem = this.focusedItem.extend({'toggleSubscribe': [null,
this.focusedItem = this.focusedItem.extend({toggleSubscribe: [null,
(prev) => {
if (prev)
{
@ -291,14 +291,14 @@ class Selector
{
if (!item)
{
(this.oCallbacks['onItemSelect'] || this.emptyFunction)(item || null);
(this.oCallbacks.onItemSelect || this.emptyFunction)(item || null);
}
}
else
{
if (item)
{
(this.oCallbacks['onItemSelect'] || this.emptyFunction)(item);
(this.oCallbacks.onItemSelect || this.emptyFunction)(item);
}
}
}
@ -416,14 +416,14 @@ class Selector
* @return {boolean}
*/
autoSelect() {
return !!(this.oCallbacks['onAutoSelect'] || this.emptyTrueFunction)();
return !!(this.oCallbacks.onAutoSelect || this.emptyTrueFunction)();
}
/**
* @param {boolean} up
*/
doUpUpOrDownDown(up) {
(this.oCallbacks['onUpUpOrDownDown'] || this.emptyTrueFunction)(!!up);
(this.oCallbacks.onUpUpOrDownDown || this.emptyTrueFunction)(!!up);
}
/**
@ -434,7 +434,7 @@ class Selector
let uid = '';
const getItemUidCallback = this.oCallbacks['onItemGetUid'] || null;
const getItemUidCallback = this.oCallbacks.onItemGetUid || null;
if (getItemUidCallback && item)
{
uid = getItemUidCallback(item);
@ -465,18 +465,22 @@ class Selector
{
if (!oFocused)
{
if (EventKeyCode.Down === iEventKeyCode || EventKeyCode.Insert === iEventKeyCode || EventKeyCode.Space === iEventKeyCode || EventKeyCode.Home === iEventKeyCode || EventKeyCode.PageUp === iEventKeyCode)
if (EventKeyCode.Down === iEventKeyCode || EventKeyCode.Insert === iEventKeyCode ||
EventKeyCode.Space === iEventKeyCode || EventKeyCode.Home === iEventKeyCode ||
EventKeyCode.PageUp === iEventKeyCode)
{
oResult = aList[0];
}
else if (EventKeyCode.Up === iEventKeyCode || EventKeyCode.End === iEventKeyCode || EventKeyCode.PageDown === iEventKeyCode)
else if (EventKeyCode.Up === iEventKeyCode || EventKeyCode.End === iEventKeyCode ||
EventKeyCode.PageDown === iEventKeyCode)
{
oResult = aList[aList.length - 1];
}
}
else if (oFocused)
{
if (EventKeyCode.Down === iEventKeyCode || EventKeyCode.Up === iEventKeyCode || EventKeyCode.Insert === iEventKeyCode || EventKeyCode.Space === iEventKeyCode)
if (EventKeyCode.Down === iEventKeyCode || EventKeyCode.Up === iEventKeyCode ||
EventKeyCode.Insert === iEventKeyCode || EventKeyCode.Space === iEventKeyCode)
{
_.each(aList, (item) => {
if (!bStop)
@ -649,7 +653,7 @@ class Selector
}
else
{
this.oContentScrollable.stop().animate({'scrollTop': 0}, 200);
this.oContentScrollable.stop().animate({scrollTop: 0}, 200);
}
return true;

View file

@ -11,7 +11,7 @@ class Translator
notificationI18N = {};
constructor() {
this.data = window['rainloopI18N'] || {};
this.data = window.rainloopI18N || {};
this.trigger = ko.observable(false);
this.i18n = _.bind(this.i18n, this);
this.init();
@ -27,9 +27,14 @@ class Translator
let
valueName = '',
result = _.isUndefined(this.data[key]) ? (_.isUndefined(defaulValue) ? key : defaulValue) : this.data[key]
result = this.data[key]
;
if (_.isUndefined(result))
{
result = _.isUndefined(defaulValue) ? key : defaulValue;
}
if (!_.isUndefined(valueList) && !_.isNull(valueList))
{
for (valueName in valueList)
@ -92,16 +97,21 @@ class Translator
if (animate && Globals.bAnimationSupported)
{
$('.i18n-animation[data-i18n]', elements).letterfx({
'fx': 'fall fade', 'backwards': false, 'timing': 50, 'fx_duration': '50ms', 'letter_end': 'restore', 'element_end': 'restore'
fx: 'fall fade',
backwards: false,
timing: 50,
fx_duration: '50ms',
letter_end: 'restore',
element_end: 'restore'
});
}
});
}
reloadData() {
if (window['rainloopI18N'])
if (window.rainloopI18N)
{
this.data = window['rainloopI18N'] || {};
this.data = window.rainloopI18N || {};
this.i18nToNodes(window.document, true);
@ -109,7 +119,7 @@ class Translator
this.trigger(!this.trigger());
}
window['rainloopI18N'] = null;
window.rainloopI18N = null;
}
initNotificationLanguage() {
@ -299,9 +309,9 @@ class Translator
Globals.$html.addClass('rl-changing-language');
$.ajax({
'url': require('Common/Links').langLink(language, admin),
'dataType': 'script',
'cache': true
url: require('Common/Links').langLink(language, admin),
dataType: 'script',
cache: true
})
.fail(fail || Utils.emptyFunction)
.done(function () {

View file

@ -30,6 +30,21 @@
Utils.isNull = _.isNull;
Utils.emptyFunction = Utils.noop = function () {};
/**
* @param {Function} callback
*/
Utils.silentTryCatch = function (callback)
{
try
{
callback();
}
catch (e)
{
// eslint-disable-line no-empty
}
};
/**
* @param {*} oValue
* @return {boolean}
@ -576,16 +591,17 @@
Utils.createCommand = function (oContext, fExecute, fCanExecute)
{
var
fResult = Utils.emptyFunction,
fNonEmpty = function () {
if (fResult && fResult.canExecute && fResult.canExecute())
{
fExecute.apply(oContext, Array.prototype.slice.call(arguments));
}
return false;
},
fResult = fExecute ? fNonEmpty : Utils.emptyFunction
}
;
fResult = fExecute ? fNonEmpty : Utils.emptyFunction;
fResult.enabled = ko.observable(true);
fCanExecute = Utils.isUnd(fCanExecute) ? true : fCanExecute;

View file

@ -27,7 +27,7 @@ class AbstracRadio extends AbstractComponent
if (params.values)
{
this.values(_.map(params.values, (label, value) => {
return {'label': label, 'value': value};
return {label: label, value: value};
}));
}
@ -39,7 +39,7 @@ class AbstracRadio extends AbstractComponent
{
this.value(value.value);
}
};
}
}
export {AbstracRadio, AbstracRadio as default};

View file

@ -50,6 +50,6 @@ const componentExportHelper = (ClassObject, templateID = '') => {
}
}
};
}
};
export {AbstractComponent, componentExportHelper};

View file

@ -35,7 +35,7 @@ class AbstractInput extends AbstractComponent
' ' + Utils.trim('settings-saved-trigger-input ' + this.classForTrigger()) : ''
;
return (0 < size ? 'span' + size : '') + suffixValue;
return (size > 0 ? 'span' + size : '') + suffixValue;
}, this);

View file

@ -10,11 +10,11 @@ class CheckboxMaterialDesignComponent extends AbstracCheckbox
* @param {Object} params
*/
constructor(params) {
super(params);
this.animationBox = ko.observable(false).extend({'falseTimeout': 200});
this.animationCheckmark = ko.observable(false).extend({'falseTimeout': 200});
this.animationBox = ko.observable(false).extend({falseTimeout: 200});
this.animationCheckmark = ko.observable(false).extend({falseTimeout: 200});
this.animationBoxSetTrue = _.bind(this.animationBoxSetTrue, this);
this.animationCheckmarkSetTrue = _.bind(this.animationCheckmarkSetTrue, this);

View file

@ -73,7 +73,7 @@ class SaveTriggerComponent extends AbstractComponent
;
break;
}
};
}
}
module.exports = componentExportHelper(SaveTriggerComponent, 'SaveTriggerComponent');

View file

@ -6,7 +6,7 @@ let
getUtl = () => {
if (!cachedUrl)
{
const version = $('#rlAppVersion').attr('content') || '0.0.0'; // TODO
const version = $('#rlAppVersion').attr('content') || '0.0.0';
cachedUrl = `rainloop/v/${version}/static/css/svg/icons.svg`;
}

View file

@ -1,7 +1,9 @@
class AbstractBoot
{
bootstart(Remote) {}
bootstart() {
// eslint-disable-line no-empty
}
}
export {AbstractBoot, AbstractBoot as default};

View file

@ -86,17 +86,17 @@
this.user = this.users[index];
this.email = this.emails[index];
}
}
};
OpenPgpKeyModel.prototype.selectUser = function (sUser)
{
this.select(sUser, 'users');
}
};
OpenPgpKeyModel.prototype.selectEmail = function (sEmail)
{
this.select(sEmail, 'emails');
}
};
module.exports = OpenPgpKeyModel;

View file

@ -5,8 +5,8 @@ import Utils from 'Common/Utils';
class SettingsStorage
{
constructor() {
this.settings = window['rainloopAppData'] || {};
this.settings = Utils.isNormal(this.settings) ? this.settings : {};
this.settings = window.rainloopAppData || {};
this.settings = Utils.isNormal(this.settings) ? this.settings : {};
}
/**
@ -32,7 +32,7 @@ class SettingsStorage
capa(name) {
const values = this.settingsGet('Capa');
return Utils.isArray(values) && Utils.isNormal(name) && -1 < Utils.inArray(name, values);
};
}
}
module.exports = new SettingsStorage();

View file

@ -26,7 +26,7 @@ class AppAdminStore extends AbstractAppStore
this.weakPassword(!!Settings.settingsGet('WeakPassword'));
this.useLocalProxyForExternalImages(!!Settings.settingsGet('UseLocalProxyForExternalImages'));
};
}
}
module.exports = new AppAdminStore();

View file

@ -21,6 +21,8 @@ class AppUserStore extends AbstractAppStore
switch (value)
{
default:
break;
case Focused.MessageList:
Globals.keyScope(KeyState.MessageList);
break;
@ -66,7 +68,7 @@ class AppUserStore extends AbstractAppStore
this.devEmail = Settings.settingsGet('DevEmail');
this.devPassword = Settings.settingsGet('DevPassword');
};
}
}
module.exports = new AppUserStore();

View file

@ -7,12 +7,12 @@ class IdentityUserStore
constructor()
{
this.identities = ko.observableArray([]);
this.identities.loading = ko.observable(false).extend({'throttle': 100});
this.identities.loading = ko.observable(false).extend({throttle: 100});
this.identitiesIDS = ko.computed(() => {
return _.compact(_.map(this.identities(), (item) => item ? item.id : null));
}, this);
}
}
module.exports = new IdentityUserStore();

View file

@ -8,9 +8,11 @@
font-size: 16px;
vertical-align: text-top;
&.disabled,
.disabled & {
.btn.disabled &, .btn[disabled] &{
color: grey;
&.icon-white {
color: #fff;
}
}
}

View file

@ -31,14 +31,6 @@
var self = this;
this.optionsCaption = Translator.i18n('PGP_NOTIFICATIONS/ADD_A_PUBLICK_KEY');
this.addOptionClass = function (oDomOption, oItem)
{
self.defautOptionsAfterRender(oDomOption, oItem);
if (oItem) {
oDomOption.classList.add(oItem['class']);
}
};
this.notification = ko.observable('');
@ -276,6 +268,16 @@
kn.extendAsViewModel(['View/Popup/ComposeOpenPgp', 'PopupsComposeOpenPgpViewModel'], ComposeOpenPgpPopupView);
_.extend(ComposeOpenPgpPopupView.prototype, AbstractView.prototype);
ComposeOpenPgpPopupView.prototype.addOptionClass = function (oDomOption, oItem)
{
this.defautOptionsAfterRender(oDomOption, oItem);
if (oItem)
{
oDomOption.classList.add(oItem['class']);
}
};
ComposeOpenPgpPopupView.prototype.deletePublickKey = function (oKey)
{
this.encryptKeys.remove(oKey);
@ -397,7 +399,7 @@
return {
'empty': !oKey,
'selected': ko.observable(!!oKey),
'removable': oIdentity && oIdentity.email() && oIdentity.email() !== sEmail,
'removable': oIdentity && oIdentity.email() && oIdentity.email() !== sEmail,
'users': oKey ? (oKey.users || [sEmail]) : [sEmail],
'hash': oKey ? oKey.id.substr(-8).toUpperCase() : '',
'key': oKey

View file

@ -32,6 +32,7 @@ export default (App) => {
;
// export
/* eslint dot-notation: 0 */
window['rl'] = window['rl'] || {};
window['rl']['i18n'] = _.bind(Translator.i18n, Translator);
@ -82,4 +83,4 @@ export default (App) => {
}, 10));
};
}
};

View file

@ -440,7 +440,7 @@ gulp.task('js:chunks', ['js:webpack'], function() {
});
// - min
gulp.task('js:min', ['js:app', 'js:admin', 'js:chunks'], function() {
gulp.task('js:min', ['js:app', 'js:admin', 'js:chunks', 'js:validate'], function() {
return gulp.src(cfg.paths.staticJS + '*.js')
.pipe(replace(/"rainloop\/v\/([^\/]+)\/static\/js\/"/g, '"rainloop/v/$1/static/js/min/"'))
.pipe(uglify(cfg.uglify))
@ -478,17 +478,14 @@ gulp.task('js:eslint', function() {
var eslint = require('gulp-eslint');
return gulp.src(cfg.paths.globjsxonly)
.pipe(eslint({
parser: 'babel-eslint',
rules: {
'strict': 0
}
}))
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError())
;
});
gulp.task('js:validate', ['js:lint', 'js:eslint']);
// OTHER
regOtherMinTask('other:cookie', 'vendors/jquery-cookie/', 'jquery.cookie.js', 'jquery.cookie-1.4.0.min.js',
'/*! jquery.cookie v1.4.0 (c) 2013 Klaus Hartl | MIT */\n');
@ -743,6 +740,8 @@ gulp.task('watch+', ['fast+'], function() {
gulp.task('build', ['rainloop']);
gulp.task('build+', ['rainloop+']);
gulp.task('js:v', ['js:validate']);
gulp.task('w', ['watch']);
gulp.task('w+', ['watch+']);
gulp.task('f', ['fast']);

View file

@ -2,7 +2,7 @@
"name": "RainLoop",
"title": "RainLoop Webmail",
"version": "1.9.4",
"release": "402",
"release": "415",
"description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net",
"main": "gulpfile.js",
@ -40,7 +40,7 @@
"plugins"
],
"readmeFilename": "README.md",
"ownCloudPackageVersion": "4.12",
"ownCloudPackageVersion": "4.14",
"engines": {
"node": ">= 0.10.0"
},