This commit is contained in:
RainLoop Team 2014-05-05 00:36:48 +04:00
parent e5ded48d14
commit 3328bcd9eb
14 changed files with 88 additions and 30 deletions

View file

@ -18,6 +18,7 @@ function AdminGeneral()
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
this.allowAdditionalAccounts = oData.allowAdditionalAccounts;
this.allowIdentities = oData.allowIdentities;
this.allowGravatar = oData.allowGravatar;
this.themesOptions = ko.computed(function () {
return _.map(oData.themes(), function (sTheme) {
@ -80,6 +81,12 @@ AdminGeneral.prototype.onBuild = function ()
});
});
self.allowGravatar.subscribe(function (bValue) {
RL.remote().saveAdminConfig(null, {
'AllowGravatar': bValue ? '1' : '0'
});
});
self.allowThemes.subscribe(function (bValue) {
RL.remote().saveAdminConfig(null, {
'AllowThemes': bValue ? '1' : '0'

View file

@ -937,6 +937,7 @@ Utils.initDataConstructorBySettings = function (oData)
oData.allowCustomTheme = ko.observable(false);
oData.allowAdditionalAccounts = ko.observable(false);
oData.allowIdentities = ko.observable(false);
oData.allowGravatar = ko.observable(false);
oData.determineUserLanguage = ko.observable(false);
oData.messagesPerPage = ko.observable(Consts.Defaults.MessagesPerPage);//.extend({'throttle': 200});

View file

@ -7,6 +7,7 @@ function AbstractCacheStorage()
{
this.oEmailsPicsHashes = {};
this.oServices = {};
this.bAllowGravatar = !!RL.settingsGet('AllowGravatar');
}
/**
@ -19,6 +20,11 @@ AbstractCacheStorage.prototype.oEmailsPicsHashes = {};
*/
AbstractCacheStorage.prototype.oServices = {};
/**
* @type {boolean}
*/
AbstractCacheStorage.prototype.bAllowGravatar = false;
AbstractCacheStorage.prototype.clear = function ()
{
this.oServices = {};
@ -51,14 +57,14 @@ AbstractCacheStorage.prototype.getUserPic = function (sEmail, fCallback)
}
// if ('' === sUrl) // Gravatar // TODO
// {
// fCallback('//secure.gravatar.com/avatar/' + Utils.md5(sEmailLower) + '.jpg?s=80&d=mm', sEmail);
// }
// else
// {
if (this.bAllowGravatar && '' === sUrl)
{
fCallback('//secure.gravatar.com/avatar/' + Utils.md5(sEmailLower) + '.jpg?s=80&d=mm', sEmail);
}
else
{
fCallback(sUrl, sEmail);
// }
}
};
/**

View file

@ -87,6 +87,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.allowCustomTheme(!!RL.settingsGet('AllowCustomTheme'));
this.allowAdditionalAccounts(!!RL.settingsGet('AllowAdditionalAccounts'));
this.allowIdentities(!!RL.settingsGet('AllowIdentities'));
this.allowGravatar(!!RL.settingsGet('AllowGravatar'));
this.determineUserLanguage(!!RL.settingsGet('DetermineUserLanguage'));
this.allowThemes(!!RL.settingsGet('AllowThemes'));

View file

@ -7,6 +7,10 @@ label {
cursor: pointer;
}
label.inline {
display: inline-block;
}
.legend {
display: block;
width: 100%;