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

320
.eslintrc
View file

@ -1,156 +1,168 @@
{
"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
}
"ecmaFeatures": {
"modules": true
},
"env": {
"node": true,
"commonjs": true,
"es6": true,
"browser": true
},
"globals": {
"RL_COMMUNITY" : true,
"ko" : true,
"ssm" : true,
"moment" : true,
"ifvisible" : true,
"crossroads" : true,
"hasher" : true,
"key" : true,
"Jua" : true,
"_" : true,
"$" : true,
"Dropbox" : 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": 0,
"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,
"max-depth": 0,
"max-len": [2, 200],
"max-params": 0,
"max-statements": 0,
"no-plusplus": 0
}
}

View file

@ -1,69 +0,0 @@
{
"curly" : true,
"eqeqeq" : true,
"forin" : true,
"immed" : true,
"latedef" : true,
"newcap" : true,
"noarg" : true,
"noempty" : true,
"nonew" : true,
"regexp" : true,
"undef" : true,
"strict" : true,
"unused" : true,
"asi" : false,
"boss" : false,
"debug" : false,
"eqnull" : false,
"es5" : false,
"esnext" : false,
"evil" : false,
"expr" : false,
"funcscope" : false,
"globalstrict" : false,
"iterator" : false,
"lastsemic" : false,
"laxbreak" : false,
"laxcomma" : false,
"loopfunc" : false,
"multistr" : false,
"onecase" : false,
"proto" : false,
"regexdash" : false,
"scripturl" : false,
"smarttabs" : false,
"shadow" : false,
"supernew" : false,
"validthis" : false,
"passfail" : false,
"nomen" : false,
"white" : false,
"sub" : true,
"onevar" : true,
"bitwise" : false,
"plusplus" : false,
"trailing" : false,
"devel" : false,
"browser" : true,
"jquery" : true,
"globals": {
"RL_COMMUNITY" : true,
"module" : true,
"require" : true,
"ko" : true,
"ko" : true,
"ssm" : true,
"moment" : true,
"ifvisible" : true,
"crossroads" : true,
"hasher" : true,
"key" : true,
"Jua" : true,
"_" : true,
"Dropbox" : true
}
}

View file

@ -18,11 +18,6 @@ import {AbstractBoot} from 'Knoin/AbstractBoot';
class AbstractApp extends AbstractBoot
{
googlePreviewSupportedCache = null;
isLocalAutocomplete = true;
iframe = null;
lastErrorTime = 0;
/**
* @param {RemoteStorage|AdminRemoteStorage} Remote
*/
@ -30,6 +25,11 @@ class AbstractApp extends AbstractBoot
{
super();
this.googlePreviewSupportedCache = null;
this.isLocalAutocomplete = true;
this.iframe = null;
this.lastErrorTime = 0;
this.iframe = $('<iframe class="internal-hiddden" />').appendTo('body');
$win.on('error', (event) => {

View file

@ -56,12 +56,12 @@ import {AbstractApp} from 'App/Abstract';
class AppUser extends AbstractApp
{
oMoveCache = {};
constructor()
{
super(Remote);
this.moveCache = {};
this.quotaDebounce = _.debounce(this.quota, 1000 * 30);
this.moveOrDeleteResponseHelper = _.bind(this.moveOrDeleteResponseHelper, this);
@ -235,7 +235,7 @@ class AppUser extends AbstractApp
sSpamFolder = FolderStore.spamFolder()
;
_.each(this.oMoveCache, (oItem) => {
_.each(this.moveCache, (oItem) => {
var
bSpam = sSpamFolder === oItem.To,
@ -247,22 +247,22 @@ class AppUser extends AbstractApp
bSpam ? 'SPAM' : (bHam ? 'HAM' : ''), bSpam || bTrash);
});
this.oMoveCache = {};
this.moveCache = {};
}
messagesMoveHelper(sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForMove) {
var sH = '$$' + sFromFolderFullNameRaw + '$$' + sToFolderFullNameRaw + '$$';
if (!this.oMoveCache[sH])
if (!this.moveCache[sH])
{
this.oMoveCache[sH] = {
this.moveCache[sH] = {
From: sFromFolderFullNameRaw,
To: sToFolderFullNameRaw,
Uid: []
};
}
this.oMoveCache[sH].Uid = _.union(this.oMoveCache[sH].Uid, aUidForMove);
this.moveCache[sH].Uid = _.union(this.moveCache[sH].Uid, aUidForMove);
this.messagesMoveTrigger();
}

View file

@ -7,17 +7,15 @@ import {trim} from 'Common/Utils';
class Audio
{
player = null;
notificator = null;
supported = false;
supportedMp3 = false;
supportedOgg = false;
supportedWav = false;
supportedNotification = false;
constructor()
{
this.notificator = null;
this.supportedMp3 = false;
this.supportedOgg = false;
this.supportedWav = false;
this.supportedNotification = false;
this.player = this.createNewObject();
this.supported = !bMobileDevice && !bSafari && !!this.player && !!this.player.play;

View file

@ -5,17 +5,6 @@ import * as Settings from 'Storage/Settings';
class HtmlEditor
{
editor = null;
$element = null;
blurTimer = 0;
onBlur = null;
onReady = null;
onModeChange = null;
__inited = null;
/**
* @param {Object} element
* @param {Function=} onBlur
@ -24,6 +13,9 @@ class HtmlEditor
*/
constructor(element, onBlur = null, onReady = null, onModeChange = null)
{
this.editor = null;
this.blurTimer = 0;
this.onBlur = onBlur;
this.onReady = onReady;
this.onModeChange = onModeChange;

View file

@ -708,7 +708,7 @@ class Selector
* @param {Object} item
* @param {Object=} event
*/
actionClick = function (item, event = null) {
actionClick(item, event = null) {
if (item)
{
@ -761,4 +761,3 @@ class Selector
}
export {Selector, Selector as default};
module.exports = Selector;

View file

@ -5,9 +5,9 @@ import ko from 'ko';
class AbstractComponent
{
disposable = [];
constructor() {}
constructor() {
this.disposable = [];
}
dispose() {
this.disposable.forEach((funcToDispose) => {

144
dev/External/ko.js vendored
View file

@ -22,14 +22,14 @@
;
ko.bindingHandlers.updateWidth = {
'init': function (oElement, fValueAccessor) {
init: function (oElement, fValueAccessor) {
var
$w = $(window),
$oEl = $(oElement),
fValue = fValueAccessor(),
fInit = function(){
fInit = function() {
fValue($oEl.width());
window.setTimeout(function(){
window.setTimeout(function() {
fValue($oEl.width());
}, 500);
}
@ -45,10 +45,10 @@
};
ko.bindingHandlers.editor = {
'init': function (oElement, fValueAccessor) {
init: function (oElement, fValueAccessor) {
var
oEditor = null,
oEditor = null,
fValue = fValueAccessor(),
fUpdateEditorValue = function () {
@ -88,16 +88,16 @@
};
ko.bindingHandlers.json = {
'init': function (oElement, fValueAccessor) {
init: function (oElement, fValueAccessor) {
$(oElement).text(JSON.stringify(ko.unwrap(fValueAccessor())));
},
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
$(oElement).text(JSON.stringify(ko.unwrap(fValueAccessor())));
}
};
ko.bindingHandlers.scrollerShadows = {
'init': function (oElement) {
init: function (oElement) {
var
iLimit = 8,
@ -126,7 +126,7 @@
};
ko.bindingHandlers.pikaday = {
'init': function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
init: function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
ko.bindingHandlers.textInput.init.apply(oViewModel, Array.prototype.slice.call(arguments));
@ -140,7 +140,7 @@
};
ko.bindingHandlers.tooltip = {
'init': function (oElement, fValueAccessor) {
init: function (oElement, fValueAccessor) {
var
bi18n = true,
@ -203,7 +203,7 @@
}
}
},
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
var
bi18n = true,
@ -236,7 +236,7 @@
};
ko.bindingHandlers.tooltipErrorTip = {
'init': function (oElement) {
init: function (oElement) {
var $oEl = $(oElement);
@ -258,7 +258,7 @@
fDisposalTooltipHelper(oElement);
},
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
var
$oEl = $(oElement),
@ -297,7 +297,7 @@
};
ko.bindingHandlers.registrateBootstrapDropdown = {
'init': function (oElement) {
init: function (oElement) {
var Globals = require('Common/Globals');
if (Globals && Globals.data.aBootstrapDropdowns)
{
@ -314,7 +314,7 @@
};
ko.bindingHandlers.openDropdownTrigger = {
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
if (ko.unwrap(fValueAccessor()))
{
var $oEl = $(oElement);
@ -332,7 +332,7 @@
};
ko.bindingHandlers.dropdownCloser = {
'init': function (oElement) {
init: function (oElement) {
$(oElement).closest('.dropdown').on('click', '.e-item', function () {
$(oElement).dropdown('toggle');
});
@ -340,7 +340,7 @@
};
ko.bindingHandlers.popover = {
'init': function (oElement, fValueAccessor) {
init: function (oElement, fValueAccessor) {
$(oElement).popover(ko.unwrap(fValueAccessor()));
ko.utils.domNodeDisposal.addDisposeCallback(oElement, function () {
@ -350,8 +350,8 @@
};
ko.bindingHandlers.csstext = {
'init': function (oElement, fValueAccessor) {
if (oElement && oElement.styleSheet && undefined !== oElement.styleSheet.cssText)
init: function (oElement, fValueAccessor) {
if (oElement && oElement.styleSheet && (typeof oElement.styleSheet.cssText !== 'undefined'))
{
oElement.styleSheet.cssText = ko.unwrap(fValueAccessor());
}
@ -360,8 +360,8 @@
$(oElement).text(ko.unwrap(fValueAccessor()));
}
},
'update': function (oElement, fValueAccessor) {
if (oElement && oElement.styleSheet && undefined !== oElement.styleSheet.cssText)
update: function (oElement, fValueAccessor) {
if (oElement && oElement.styleSheet && (typeof oElement.styleSheet.cssText !== 'undefined'))
{
oElement.styleSheet.cssText = ko.unwrap(fValueAccessor());
}
@ -373,7 +373,7 @@
};
ko.bindingHandlers.resizecrop = {
'init': function (oElement) {
init: function (oElement) {
$(oElement).addClass('resizecrop').resizecrop({
'width': '100',
'height': '100',
@ -382,7 +382,7 @@
}
});
},
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
fValueAccessor()();
$(oElement).resizecrop({
'width': '100',
@ -392,7 +392,7 @@
};
ko.bindingHandlers.onEnter = {
'init': function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
init: function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
$(oElement).on('keypress.koOnEnter', function (oEvent) {
if (oEvent && 13 === window.parseInt(oEvent.keyCode, 10))
{
@ -408,7 +408,7 @@
};
ko.bindingHandlers.onSpace = {
'init': function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
init: function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
$(oElement).on('keyup.koOnSpace', function (oEvent) {
if (oEvent && 32 === window.parseInt(oEvent.keyCode, 10))
{
@ -423,7 +423,7 @@
};
ko.bindingHandlers.onTab = {
'init': function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
init: function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
$(oElement).on('keydown.koOnTab', function (oEvent) {
if (oEvent && 9 === window.parseInt(oEvent.keyCode, 10))
{
@ -438,7 +438,7 @@
};
ko.bindingHandlers.onEsc = {
'init': function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
init: function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
$(oElement).on('keypress.koOnEsc', function (oEvent) {
if (oEvent && 27 === window.parseInt(oEvent.keyCode, 10))
{
@ -454,7 +454,7 @@
};
ko.bindingHandlers.clickOnTrue = {
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
if (ko.unwrap(fValueAccessor()))
{
$(oElement).click();
@ -463,7 +463,7 @@
};
ko.bindingHandlers.modal = {
'init': function (oElement, fValueAccessor) {
init: function (oElement, fValueAccessor) {
var
Globals = require('Common/Globals'),
@ -487,11 +487,11 @@
;
});
},
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
var Globals = require('Common/Globals');
$(oElement).modal(!!ko.unwrap(fValueAccessor()) ? 'show' : 'hide');
$(oElement).modal(ko.unwrap(fValueAccessor()) ? 'show' : 'hide');
if (Globals.$html.hasClass('rl-anim'))
{
@ -505,12 +505,12 @@
};
ko.bindingHandlers.moment = {
'init': function (oElement, fValueAccessor) {
init: function (oElement, fValueAccessor) {
require('Common/Momentor').momentToNode(
$(oElement).addClass('moment').data('moment-time', ko.unwrap(fValueAccessor()))
);
},
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
require('Common/Momentor').momentToNode(
$(oElement).data('moment-time', ko.unwrap(fValueAccessor()))
);
@ -518,50 +518,50 @@
};
ko.bindingHandlers.i18nInit = {
'init': function (oElement) {
init: function (oElement) {
require('Common/Translator').i18nToNodes(oElement);
}
};
ko.bindingHandlers.translatorInit = {
'init': function (oElement) {
init: function (oElement) {
require('Common/Translator').i18nToNodes(oElement);
}
};
ko.bindingHandlers.i18nUpdate = {
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
ko.unwrap(fValueAccessor());
require('Common/Translator').i18nToNodes(oElement);
}
};
ko.bindingHandlers.link = {
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
$(oElement).attr('href', ko.unwrap(fValueAccessor()));
}
};
ko.bindingHandlers.title = {
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
$(oElement).attr('title', ko.unwrap(fValueAccessor()));
}
};
ko.bindingHandlers.textF = {
'init': function (oElement, fValueAccessor) {
init: function (oElement, fValueAccessor) {
$(oElement).text(ko.unwrap(fValueAccessor()));
}
};
ko.bindingHandlers.initDom = {
'init': function (oElement, fValueAccessor) {
init: function (oElement, fValueAccessor) {
fValueAccessor()(oElement);
}
};
ko.bindingHandlers.initFixedTrigger = {
'init': function (oElement, fValueAccessor) {
init: function (oElement, fValueAccessor) {
var
aValues = ko.unwrap(fValueAccessor()),
$oContainer = null,
@ -588,14 +588,14 @@
};
ko.bindingHandlers.initResizeTrigger = {
'init': function (oElement, fValueAccessor) {
init: function (oElement, fValueAccessor) {
var aValues = ko.unwrap(fValueAccessor());
$(oElement).css({
'height': aValues[1],
'min-height': aValues[1]
});
},
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
var
Utils = require('Common/Utils'),
@ -625,13 +625,13 @@
};
ko.bindingHandlers.appendDom = {
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
$(oElement).hide().empty().append(ko.unwrap(fValueAccessor())).show();
}
};
ko.bindingHandlers.draggable = {
'init': function (oElement, fValueAccessor, fAllBindingsAccessor) {
init: function (oElement, fValueAccessor, fAllBindingsAccessor) {
var
Globals = require('Common/Globals'),
@ -644,19 +644,19 @@
iTriggerZone = 100,
iScrollSpeed = 3,
fAllValueFunc = fAllBindingsAccessor(),
sDroppableSelector = fAllValueFunc && fAllValueFunc['droppableSelector'] ? fAllValueFunc['droppableSelector'] : '',
sDroppableSelector = fAllValueFunc && fAllValueFunc.droppableSelector ? fAllValueFunc.droppableSelector : '',
oConf = {
'distance': 20,
'handle': '.dragHandle',
'cursorAt': {'top': 22, 'left': 3},
'refreshPositions': true,
'scroll': true
distance: 20,
handle: '.dragHandle',
cursorAt: {top: 22, left: 3},
refreshPositions: true,
scroll: true
}
;
if (sDroppableSelector)
{
oConf['drag'] = function (oEvent) {
oConf.drag = function (oEvent) {
$(sDroppableSelector).each(function () {
var
@ -697,7 +697,7 @@
});
};
oConf['stop'] = function() {
oConf.stop = function() {
$(sDroppableSelector).each(function () {
window.clearInterval($(this).data('timerScroll'));
$(this).data('timerScroll', false);
@ -705,7 +705,7 @@
};
}
oConf['helper'] = function (oEvent) {
oConf.helper = function (oEvent) {
return fValueAccessor()(oEvent && oEvent.target ? ko.dataFor(oEvent.target) : null);
};
@ -724,37 +724,37 @@
};
ko.bindingHandlers.droppable = {
'init': function (oElement, fValueAccessor, fAllBindingsAccessor) {
init: function (oElement, fValueAccessor, fAllBindingsAccessor) {
var Globals = require('Common/Globals');
if (!Globals.bMobileDevice)
{
var
fValueFunc = fValueAccessor(),
fAllValueFunc = fAllBindingsAccessor(),
fOverCallback = fAllValueFunc && fAllValueFunc['droppableOver'] ? fAllValueFunc['droppableOver'] : null,
fOutCallback = fAllValueFunc && fAllValueFunc['droppableOut'] ? fAllValueFunc['droppableOut'] : null,
fOverCallback = fAllValueFunc && fAllValueFunc.droppableOver ? fAllValueFunc.droppableOver : null,
fOutCallback = fAllValueFunc && fAllValueFunc.droppableOut ? fAllValueFunc.droppableOut : null,
oConf = {
'tolerance': 'pointer',
'hoverClass': 'droppableHover'
tolerance: 'pointer',
hoverClass: 'droppableHover'
}
;
if (fValueFunc)
{
oConf['drop'] = function (oEvent, oUi) {
oConf.drop = function (oEvent, oUi) {
fValueFunc(oEvent, oUi);
};
if (fOverCallback)
{
oConf['over'] = function (oEvent, oUi) {
oConf.over = function (oEvent, oUi) {
fOverCallback(oEvent, oUi);
};
}
if (fOutCallback)
{
oConf['out'] = function (oEvent, oUi) {
oConf.out = function (oEvent, oUi) {
fOutCallback(oEvent, oUi);
};
}
@ -770,7 +770,7 @@
};
ko.bindingHandlers.nano = {
'init': function (oElement) {
init: function (oElement) {
var
Globals = require('Common/Globals'),
@ -791,7 +791,7 @@
};
ko.bindingHandlers.saveTrigger = {
'init': function (oElement) {
init: function (oElement) {
var $oEl = $(oElement);
@ -808,7 +808,7 @@
$oEl.addClass('settings-saved-trigger-input');
}
},
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
var
mValue = ko.unwrap(fValueAccessor()),
$oEl = $(oElement)
@ -870,7 +870,7 @@
};
ko.bindingHandlers.emailsTags = {
'init': function(oElement, fValueAccessor, fAllBindingsAccessor) {
init: function(oElement, fValueAccessor, fAllBindingsAccessor) {
var
Utils = require('Common/Utils'),
@ -879,7 +879,7 @@
$oEl = $(oElement),
fValue = fValueAccessor(),
fAllBindings = fAllBindingsAccessor(),
fAutoCompleteSource = fAllBindings['autoCompleteSource'] || null,
fAutoCompleteSource = fAllBindings.autoCompleteSource || null,
fFocusCallback = function (bValue) {
if (fValue && fValue.focused)
{
@ -892,7 +892,7 @@
'parseOnBlur': true,
'allowDragAndDrop': true,
'focusCallback': fFocusCallback,
'inputDelimiters': [',', ';', "\n"],
'inputDelimiters': [',', ';', '\n'],
'autoCompleteSource': fAutoCompleteSource,
// 'elementHook': function (oEl, oItem) {
// if (oEl && oItem)
@ -977,11 +977,11 @@
if (fValue && fValue.focused && fValue.focused.subscribe)
{
fValue.focused.subscribe(function (bValue) {
$oEl.inputosaurus(!!bValue ? 'focus' : 'blur');
$oEl.inputosaurus(bValue ? 'focus' : 'blur');
});
}
},
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
var
$oEl = $(oElement),
@ -999,7 +999,7 @@
};
ko.bindingHandlers.command = {
'init': function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
init: function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
var
jqElement = $(oElement),
oCommand = fValueAccessor()
@ -1015,7 +1015,7 @@
.init.apply(oViewModel, Array.prototype.slice.call(arguments));
},
'update': function (oElement, fValueAccessor) {
update: function (oElement, fValueAccessor) {
var
bResult = true,

View file

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

View file

@ -46,4 +46,3 @@
module.exports = AbstractModel;
}());

View file

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

View file

@ -127,4 +127,4 @@
module.exports = AbstractView;
}());
}());

View file

@ -36,13 +36,13 @@
};
/**
* @param {Object} thisObject
* @param {Object} context
*/
Knoin.prototype.constructorEnd = function (thisObject)
Knoin.prototype.constructorEnd = function (context)
{
if (Utils.isFunc(thisObject['__constructor_end']))
if (Utils.isFunc(context.__constructor_end))
{
thisObject['__constructor_end'].call(thisObject);
context.__constructor_end.call(context);
}
};
@ -77,13 +77,13 @@
Knoin.prototype.addSettingsViewModel = function (SettingsViewModelClass, sTemplate, sLabelName, sRoute, bDefault)
{
SettingsViewModelClass.__rlSettingsData = {
'Label': sLabelName,
'Template': sTemplate,
'Route': sRoute,
'IsDefault': !!bDefault
Label: sLabelName,
Template: sTemplate,
Route: sRoute,
IsDefault: !!bDefault
};
Globals.aViewModels['settings'].push(SettingsViewModelClass);
Globals.aViewModels.settings.push(SettingsViewModelClass);
};
/**
@ -287,7 +287,7 @@
var
self = this,
oScreen = null,
bSameScreen= false,
bSameScreen = false,
oCross = null
;
@ -509,4 +509,4 @@
module.exports = new Knoin();
}());
}());

View file

@ -49,4 +49,4 @@
module.exports = AccountModel;
}());
}());

View file

@ -550,4 +550,4 @@
module.exports = AttachmentModel;
}());
}());

View file

@ -127,4 +127,4 @@
module.exports = ComposeAttachmentModel;
}());
}());

View file

@ -73,16 +73,16 @@
var bResult = false;
if (oItem && 'Object/Contact' === oItem['@Object'])
{
this.idContact = Utils.pInt(oItem['IdContact']);
this.display = Utils.pString(oItem['Display']);
this.readOnly = !!oItem['ReadOnly'];
this.idContact = Utils.pInt(oItem.IdContact);
this.display = Utils.pString(oItem.Display);
this.readOnly = !!oItem.ReadOnly;
if (Utils.isNonEmptyArray(oItem['Properties']))
if (Utils.isNonEmptyArray(oItem.Properties))
{
_.each(oItem['Properties'], function (oProperty) {
if (oProperty && oProperty['Type'] && Utils.isNormal(oProperty['Value']) && Utils.isNormal(oProperty['TypeStr']))
_.each(oItem.Properties, function (oProperty) {
if (oProperty && oProperty.Type && Utils.isNormal(oProperty.Value) && Utils.isNormal(oProperty.TypeStr))
{
this.properties.push([Utils.pInt(oProperty['Type']), Utils.pString(oProperty['Value']), Utils.pString(oProperty['TypeStr'])]);
this.properties.push([Utils.pInt(oProperty.Type), Utils.pString(oProperty.Value), Utils.pString(oProperty.TypeStr)]);
}
}, this);
}
@ -137,4 +137,4 @@
module.exports = ContactModel;
}());
}());

View file

@ -34,8 +34,8 @@
this.placeholder = ko.observable(sPlaceholder || '');
this.placeholderValue = ko.computed(function () {
var sPlaceholder = this.placeholder();
return sPlaceholder ? Translator.i18n(sPlaceholder) : '';
var value = this.placeholder();
return value ? Translator.i18n(value) : '';
}, this);
this.largeValue = ko.computed(function () {
@ -49,4 +49,4 @@
module.exports = ContactPropertyModel;
}());
}());

View file

@ -218,8 +218,12 @@
{
if (bWrapWithLink)
{
sResult = Utils.encodeHtml('"' + this.name + '" <') +
'<a href="mailto:' + Utils.encodeHtml('"' + this.name + '" <' + this.email + '>') + '" target="_blank" tabindex="-1">' + Utils.encodeHtml(sResult) + '</a>' + Utils.encodeHtml('>');
sResult = Utils.encodeHtml('"' + this.name + '" <') + '<a href="mailto:' +
Utils.encodeHtml('"' + this.name + '" <' + this.email + '>') +
'" target="_blank" tabindex="-1">' +
Utils.encodeHtml(sResult) +
'</a>' +
Utils.encodeHtml('>');
}
else
{
@ -268,9 +272,9 @@
substr_replace = function (str, replace, start, length) {
if (start < 0) {
start = start + str.length;
start += str.length;
}
length = length !== undefined ? length : str.length;
length = typeof length !== 'undefined' ? length : str.length;
if (length < 0) {
length = length + str.length - start;
}
@ -399,4 +403,4 @@
module.exports = EmailModel;
}());
}());

View file

@ -79,12 +79,12 @@
{
case Enums.FiltersAction.MoveTo:
sResult = Translator.i18n('SETTINGS_FILTERS/SUBNAME_MOVE_TO', {
'FOLDER': fGetRealFolderName(sActionValue)
FOLDER: fGetRealFolderName(sActionValue)
});
break;
case Enums.FiltersAction.Forward:
sResult = Translator.i18n('SETTINGS_FILTERS/SUBNAME_FORWARD_TO', {
'EMAIL': sActionValue
EMAIL: sActionValue
});
break;
case Enums.FiltersAction.Vacation:
@ -211,23 +211,23 @@
FilterModel.prototype.toJson = function ()
{
return {
'ID': this.id,
'Enabled': this.enabled() ? '1' : '0',
'Name': this.name(),
'ConditionsType': this.conditionsType(),
'Conditions': _.map(this.conditions(), function (oItem) {
ID: this.id,
Enabled: this.enabled() ? '1' : '0',
Name: this.name(),
ConditionsType: this.conditionsType(),
Conditions: _.map(this.conditions(), function (oItem) {
return oItem.toJson();
}),
'ActionValue': this.actionValue(),
'ActionValueSecond': this.actionValueSecond(),
'ActionValueThird': this.actionValueThird(),
'ActionValueFourth': this.actionValueFourth(),
'ActionType': this.actionType(),
ActionValue: this.actionValue(),
ActionValueSecond: this.actionValueSecond(),
ActionValueThird: this.actionValueThird(),
ActionValueFourth: this.actionValueFourth(),
ActionType: this.actionType(),
'Stop': this.actionNoStop() ? '0' : '1',
'Keep': this.actionKeep() ? '1' : '0',
'MarkAsRead': this.actionMarkAsRead() ? '1' : '0'
Stop: this.actionNoStop() ? '0' : '1',
Keep: this.actionKeep() ? '1' : '0',
MarkAsRead: this.actionMarkAsRead() ? '1' : '0'
};
};
@ -252,33 +252,33 @@
var bResult = false;
if (oItem && 'Object/Filter' === oItem['@Object'])
{
this.id = Utils.pString(oItem['ID']);
this.name(Utils.pString(oItem['Name']));
this.enabled(!!oItem['Enabled']);
this.id = Utils.pString(oItem.ID);
this.name(Utils.pString(oItem.Name));
this.enabled(!!oItem.Enabled);
this.conditionsType(Utils.pString(oItem['ConditionsType']));
this.conditionsType(Utils.pString(oItem.ConditionsType));
this.conditions([]);
if (Utils.isNonEmptyArray(oItem['Conditions']))
if (Utils.isNonEmptyArray(oItem.Conditions))
{
this.conditions(_.compact(_.map(oItem['Conditions'], function (aData) {
this.conditions(_.compact(_.map(oItem.Conditions, function (aData) {
var oFilterCondition = new FilterConditionModel();
return oFilterCondition && oFilterCondition.parse(aData) ?
oFilterCondition : null;
})));
}
this.actionType(Utils.pString(oItem['ActionType']));
this.actionType(Utils.pString(oItem.ActionType));
this.actionValue(Utils.pString(oItem['ActionValue']));
this.actionValueSecond(Utils.pString(oItem['ActionValueSecond']));
this.actionValueThird(Utils.pString(oItem['ActionValueThird']));
this.actionValueFourth(Utils.pString(oItem['ActionValueFourth']));
this.actionValue(Utils.pString(oItem.ActionValue));
this.actionValueSecond(Utils.pString(oItem.ActionValueSecond));
this.actionValueThird(Utils.pString(oItem.ActionValueThird));
this.actionValueFourth(Utils.pString(oItem.ActionValueFourth));
this.actionNoStop(!oItem['Stop']);
this.actionKeep(!!oItem['Keep']);
this.actionMarkAsRead(!!oItem['MarkAsRead']);
this.actionNoStop(!oItem.Stop);
this.actionKeep(!!oItem.Keep);
this.actionMarkAsRead(!!oItem.MarkAsRead);
bResult = true;
}
@ -322,4 +322,4 @@
module.exports = FilterModel;
}());
}());

View file

@ -77,12 +77,12 @@
FilterConditionModel.prototype.parse = function (oItem)
{
if (oItem && oItem['Field'] && oItem['Type'])
if (oItem && oItem.Field && oItem.Type)
{
this.field(Utils.pString(oItem['Field']));
this.type(Utils.pString(oItem['Type']));
this.value(Utils.pString(oItem['Value']));
this.valueSecond(Utils.pString(oItem['ValueSecond']));
this.field(Utils.pString(oItem.Field));
this.type(Utils.pString(oItem.Type));
this.value(Utils.pString(oItem.Value));
this.valueSecond(Utils.pString(oItem.ValueSecond));
return true;
}
@ -93,10 +93,10 @@
FilterConditionModel.prototype.toJson = function ()
{
return {
'Field': this.field(),
'Type': this.type(),
'Value': this.value(),
'ValueSecond': this.valueSecond()
Field: this.field(),
Type: this.type(),
Value: this.value(),
ValueSecond: this.valueSecond()
};
};
@ -114,4 +114,4 @@
module.exports = FilterConditionModel;
}());
}());

View file

@ -376,4 +376,4 @@
module.exports = FolderModel;
}());
}());

View file

@ -49,4 +49,4 @@
module.exports = IdentityModel;
}());
}());

View file

@ -56,7 +56,7 @@
if (MessageSimpleModel.prototype.initByJson.call(this, oJson))
{
this.priority = Utils.pInt(oJson.Priority);
this.priority = Utils.inArray(this.priority, [Enums.MessagePriority.High, Enums.MessagePriority.Low]) ?
this.priority = Utils.inArray(this.priority, [Enums.MessagePriority.High, Enums.MessagePriority.Low]) ?
this.priority : Enums.MessagePriority.Normal;
this.hash = Utils.pString(oJson.Hash);
@ -86,4 +86,4 @@
module.exports = MessageFullModel;
}());
}());

View file

@ -171,4 +171,4 @@
module.exports = MessageSimpleModel;
}());
}());

View file

@ -108,3 +108,4 @@
module.exports = OpenPgpKeyModel;
}());

View file

@ -61,10 +61,10 @@
var bResult = false;
if (oItem && 'Object/Template' === oItem['@Object'])
{
this.id = Utils.pString(oItem['ID']);
this.name = Utils.pString(oItem['Name']);
this.body = Utils.pString(oItem['Body']);
this.populated = !!oItem['Populated'];
this.id = Utils.pString(oItem.ID);
this.name = Utils.pString(oItem.Name);
this.body = Utils.pString(oItem.Body);
this.populated = !!oItem.Populated;
bResult = true;
}
@ -74,4 +74,4 @@
module.exports = TemplateModel;
}());
}());

View file

@ -71,7 +71,7 @@
if (bPost)
{
oParameters['XToken'] = Settings.appSettingsGet('token');
oParameters.XToken = Settings.appSettingsGet('token');
}
Plugins.runHook('ajax-default-request', [sAction, oParameters, sAdditionalGetString]);
@ -79,19 +79,19 @@
self.setTrigger(fTrigger, true);
oH = $.ajax({
'type': bPost ? 'POST' : 'GET',
'url': Links.ajax(sAdditionalGetString),
'async': true,
'dataType': 'json',
'data': bPost ? (oParameters || {}) : {},
'timeout': iTimeOut,
'global': true
type: bPost ? 'POST' : 'GET',
url: Links.ajax(sAdditionalGetString),
async: true,
dataType: 'json',
data: bPost ? (oParameters || {}) : {},
timeout: iTimeOut,
global: true
}).always(function (oData, sTextStatus) {
var bCached = false, oErrorData = null, sType = Enums.StorageResultType.Error;
if (oData && oData['Time'])
if (oData && oData.Time)
{
bCached = Utils.pInt(oData['Time']) > Utils.microtime() - iStart;
bCached = Utils.pInt(oData.Time) > Utils.microtime() - iStart;
}
// backward capability
@ -172,7 +172,7 @@
{
if (Globals.data.__APP__ && Globals.data.__APP__.loginAndLogoutReload)
{
Globals.data.__APP__.loginAndLogoutReload(false, true);
Globals.data.__APP__.loginAndLogoutReload(false, true);
}
}
@ -213,14 +213,14 @@
return this.ajaxRequest(sAction, false, iTimeOut, null, sAdditionalGetString, fTrigger);
};
AbstractAjaxPromises.prototype.postRequest = function (sAction, fTrigger, oParameters, iTimeOut)
AbstractAjaxPromises.prototype.postRequest = function (action, fTrigger, params, timeOut)
{
oParameters = oParameters || {};
oParameters['Action'] = sAction;
params = params || {};
params.Action = action;
return this.ajaxRequest(sAction, true, iTimeOut, oParameters, '', fTrigger);
return this.ajaxRequest(action, true, timeOut, params, '', fTrigger);
};
module.exports = AbstractAjaxPromises;
}());
}());

View file

@ -49,4 +49,4 @@
module.exports = AbstractBasicPromises;
}());
}());

View file

@ -91,4 +91,4 @@
module.exports = new UserAjaxUserPromises();
}());
}());

View file

@ -119,7 +119,7 @@
}
}
aSubFolders = oFolder['SubFolders'];
aSubFolders = oFolder.SubFolders;
if (aSubFolders && 'Collection/FolderCollection' === aSubFolders['@Object'] &&
aSubFolders['@Collection'] && Utils.isArray(aSubFolders['@Collection']))
{
@ -142,7 +142,7 @@
{
var
iLimit = Utils.pInt(Settings.appSettingsGet('folderSpecLimit')),
iC = Utils.pInt(oData['CountRec'])
iC = Utils.pInt(oData.CountRec)
;
iLimit = 100 < iLimit ? 100 : (10 > iLimit ? 10 : iLimit);
@ -169,7 +169,7 @@
var bUpdate = false;
if (oData['SystemFolders'] && '' === '' +
if (oData.SystemFolders && '' === '' +
Settings.settingsGet('SentFolder') +
Settings.settingsGet('DraftFolder') +
Settings.settingsGet('SpamFolder') +
@ -177,11 +177,11 @@
Settings.settingsGet('ArchiveFolder') +
Settings.settingsGet('NullFolder'))
{
Settings.settingsSet('SentFolder', oData['SystemFolders'][Enums.ServerFolderType.SENT] || null);
Settings.settingsSet('DraftFolder', oData['SystemFolders'][Enums.ServerFolderType.DRAFTS] || null);
Settings.settingsSet('SpamFolder', oData['SystemFolders'][Enums.ServerFolderType.JUNK] || null);
Settings.settingsSet('TrashFolder', oData['SystemFolders'][Enums.ServerFolderType.TRASH] || null);
Settings.settingsSet('ArchiveFolder', oData['SystemFolders'][Enums.ServerFolderType.ALL] || null);
Settings.settingsSet('SentFolder', oData.SystemFolders[Enums.ServerFolderType.SENT] || null);
Settings.settingsSet('DraftFolder', oData.SystemFolders[Enums.ServerFolderType.DRAFTS] || null);
Settings.settingsSet('SpamFolder', oData.SystemFolders[Enums.ServerFolderType.JUNK] || null);
Settings.settingsSet('TrashFolder', oData.SystemFolders[Enums.ServerFolderType.TRASH] || null);
Settings.settingsSet('ArchiveFolder', oData.SystemFolders[Enums.ServerFolderType.ALL] || null);
bUpdate = true;
}
@ -195,12 +195,12 @@
if (bUpdate)
{
require('Remote/User/Ajax').saveSystemFolders(Utils.noop, {
'SentFolder': FolderStore.sentFolder(),
'DraftFolder': FolderStore.draftFolder(),
'SpamFolder': FolderStore.spamFolder(),
'TrashFolder': FolderStore.trashFolder(),
'ArchiveFolder': FolderStore.archiveFolder(),
'NullFolder': 'NullFolder'
SentFolder: FolderStore.sentFolder(),
DraftFolder: FolderStore.draftFolder(),
SpamFolder: FolderStore.spamFolder(),
TrashFolder: FolderStore.trashFolder(),
ArchiveFolder: FolderStore.archiveFolder(),
NullFolder: 'NullFolder'
});
}
@ -210,4 +210,4 @@
module.exports = new PromisesUserPopulator();
}());
}());

View file

@ -65,7 +65,7 @@
{
if (Globals.data.__APP__ && Globals.data.__APP__.loginAndLogoutReload)
{
Globals.data.__APP__.loginAndLogoutReload(false, true);
Globals.data.__APP__.loginAndLogoutReload(false, true);
}
}
@ -75,9 +75,9 @@
{
Globals.data.__APP__.clearClientSideToken();
if (!oData.ClearAuth && Globals.data.__APP__.loginAndLogoutReload)
if (!oData.ClearAuth && Globals.data.__APP__.loginAndLogoutReload)
{
Globals.data.__APP__.loginAndLogoutReload(false, true);
Globals.data.__APP__.loginAndLogoutReload(false, true);
}
}
}
@ -169,26 +169,26 @@
if (bPost)
{
oParameters['XToken'] = Settings.appSettingsGet('token');
oParameters.XToken = Settings.appSettingsGet('token');
}
oDefAjax = $.ajax({
'type': bPost ? 'POST' : 'GET',
'url': Links.ajax(sGetAdd),
'async': true,
'dataType': 'json',
'data': bPost ? oParameters : {},
'headers': oHeaders,
'timeout': iTimeOut,
'global': true
type: bPost ? 'POST' : 'GET',
url: Links.ajax(sGetAdd),
async: true,
dataType: 'json',
data: bPost ? oParameters : {},
headers: oHeaders,
timeout: iTimeOut,
global: true
});
oDefAjax.always(function (oData, sType) {
var bCached = false;
if (oData && oData['Time'])
if (oData && oData.Time)
{
bCached = Utils.pInt(oData['Time']) > (new window.Date()).getTime() - iStart;
bCached = Utils.pInt(oData.Time) > (new window.Date()).getTime() - iStart;
}
if (sAction && self.oRequests[sAction])
@ -308,4 +308,4 @@
module.exports = AbstractAjaxRemote;
}());
}());

View file

@ -163,8 +163,8 @@
RemoteAdminStorage.prototype.domainDisable = function (fCallback, sName, bDisabled)
{
return this.defaultRequest(fCallback, 'AdminDomainDisable', {
'Name': sName,
'Disabled': !!bDisabled ? '1' : '0'
Name: sName,
Disabled: bDisabled ? '1' : '0'
});
};
@ -184,7 +184,7 @@
RemoteAdminStorage.prototype.licensing = function (fCallback, bForce)
{
return this.defaultRequest(fCallback, 'AdminLicensing', {
'Force' : bForce ? '1' : '0'
Force: bForce ? '1' : '0'
});
};
@ -196,8 +196,8 @@
RemoteAdminStorage.prototype.licensingActivate = function (fCallback, sDomain, sKey)
{
return this.defaultRequest(fCallback, 'AdminLicensingActivate', {
'Domain' : sDomain,
'Key' : sKey
Domain: sDomain,
Key: sKey
});
};
@ -209,16 +209,16 @@
RemoteAdminStorage.prototype.pluginDisable = function (fCallback, sName, bDisabled)
{
return this.defaultRequest(fCallback, 'AdminPluginDisable', {
'Name': sName,
'Disabled': !!bDisabled ? '1' : '0'
Name: sName,
Disabled: bDisabled ? '1' : '0'
});
};
RemoteAdminStorage.prototype.createDomainAlias = function (fCallback, sName, sAlias)
{
this.defaultRequest(fCallback, 'AdminDomainAliasSave', {
'Name': sName,
'Alias': sAlias
Name: sName,
Alias: sAlias
});
};
@ -305,4 +305,4 @@
module.exports = new RemoteAdminStorage();
}());
}());

View file

@ -252,9 +252,11 @@
/**
* @param {?Function} fCallback
* @param {Array} aFilters
* @param {string} sRaw
* @param {boolean} bRawIsActive
*/
RemoteUserAjax.prototype.filtersSave = function (fCallback,
aFilters, sRaw, bRawIsActive)
RemoteUserAjax.prototype.filtersSave = function (fCallback, aFilters, sRaw, bRawIsActive)
{
this.defaultRequest(fCallback, 'FiltersSave', {
'Raw': sRaw,
@ -282,7 +284,8 @@
};
/**
* @param {?Function} fCallback
* @param {Function} fCallback
* @param {string} sID
*/
RemoteUserAjax.prototype.templateGetById = function (fCallback, sID)
{
@ -292,7 +295,8 @@
};
/**
* @param {?Function} fCallback
* @param {Function} fCallback
* @param {string} sID
*/
RemoteUserAjax.prototype.templateDelete = function (fCallback, sID)
{
@ -302,7 +306,10 @@
};
/**
* @param {?Function} fCallback
* @param {Function} fCallback
* @param {string} sID
* @param {string} sName
* @param {string} sBody
*/
RemoteUserAjax.prototype.templateSetup = function (fCallback, sID, sName, sBody)
{
@ -314,7 +321,7 @@
};
/**
* @param {?Function} fCallback
* @param {Function} fCallback
* @param {string} sFolderFullNameRaw
* @param {number=} iOffset = 0
* @param {number=} iLimit = 20
@ -354,19 +361,17 @@
bUseThreads ? sThreadUid : ''
].join(String.fromCharCode(0))), bSilent ? [] : ['MessageList']);
}
else
{
return this.defaultRequest(fCallback, 'MessageList', {
'Folder': sFolderFullNameRaw,
'Offset': iOffset,
'Limit': iLimit,
'Search': sSearch,
'UidNext': sInboxUidNext,
'UseThreads': bUseThreads ? '1' : '0',
'ThreadUid': bUseThreads ? sThreadUid : ''
}, '' === sSearch ? Consts.DEFAULT_AJAX_TIMEOUT : Consts.SEARCH_AJAX_TIMEOUT,
'', bSilent ? [] : ['MessageList']);
}
return this.defaultRequest(fCallback, 'MessageList', {
Folder: sFolderFullNameRaw,
Offset: iOffset,
Limit: iLimit,
Search: sSearch,
UidNext: sInboxUidNext,
UseThreads: bUseThreads ? '1' : '0',
ThreadUid: bUseThreads ? sThreadUid : ''
}, '' === sSearch ? Consts.DEFAULT_AJAX_TIMEOUT : Consts.SEARCH_AJAX_TIMEOUT,
'', bSilent ? [] : ['MessageList']);
};
/**
@ -554,6 +559,7 @@
* @param {string} sTo
* @param {string} sCc
* @param {string} sBcc
* @param {string} sReplyTo
* @param {string} sSubject
* @param {boolean} bTextIsHtml
* @param {string} sText
@ -904,4 +910,4 @@
module.exports = new RemoteUserAjax();
}());
}());

View file

@ -56,7 +56,7 @@
oViewModelDom = null
;
RoutedSettingsViewModel = _.find(Globals.aViewModels['settings'], function (SettingsViewModel) {
RoutedSettingsViewModel = _.find(Globals.aViewModels.settings, function (SettingsViewModel) {
return SettingsViewModel && SettingsViewModel.__rlSettingsData &&
sSubName === SettingsViewModel.__rlSettingsData.Route;
});
@ -165,17 +165,17 @@
AbstractSettingsScreen.prototype.onBuild = function ()
{
_.each(Globals.aViewModels['settings'], function (SettingsViewModel) {
_.each(Globals.aViewModels.settings, function (SettingsViewModel) {
if (SettingsViewModel && SettingsViewModel.__rlSettingsData &&
!_.find(Globals.aViewModels['settings-removed'], function (RemoveSettingsViewModel) {
return RemoveSettingsViewModel && RemoveSettingsViewModel === SettingsViewModel;
}))
{
this.menu.push({
'route': SettingsViewModel.__rlSettingsData.Route,
'label': SettingsViewModel.__rlSettingsData.Label,
'selected': ko.observable(false),
'disabled': !!_.find(Globals.aViewModels['settings-disabled'], function (DisabledSettingsViewModel) {
route: SettingsViewModel.__rlSettingsData.Route,
label: SettingsViewModel.__rlSettingsData.Label,
selected: ko.observable(false),
disabled: !!_.find(Globals.aViewModels['settings-disabled'], function (DisabledSettingsViewModel) {
return DisabledSettingsViewModel && DisabledSettingsViewModel === SettingsViewModel;
})
});
@ -188,13 +188,14 @@
AbstractSettingsScreen.prototype.routes = function ()
{
var
DefaultViewModel = _.find(Globals.aViewModels['settings'], function (SettingsViewModel) {
return SettingsViewModel && SettingsViewModel.__rlSettingsData && SettingsViewModel.__rlSettingsData['IsDefault'];
DefaultViewModel = _.find(Globals.aViewModels.settings, function (SettingsViewModel) {
return SettingsViewModel && SettingsViewModel.__rlSettingsData && SettingsViewModel.__rlSettingsData.IsDefault;
}),
sDefaultRoute = DefaultViewModel ? DefaultViewModel.__rlSettingsData['Route'] : 'general',
sDefaultRoute = DefaultViewModel && DefaultViewModel.__rlSettingsData ?
DefaultViewModel.__rlSettingsData.Route : 'general',
oRules = {
'subname': /^(.*)$/,
'normalize_': function (oRequest, oVals) {
subname: /^(.*)$/,
normalize_: function (oRequest, oVals) {
oVals.subname = Utils.isUnd(oVals.subname) ? sDefaultRoute : Utils.pString(oVals.subname);
return [oVals.subname];
}
@ -210,4 +211,4 @@
module.exports = AbstractSettingsScreen;
}());
}());

View file

@ -29,4 +29,4 @@
module.exports = LoginAdminScreen;
}());
}());

View file

@ -93,4 +93,4 @@
module.exports = SettingsAdminScreen;
}());
}());

View file

@ -29,4 +29,4 @@
module.exports = AboutUserScreen;
}());
}());

View file

@ -29,4 +29,4 @@
module.exports = LoginUserScreen;
}());
}());

View file

@ -48,7 +48,7 @@
*/
MailBoxUserScreen.prototype.oLastRoute = {};
MailBoxUserScreen.prototype.updateWindowTitle = function ()
MailBoxUserScreen.prototype.updateWindowTitle = function ()
{
var
sEmail = AccountStore.email(),
@ -195,10 +195,10 @@
[/^([a-zA-Z0-9~]+)\/p([1-9][0-9]*)\/(.+)\/?$/, {'normalize_': fNormS}],
[/^([a-zA-Z0-9~]+)\/p([1-9][0-9]*)$/, {'normalize_': fNormS}],
[/^([a-zA-Z0-9~]+)\/(.+)\/?$/, {'normalize_': fNormD}],
[/^([^\/]*)$/, {'normalize_': fNormS}]
[/^([^\/]*)$/, {'normalize_': fNormS}]
];
};
module.exports = MailBoxUserScreen;
}());
}());

View file

@ -154,4 +154,4 @@
module.exports = SettingsUserScreen;
}());
}());

View file

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

View file

@ -120,4 +120,4 @@
module.exports = BrandingAdminSettings;
}());
}());

View file

@ -50,15 +50,15 @@
}
;
if (!!Settings.settingsGet('SQLiteIsSupported'))
if (Settings.settingsGet('SQLiteIsSupported'))
{
aSupportedTypes.push('sqlite');
}
if (!!Settings.settingsGet('MySqlIsSupported'))
if (Settings.settingsGet('MySqlIsSupported'))
{
aSupportedTypes.push('mysql');
}
if (!!Settings.settingsGet('PostgreSqlIsSupported'))
if (Settings.settingsGet('PostgreSqlIsSupported'))
{
aSupportedTypes.push('pgsql');
}
@ -241,4 +241,4 @@
module.exports = ContactsAdminSettings;
}());
}());

View file

@ -83,4 +83,4 @@
module.exports = DomainsAdminSettings;
}());
}());

View file

@ -46,16 +46,16 @@
this.mainAttachmentLimit = ko.observable(Utils.pInt(Settings.settingsGet('AttachmentLimit')) / (1024 * 1024)).extend({'posInterer': 25});
this.uploadData = Settings.settingsGet('PhpUploadSizes');
this.uploadDataDesc = this.uploadData && (this.uploadData['upload_max_filesize'] || this.uploadData['post_max_size']) ? [
this.uploadData['upload_max_filesize'] ? 'upload_max_filesize = ' + this.uploadData['upload_max_filesize'] + '; ' : '',
this.uploadData['post_max_size'] ? 'post_max_size = ' + this.uploadData['post_max_size'] : ''
this.uploadDataDesc = this.uploadData && (this.uploadData.upload_max_filesize || this.uploadData.post_max_size) ? [
this.uploadData.upload_max_filesize ? 'upload_max_filesize = ' + this.uploadData.upload_max_filesize + '; ' : '',
this.uploadData.post_max_size ? 'post_max_size = ' + this.uploadData.post_max_size : ''
].join('') : '';
this.themesOptions = ko.computed(function () {
return _.map(this.themes(), function (sTheme) {
return {
'optValue': sTheme,
'optText': Utils.convertThemeName(sTheme)
optValue: sTheme,
optText: Utils.convertThemeName(sTheme)
};
});
}, this);
@ -208,4 +208,4 @@
module.exports = GeneralAdminSettings;
}());
}());

View file

@ -71,4 +71,4 @@
module.exports = LoginAdminSettings;
}());
}());

View file

@ -26,16 +26,16 @@
this.packagesReal = PackageStore.packagesReal;
this.packagesMainUpdatable = PackageStore.packagesMainUpdatable;
this.packagesCurrent = this.packages.filter(function (oItem) {
return oItem && '' !== oItem['installed'] && !oItem['compare'];
this.packagesCurrent = this.packages.filter(function (item) {
return item && '' !== item.installed && !item.compare;
});
this.packagesAvailableForUpdate = this.packages.filter(function (oItem) {
return oItem && '' !== oItem['installed'] && !!oItem['compare'];
this.packagesAvailableForUpdate = this.packages.filter(function (item) {
return item && '' !== item.installed && !!item.compare;
});
this.packagesAvailableForInstallation = this.packages.filter(function (oItem) {
return oItem && '' === oItem['installed'];
this.packagesAvailableForInstallation = this.packages.filter(function (item) {
return item && '' === item.installed;
});
this.visibility = ko.computed(function () {
@ -71,15 +71,15 @@
}
}
_.each(self.packages(), function (oItem) {
if (oItem && oPackage && oItem['loading']() && oPackage['file'] === oItem['file'])
_.each(self.packages(), function (item) {
if (item && oPackage && item.loading && item.loading() && oPackage.file === item.file)
{
oPackage['loading'](false);
oItem['loading'](false);
oPackage.loading(false);
item.loading(false);
}
});
if (Enums.StorageResultType.Success === sResult && oData && oData.Result && oData.Result['Reload'])
if (Enums.StorageResultType.Success === sResult && oData && oData.Result && oData.Result.Reload)
{
window.location.reload();
}
@ -94,7 +94,7 @@
{
if (oPackage)
{
oPackage['loading'](true);
oPackage.loading(true);
Remote.packageDelete(this.requestHelper(oPackage, false), oPackage);
}
};
@ -103,11 +103,11 @@
{
if (oPackage)
{
oPackage['loading'](true);
oPackage.loading(true);
Remote.packageInstall(this.requestHelper(oPackage, true), oPackage);
}
};
module.exports = PackagesAdminSettings;
}());
}());

View file

@ -116,4 +116,4 @@
module.exports = PluginsAdminSettings;
}());
}());

View file

@ -180,4 +180,4 @@
module.exports = SocialAdminSettings;
}());
}());

View file

@ -160,4 +160,4 @@
module.exports = AccountsUserSettings;
}());
}());

View file

@ -121,4 +121,4 @@
module.exports = ChangePasswordUserSettings;
}());
}());

View file

@ -55,4 +55,4 @@
module.exports = ContactsUserSettings;
}());
}());

View file

@ -188,7 +188,7 @@
oNew.generateID();
require('Knoin/Knoin').showScreenPopup(
require('View/Popup/Filter'), [oNew, function () {
require('View/Popup/Filter'), [oNew, function () {
self.filters.push(oNew);
self.filterRaw.active(false);
}, false]);
@ -202,7 +202,7 @@
;
require('Knoin/Knoin').showScreenPopup(
require('View/Popup/Filter'), [oCloned, function () {
require('View/Popup/Filter'), [oCloned, function () {
var
aFilters = self.filters(),
@ -243,4 +243,4 @@
module.exports = FiltersUserSettings;
}());
}());

View file

@ -200,4 +200,4 @@
module.exports = FoldersUserSettings;
}());
}());

View file

@ -229,4 +229,4 @@
module.exports = GeneralUserSettings;
}());
}());

View file

@ -80,4 +80,4 @@
module.exports = OpenPgpUserSettings;
}());
}());

View file

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

View file

@ -77,4 +77,4 @@
module.exports = SocialUserSettings;
}());
}());

View file

@ -104,4 +104,4 @@
module.exports = TemplatesUserSettings;
}());
}());

View file

@ -18,7 +18,7 @@
ThemeStore = require('Stores/Theme'),
Settings = require('Storage/Settings'),
Remote = require('Remote/User/Ajax')
;
@ -182,4 +182,4 @@
module.exports = ThemesUserSettings;
}());
}());

View file

@ -40,4 +40,4 @@
module.exports = new ContactUserStore();
}());
}());

View file

@ -17,8 +17,8 @@
this.filters = ko.observableArray([]);
this.filters.loading = ko.observable(false).extend({'throttle': 200});
this.filters.saving = ko.observable(false).extend({'throttle': 200});
this.filters.loading = ko.observable(false).extend({throttle: 200});
this.filters.saving = ko.observable(false).extend({throttle: 200});
this.raw = ko.observable('');
}

View file

@ -187,7 +187,7 @@
if (oMessage)
{
if (Enums.Layout.NoPreview === SettingsStore.layout())
if (Enums.Layout.NoPreview === SettingsStore.layout())
{
AppStore.focusedState(Enums.Focused.MessageView);
}
@ -337,13 +337,13 @@
oToFolder = '' === sToFolderFullNameRaw ? null : Cache.getFolderFromCacheList(sToFolderFullNameRaw || ''),
sCurrentFolderFullNameRaw = FolderStore.currentFolderFullNameRaw(),
oCurrentMessage = this.message(),
aMessages = sCurrentFolderFullNameRaw === sFromFolderFullNameRaw ? _.filter(aMessageList, function (oMessage) {
return oMessage && -1 < Utils.inArray(Utils.pInt(oMessage.uid), aUidForRemove);
aMessages = sCurrentFolderFullNameRaw === sFromFolderFullNameRaw ? _.filter(aMessageList, function (item) {
return item && -1 < Utils.inArray(Utils.pInt(item.uid), aUidForRemove);
}) : []
;
_.each(aMessages, function (oMessage) {
if (oMessage && oMessage.unseen())
_.each(aMessages, function (item) {
if (item && item.unseen())
{
iUnseenCount++;
}
@ -381,27 +381,27 @@
{
if (bCopy)
{
_.each(aMessages, function (oMessage) {
oMessage.checked(false);
_.each(aMessages, function (item) {
item.checked(false);
});
}
else
{
this.messageListIsNotCompleted(true);
_.each(aMessages, function (oMessage) {
if (oCurrentMessage && oCurrentMessage.hash === oMessage.hash)
_.each(aMessages, function (item) {
if (oCurrentMessage && oCurrentMessage.hash === item.hash)
{
oCurrentMessage = null;
self.message(null);
}
oMessage.deleted(true);
item.deleted(true);
});
_.delay(function () {
_.each(aMessages, function (oMessage) {
self.messageList.remove(oMessage);
_.each(aMessages, function (item) {
self.messageList.remove(item);
});
}, 400);
}
@ -421,12 +421,12 @@
{
aMessageList = this.messageList();
if (aMessageList && 0 < aMessageList.length && !!_.find(aMessageList, function (oMessage) {
return !!(oMessage && oMessage.deleted() && oMessage.uid === self.messageListThreadUid());
if (aMessageList && 0 < aMessageList.length && !!_.find(aMessageList, function (item) {
return !!(item && item.deleted() && item.uid === self.messageListThreadUid());
}))
{
oMessage = _.find(aMessageList, function (oMessage) {
return oMessage && !oMessage.deleted();
oMessage = _.find(aMessageList, function (item) {
return item && !item.deleted();
});
if (oMessage && this.messageListThreadUid() !== Utils.pString(oMessage.uid))

View file

@ -43,7 +43,7 @@
return !!this.openpgp;
};
PgpUserStore.prototype.findKeyByHex = function (aKeys,sHash)
PgpUserStore.prototype.findKeyByHex = function (aKeys, sHash)
{
return _.find(aKeys, function (oItem) {
return sHash && oItem && (sHash === oItem.id || -1 < oItem.ids.indexOf(sHash));
@ -197,7 +197,7 @@
if (oDecryptedKey)
{
oMessage.decrypt(oDecryptedKey).then(function(oDecryptedMessage){
oMessage.decrypt(oDecryptedKey).then(function(oDecryptedMessage) {
var oPrivateKey = null;
if (oDecryptedMessage)
{

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;
}());
}());

View file

@ -22,11 +22,6 @@ var
zipFile: '',
paths: {},
summary: {
verbose: true,
reasonCol: 'cyan,bold',
codeCol: 'green'
},
uglify: {
mangle: true,
compress: true
@ -100,6 +95,7 @@ function copyFile(sFile, sNewFile, callback)
cfg.paths.globjs = 'dev/**/*.{js,jsx,html,css}';
cfg.paths.globjsonly = 'dev/**/*.js';
cfg.paths.globjsxonly = 'dev/**/*.jsx';
cfg.paths.globjsall = 'dev/**/*.{js,jsx}';
cfg.paths.globtsonly = 'dev/**/*.ts';
cfg.paths.static = 'rainloop/v/' + cfg.devVersion + '/static/';
cfg.paths.staticJS = 'rainloop/v/' + cfg.devVersion + '/static/js/';
@ -417,38 +413,15 @@ gulp.task('js:min', ['js:app', 'js:admin', 'js:validate'], function() {
});
// lint
gulp.task('js:lint', function() {
var jshint = require('gulp-jshint');
return gulp.src(cfg.paths.globjsonly)
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-summary', cfg.summary))
.pipe(jshint.reporter('fail'))
;
});
gulp.task('js:eslint', function() {
var eslint = require('gulp-eslint');
return gulp.src(cfg.paths.globjsxonly)
return gulp.src(cfg.paths.globjsall)
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('js:tslint', function() {
var tslint = require('gulp-tslint'); // todo
return gulp.src(cfg.paths.globtsonly)
.pipe(tslint())
.pipe(tslint.format())
.pipe(tslint.failAfterError());
});
gulp.task('js:validate', ['js:lint', 'js:eslint'/*, 'js:tslint'*/]);
gulp.task('js:validate', ['js:eslint']);
// OTHER
regOtherMinTask('other:cookie', 'vendors/jquery-cookie/', 'jquery.cookie.js', 'jquery.cookie-1.4.0.min.js',