jshint -> eslint

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

View file

@ -1,15 +1,27 @@
{ {
"parser": "babel-eslint",
"ecmaFeatures": { "ecmaFeatures": {
"modules": true, "modules": true
"arrowFunctions": true,
"blockBindings": true
}, },
"env": { "env": {
"node": true, "node": true,
"commonjs": true,
"es6": true, "es6": true,
"browser": 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": { "rules": {
"comma-dangle": [2, "never"], "comma-dangle": [2, "never"],
"no-cond-assign": 2, "no-cond-assign": 2,
@ -135,7 +147,7 @@
"operator-assignment": [2, "always"], "operator-assignment": [2, "always"],
"padded-blocks": 0, "padded-blocks": 0,
"quotes": [2, "single"], "quotes": [2, "single"],
"quote-props": [2, "as-needed"], "quote-props": 0,
"semi": [2, "always"], "semi": [2, "always"],
// "sort-vars": [2, {"ignoreCase": true}], // "sort-vars": [2, {"ignoreCase": true}],
"space-before-blocks": 2, "space-before-blocks": 2,
@ -146,7 +158,7 @@
"space-unary-ops": 2, "space-unary-ops": 2,
"spaced-comment": 2, "spaced-comment": 2,
"wrap-regex": 0, "wrap-regex": 0,
// Legacy
"max-depth": 0, "max-depth": 0,
"max-len": [2, 200], "max-len": [2, 200],
"max-params": 0, "max-params": 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 class AbstractApp extends AbstractBoot
{ {
googlePreviewSupportedCache = null;
isLocalAutocomplete = true;
iframe = null;
lastErrorTime = 0;
/** /**
* @param {RemoteStorage|AdminRemoteStorage} Remote * @param {RemoteStorage|AdminRemoteStorage} Remote
*/ */
@ -30,6 +25,11 @@ class AbstractApp extends AbstractBoot
{ {
super(); super();
this.googlePreviewSupportedCache = null;
this.isLocalAutocomplete = true;
this.iframe = null;
this.lastErrorTime = 0;
this.iframe = $('<iframe class="internal-hiddden" />').appendTo('body'); this.iframe = $('<iframe class="internal-hiddden" />').appendTo('body');
$win.on('error', (event) => { $win.on('error', (event) => {

View file

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

View file

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

View file

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

View file

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

View file

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

138
dev/External/ko.js vendored
View file

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

View file

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

View file

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

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) Knoin.prototype.addSettingsViewModel = function (SettingsViewModelClass, sTemplate, sLabelName, sRoute, bDefault)
{ {
SettingsViewModelClass.__rlSettingsData = { SettingsViewModelClass.__rlSettingsData = {
'Label': sLabelName, Label: sLabelName,
'Template': sTemplate, Template: sTemplate,
'Route': sRoute, Route: sRoute,
'IsDefault': !!bDefault IsDefault: !!bDefault
}; };
Globals.aViewModels['settings'].push(SettingsViewModelClass); Globals.aViewModels.settings.push(SettingsViewModelClass);
}; };
/** /**

View file

@ -73,16 +73,16 @@
var bResult = false; var bResult = false;
if (oItem && 'Object/Contact' === oItem['@Object']) if (oItem && 'Object/Contact' === oItem['@Object'])
{ {
this.idContact = Utils.pInt(oItem['IdContact']); this.idContact = Utils.pInt(oItem.IdContact);
this.display = Utils.pString(oItem['Display']); this.display = Utils.pString(oItem.Display);
this.readOnly = !!oItem['ReadOnly']; this.readOnly = !!oItem.ReadOnly;
if (Utils.isNonEmptyArray(oItem['Properties'])) if (Utils.isNonEmptyArray(oItem.Properties))
{ {
_.each(oItem['Properties'], function (oProperty) { _.each(oItem.Properties, function (oProperty) {
if (oProperty && oProperty['Type'] && Utils.isNormal(oProperty['Value']) && Utils.isNormal(oProperty['TypeStr'])) 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); }, this);
} }

View file

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

View file

@ -218,8 +218,12 @@
{ {
if (bWrapWithLink) if (bWrapWithLink)
{ {
sResult = Utils.encodeHtml('"' + this.name + '" <') + sResult = Utils.encodeHtml('"' + this.name + '" <') + '<a href="mailto:' +
'<a href="mailto:' + Utils.encodeHtml('"' + this.name + '" <' + this.email + '>') + '" target="_blank" tabindex="-1">' + Utils.encodeHtml(sResult) + '</a>' + Utils.encodeHtml('>'); Utils.encodeHtml('"' + this.name + '" <' + this.email + '>') +
'" target="_blank" tabindex="-1">' +
Utils.encodeHtml(sResult) +
'</a>' +
Utils.encodeHtml('>');
} }
else else
{ {
@ -268,9 +272,9 @@
substr_replace = function (str, replace, start, length) { substr_replace = function (str, replace, start, length) {
if (start < 0) { 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) { if (length < 0) {
length = length + str.length - start; length = length + str.length - start;
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -169,26 +169,26 @@
if (bPost) if (bPost)
{ {
oParameters['XToken'] = Settings.appSettingsGet('token'); oParameters.XToken = Settings.appSettingsGet('token');
} }
oDefAjax = $.ajax({ oDefAjax = $.ajax({
'type': bPost ? 'POST' : 'GET', type: bPost ? 'POST' : 'GET',
'url': Links.ajax(sGetAdd), url: Links.ajax(sGetAdd),
'async': true, async: true,
'dataType': 'json', dataType: 'json',
'data': bPost ? oParameters : {}, data: bPost ? oParameters : {},
'headers': oHeaders, headers: oHeaders,
'timeout': iTimeOut, timeout: iTimeOut,
'global': true global: true
}); });
oDefAjax.always(function (oData, sType) { oDefAjax.always(function (oData, sType) {
var bCached = false; 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]) if (sAction && self.oRequests[sAction])

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -26,16 +26,16 @@
this.packagesReal = PackageStore.packagesReal; this.packagesReal = PackageStore.packagesReal;
this.packagesMainUpdatable = PackageStore.packagesMainUpdatable; this.packagesMainUpdatable = PackageStore.packagesMainUpdatable;
this.packagesCurrent = this.packages.filter(function (oItem) { this.packagesCurrent = this.packages.filter(function (item) {
return oItem && '' !== oItem['installed'] && !oItem['compare']; return item && '' !== item.installed && !item.compare;
}); });
this.packagesAvailableForUpdate = this.packages.filter(function (oItem) { this.packagesAvailableForUpdate = this.packages.filter(function (item) {
return oItem && '' !== oItem['installed'] && !!oItem['compare']; return item && '' !== item.installed && !!item.compare;
}); });
this.packagesAvailableForInstallation = this.packages.filter(function (oItem) { this.packagesAvailableForInstallation = this.packages.filter(function (item) {
return oItem && '' === oItem['installed']; return item && '' === item.installed;
}); });
this.visibility = ko.computed(function () { this.visibility = ko.computed(function () {
@ -71,15 +71,15 @@
} }
} }
_.each(self.packages(), function (oItem) { _.each(self.packages(), function (item) {
if (oItem && oPackage && oItem['loading']() && oPackage['file'] === oItem['file']) if (item && oPackage && item.loading && item.loading() && oPackage.file === item.file)
{ {
oPackage['loading'](false); oPackage.loading(false);
oItem['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(); window.location.reload();
} }
@ -94,7 +94,7 @@
{ {
if (oPackage) if (oPackage)
{ {
oPackage['loading'](true); oPackage.loading(true);
Remote.packageDelete(this.requestHelper(oPackage, false), oPackage); Remote.packageDelete(this.requestHelper(oPackage, false), oPackage);
} }
}; };
@ -103,7 +103,7 @@
{ {
if (oPackage) if (oPackage)
{ {
oPackage['loading'](true); oPackage.loading(true);
Remote.packageInstall(this.requestHelper(oPackage, true), oPackage); Remote.packageInstall(this.requestHelper(oPackage, true), oPackage);
} }
}; };

View file

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

View file

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

View file

@ -34,51 +34,52 @@
this.addOpenPgpKeyCommand = Utils.createCommand(this, function () { this.addOpenPgpKeyCommand = Utils.createCommand(this, function () {
var var
iCount = 30, count = 30,
aMatch = null, match = null,
sKey = Utils.trim(this.key()), key = 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, 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,
oOpenpgpKeyring = PgpStore.openpgpKeyring openpgpKeyring = PgpStore.openpgpKeyring,
done = false
; ;
if (/[\n]/.test(sKey)) if (/[\n]/.test(key))
{ {
sKey = sKey.replace(/[\r]+/g, '') key = key.replace(/[\r]+/g, '').replace(/[\n]{2,}/g, '\n\n');
.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; return false;
} }
do do
{ {
aMatch = oReg.exec(sKey); match = reg.exec(key);
if (!aMatch || 0 > iCount) 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])
if (aMatch[0] && aMatch[1] && aMatch[2] && aMatch[1] === aMatch[2])
{ {
if ('PRIVATE' === aMatch[1]) openpgpKeyring.publicKeys.importKey(match[0]);
{
oOpenpgpKeyring.privateKeys.importKey(aMatch[0]);
}
else if ('PUBLIC' === aMatch[1])
{
oOpenpgpKeyring.publicKeys.importKey(aMatch[0]);
} }
} }
iCount--; count--;
} }
while (true);
oOpenpgpKeyring.store(); done = true;
}
while (done);
openpgpKeyring.store();
require('App/User').default.reloadOpenPgpKeys(); require('App/User').default.reloadOpenPgpKeys();
Utils.delegateRun(this, 'cancelCommand'); Utils.delegateRun(this, 'cancelCommand');

View file

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

View file

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

View file

@ -210,7 +210,7 @@
}); });
}, this); }, 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 .actionHandle', '.e-contact-item.selected', '.e-contact-item .checkboxItem',
'.e-contact-item.focused'); '.e-contact-item.focused');
@ -370,7 +370,6 @@
this.syncCommand = Utils.createCommand(this, function () { this.syncCommand = Utils.createCommand(this, function () {
var self = this;
require('App/User').default.contactsSync(function (sResult, oData) { require('App/User').default.contactsSync(function (sResult, oData) {
if (Enums.StorageResultType.Success !== sResult || !oData || !oData.Result) if (Enums.StorageResultType.Success !== sResult || !oData || !oData.Result)
{ {
@ -439,8 +438,8 @@
ContactsPopupView.prototype.addNewOrFocusProperty = function (sType, sTypeStr) ContactsPopupView.prototype.addNewOrFocusProperty = function (sType, sTypeStr)
{ {
var oItem = _.find(this.viewProperties(), function (oItem) { var oItem = _.find(this.viewProperties(), function (oProp) {
return sType === oItem.type(); return sType === oProp.type();
}); });
if (oItem) if (oItem)

View file

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

View file

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

View file

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

View file

@ -170,9 +170,9 @@
self.body.loading(false); self.body.loading(false);
if (Enums.StorageResultType.Success === sResult && oData && oData.Result && 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; oTemplate.populated = true;
self.body(oTemplate.body); self.body(oTemplate.body);

View file

@ -201,7 +201,7 @@
self = this, self = this,
sPassword = this.password(), sPassword = this.password(),
fLoginRequest = _.bind(function (sPassword) { fLoginRequest = _.bind(function (sLoginPassword) {
Remote.login(_.bind(function (sResult, oData) { Remote.login(_.bind(function (sResult, oData) {
@ -261,13 +261,13 @@
this.submitError(Translator.getNotification(Enums.Notification.UnknownError)); this.submitError(Translator.getNotification(Enums.Notification.UnknownError));
} }
}, this), this.email(), '', sPassword, !!this.signMe(), }, this), this.email(), '', sLoginPassword, !!this.signMe(),
this.bSendLanguage ? this.language() : '', this.bSendLanguage ? this.language() : '',
this.additionalCode.visibility() ? this.additionalCode() : '', this.additionalCode.visibility() ? this.additionalCode() : '',
this.additionalCode.visibility() ? !!this.additionalCodeSignMe() : false 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) }, this)
; ;

View file

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

View file

@ -469,22 +469,22 @@
iLimit = 5, iLimit = 5,
sResult = '', sResult = '',
aC = null, aC = null,
fFindDom = function (oDom) { fFindDom = function (oInputDom) {
var aC = oDom ? oDom.children() : null; var children = oInputDom ? oInputDom.children() : null;
return (aC && 1 === aC.length && aC.is('table,div,center')) ? aC : null; return (children && 1 === children.length && children.is('table,div,center')) ? children : null;
}, },
fFindColor = function (oDom) { fFindColor = function (oInputDom) {
var sResult = ''; var color = '';
if (oDom) if (oInputDom)
{ {
sResult = oDom.css('background-color') || ''; color = oInputDom.css('background-color') || '';
if (!oDom.is('table')) 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++; iListIndex++;
return { return {
'src': oItem.linkPreview(), src: oItem.linkPreview(),
'thumb': oItem.linkThumbnail(), thumb: oItem.linkThumbnail(),
'subHtml': oItem.fileName, subHtml: oItem.fileName,
'downloadUrl': oItem.linkPreview() downloadUrl: oItem.linkPreview()
}; };
} }
@ -707,7 +707,7 @@
oDom oDom
.on('click', 'a', function (oEvent) { .on('click', 'a', function (oEvent) {
// setup maito protocol // 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)); Settings.capa(Enums.Capa.Composer) ? require('View/Popup/Compose') : null));
}) })
// .on('mouseover', 'a', _.debounce(function (oEvent) { // .on('mouseover', 'a', _.debounce(function (oEvent) {

View file

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