diff --git a/dev/App/Abstract.js b/dev/App/Abstract.js index b53785a64..96a6ce2bc 100644 --- a/dev/App/Abstract.js +++ b/dev/App/Abstract.js @@ -125,7 +125,7 @@ sTitle = ((Utils.isNormal(sTitle) && 0 < sTitle.length) ? sTitle + ' - ' : '') + Settings.settingsGet('Title') || ''; - window.document.title = '_'; + window.document.title = ''; window.document.title = sTitle; }; diff --git a/dev/App/Admin.js b/dev/App/Admin.js index 1c3ca7354..15c10514a 100644 --- a/dev/App/Admin.js +++ b/dev/App/Admin.js @@ -7,6 +7,7 @@ window = require('window'), _ = require('_'), ko = require('ko'), + SimplePace = require('SimplePace'), Enums = require('Common/Enums'), Utils = require('Common/Utils'), @@ -263,9 +264,9 @@ } } - if (window.SimplePace) + if (SimplePace) { - window.SimplePace.set(100); + SimplePace.set(100); } }; diff --git a/dev/App/App.js b/dev/App/App.js index fcbb45587..9f0a8ddbb 100644 --- a/dev/App/App.js +++ b/dev/App/App.js @@ -8,6 +8,7 @@ _ = require('_'), $ = require('$'), moment = require('moment'), + SimplePace = require('SimplePace'), Enums = require('Common/Enums'), Globals = require('Common/Globals'), @@ -1257,6 +1258,7 @@ var self = this, + $LAB = require('$LAB'), sJsHash = Settings.settingsGet('JsHash'), iContactsSyncInterval = Utils.pInt(Settings.settingsGet('ContactsSyncInterval')), bGoogle = Settings.settingsGet('AllowGoogleSocial'), @@ -1284,10 +1286,10 @@ }, this); - if (window.SimplePace) + if (SimplePace) { - window.SimplePace.set(70); - window.SimplePace.sleep(); + SimplePace.set(70); + SimplePace.sleep(); } Globals.leftPanelDisabled.subscribe(function (bValue) { @@ -1304,9 +1306,9 @@ if (bValue) { - if (window.$LAB && window.crypto && window.crypto.getRandomValues && Settings.capa(Enums.Capa.OpenPGP)) + if ($LAB && window.crypto && window.crypto.getRandomValues && Settings.capa(Enums.Capa.OpenPGP)) { - window.$LAB.script(window.openpgp ? '' : LinkBuilder.openPgpJs()).wait(function () { + $LAB.script(window.openpgp ? '' : LinkBuilder.openPgpJs()).wait(function () { if (window.openpgp) { Data.openpgp = window.openpgp; @@ -1405,9 +1407,9 @@ self.bootstartLoginScreen(); } - if (window.SimplePace) + if (SimplePace) { - window.SimplePace.set(100); + SimplePace.set(100); } }, self)); @@ -1416,9 +1418,9 @@ { this.bootstartLoginScreen(); - if (window.SimplePace) + if (SimplePace) { - window.SimplePace.set(100); + SimplePace.set(100); } } diff --git a/dev/Common/Utils.js b/dev/Common/Utils.js index cd3548374..69bfaa9fd 100644 --- a/dev/Common/Utils.js +++ b/dev/Common/Utils.js @@ -13,6 +13,7 @@ $ = require('$'), ko = require('ko'), Autolinker = require('Autolinker'), + JSEncrypt = require('JSEncrypt'), Enums = require('Common/Enums'), Consts = require('Common/Consts'), @@ -177,8 +178,8 @@ */ Utils.rsaObject = function (sPublicKey) { - if (sPublicKey && (null === oEncryptObject || (oEncryptObject && oEncryptObject.__sPublicKey !== sPublicKey)) && - window.crypto && window.crypto.getRandomValues && window.JSEncrypt) + if (JSEncrypt && sPublicKey && (null === oEncryptObject || (oEncryptObject && oEncryptObject.__sPublicKey !== sPublicKey)) && + window.crypto && window.crypto.getRandomValues) { oEncryptObject = new JSEncrypt(); oEncryptObject.setPublicKey(sPublicKey); @@ -199,7 +200,7 @@ */ Utils.rsaEncode = function (sValue, sPublicKey) { - if (window.crypto && window.crypto.getRandomValues && window.JSEncrypt && sPublicKey) + if (window.crypto && window.crypto.getRandomValues && sPublicKey) { var sResultValue = false, @@ -209,18 +210,17 @@ if (oEncrypt) { sResultValue = oEncrypt.encrypt(Utils.fakeMd5() + ':' + sValue + ':' + Utils.fakeMd5()) - } - - if (false !== sResultValue && Utils.isNormal(sResultValue)) - { - return 'rsa:xxx:' + sResultValue; + if (false !== sResultValue && Utils.isNormal(sResultValue)) + { + return 'rsa:xxx:' + sResultValue; + } } } return sValue; }; - Utils.rsaEncode.supported = !!(window.crypto && window.crypto.getRandomValues && window.JSEncrypt); + Utils.rsaEncode.supported = !!(window.crypto && window.crypto.getRandomValues && JSEncrypt); /** * @param {string} sText diff --git a/webpack.config.js b/webpack.config.js index cc3d24c5d..ffecff91f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -25,6 +25,9 @@ module.exports = { externals: { 'window': 'window', 'JSON': 'JSON', + 'JSEncrypt': 'window.JSEncrypt', + '$LAB': 'window.$LAB', + 'SimplePace': 'window.SimplePace', 'moment': 'moment', 'ifvisible': 'ifvisible', 'crossroads': 'crossroads',