From 161ddc992007a8f4797bced8dab5d13f45301ed0 Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Tue, 9 Aug 2016 23:11:54 +0300 Subject: [PATCH] More fixes for scrutinizer-ci (+ enable php) --- .scrutinizer.yml | 3 ++- dev/External/ko.js | 9 ++++----- dev/Promises/AbstractAjax.js | 2 +- dev/View/Popup/AddOpenPgpKey.js | 6 ++---- dev/View/Popup/Compose.js | 29 ++++++++--------------------- 5 files changed, 17 insertions(+), 32 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 95b4d0915..3e768573c 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -11,4 +11,5 @@ filter: - 'build/*' - 'data/*' checks: - javascript: true \ No newline at end of file + javascript: true + php: true \ No newline at end of file diff --git a/dev/External/ko.js b/dev/External/ko.js index b2b8b7584..c18c768bd 100644 --- a/dev/External/ko.js +++ b/dev/External/ko.js @@ -135,7 +135,6 @@ ko.bindingHandlers.tooltip = { init: function(oElement, fValueAccessor) { var - bi18n = true, sValue = '', Translator = null, $oEl = $(oElement), @@ -145,7 +144,6 @@ ko.bindingHandlers.tooltip = { if (!Globals.bMobileDevice || bMobile) { - bi18n = 'on' === ($oEl.data('tooltip-i18n') || 'on'); sValue = !ko.isObservable(fValue) && _.isFunction(fValue) ? fValue() : ko.unwrap(fValue); oElement.__opentip = new Opentip(oElement, { @@ -171,7 +169,7 @@ ko.bindingHandlers.tooltip = { oElement.__opentip.activate(); } - if (bi18n) + if ('on' === ($oEl.data('tooltip-i18n') || 'on')) { Translator = require('Common/Translator'); @@ -207,8 +205,9 @@ ko.bindingHandlers.tooltip = { var sValue = !ko.isObservable(fValue) && _.isFunction(fValue) ? fValue() : ko.unwrap(fValue); if (sValue) { - var i18n = 'on' === ($oEl.data('tooltip-i18n') || 'on'); - oElement.__opentip.setContent(i18n ? require('Common/Translator').i18n(sValue) : sValue); + oElement.__opentip.setContent('on' === ($oEl.data('tooltip-i18n') || 'on') ? + require('Common/Translator').i18n(sValue) : sValue); + oElement.__opentip.activate(); } else diff --git a/dev/Promises/AbstractAjax.js b/dev/Promises/AbstractAjax.js index 5408be03c..c920cc532 100644 --- a/dev/Promises/AbstractAjax.js +++ b/dev/Promises/AbstractAjax.js @@ -90,7 +90,7 @@ AbstractAjaxPromises.prototype.ajaxRequest = function(sAction, bPost, iTimeOut, } // backward capability - var sType = Enums.StorageResultType.Error; + var sType = ''; switch (true) { case 'success' === sTextStatus && oData && oData.Result && sAction === oData.Action: diff --git a/dev/View/Popup/AddOpenPgpKey.js b/dev/View/Popup/AddOpenPgpKey.js index 9a78dc337..1a098caaa 100644 --- a/dev/View/Popup/AddOpenPgpKey.js +++ b/dev/View/Popup/AddOpenPgpKey.js @@ -46,13 +46,11 @@ function AddOpenPgpKeyPopupView() return false; } - var - done = false, - match = null; + var done = false; do { - match = reg.exec(keyTrimmed); + var match = reg.exec(keyTrimmed); if (match && 0 < count) { if (match[0] && match[1] && match[2] && match[1] === match[2]) diff --git a/dev/View/Popup/Compose.js b/dev/View/Popup/Compose.js index 110ee5594..c2a428a2e 100644 --- a/dev/View/Popup/Compose.js +++ b/dev/View/Popup/Compose.js @@ -1380,13 +1380,9 @@ ComposePopupView.prototype.onBuild = function() { this.initUploader(); - var - self = this, - oScript = null; + var self = this; - key('ctrl+q, command+q, ctrl+w, command+w', Enums.KeyState.Compose, function() { - return false; - }); + key('ctrl+q, command+q, ctrl+w, command+w', Enums.KeyState.Compose, Utils.noopFalse); key('`', Enums.KeyState.Compose, function() { if (self.oEditor && !self.oEditor.hasFocus() && !Utils.inFocus()) @@ -1437,7 +1433,7 @@ ComposePopupView.prototype.onBuild = function() if (this.dropboxEnabled() && this.dropboxApiKey() && !window.Dropbox) { - oScript = window.document.createElement('script'); + var oScript = window.document.createElement('script'); oScript.type = 'text/javascript'; oScript.src = 'https://www.dropbox.com/static/api/2/dropins.js'; $(oScript).attr('id', 'dropboxjs').attr('data-app-key', self.dropboxApiKey()); @@ -1690,8 +1686,9 @@ ComposePopupView.prototype.initUploader = function() this.dragAndDropVisible(false); }, this)) .on('onProgress', _.bind(function(sId, iLoaded, iTotal) { - var oItem = null; - if (Utils.isUnd(oUploadCache[sId])) + + var oItem = oUploadCache[sId]; + if (!oItem) { oItem = this.getAttachmentById(sId); if (oItem) @@ -1699,10 +1696,6 @@ ComposePopupView.prototype.initUploader = function() oUploadCache[sId] = oItem; } } - else - { - oItem = oUploadCache[sId]; - } if (oItem) { @@ -1740,10 +1733,8 @@ ComposePopupView.prototype.initUploader = function() }, this)) .on('onStart', _.bind(function(sId) { - var - oItem = null; - - if (Utils.isUnd(oUploadCache[sId])) + var oItem = oUploadCache[sId]; + if (!oItem) { oItem = this.getAttachmentById(sId); if (oItem) @@ -1751,10 +1742,6 @@ ComposePopupView.prototype.initUploader = function() oUploadCache[sId] = oItem; } } - else - { - oItem = oUploadCache[sId]; - } if (oItem) {