Small fixes

This commit is contained in:
RainLoop Team 2014-09-19 19:24:38 +04:00
parent 1066af98d4
commit 86dc0c653b
5 changed files with 27 additions and 21 deletions

View file

@ -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;
};

View file

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

View file

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

View file

@ -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

View file

@ -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',