mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Gravatar
This commit is contained in:
parent
e5ded48d14
commit
3328bcd9eb
14 changed files with 88 additions and 30 deletions
|
|
@ -18,6 +18,7 @@ function AdminGeneral()
|
||||||
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
|
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
|
||||||
this.allowAdditionalAccounts = oData.allowAdditionalAccounts;
|
this.allowAdditionalAccounts = oData.allowAdditionalAccounts;
|
||||||
this.allowIdentities = oData.allowIdentities;
|
this.allowIdentities = oData.allowIdentities;
|
||||||
|
this.allowGravatar = oData.allowGravatar;
|
||||||
|
|
||||||
this.themesOptions = ko.computed(function () {
|
this.themesOptions = ko.computed(function () {
|
||||||
return _.map(oData.themes(), function (sTheme) {
|
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) {
|
self.allowThemes.subscribe(function (bValue) {
|
||||||
RL.remote().saveAdminConfig(null, {
|
RL.remote().saveAdminConfig(null, {
|
||||||
'AllowThemes': bValue ? '1' : '0'
|
'AllowThemes': bValue ? '1' : '0'
|
||||||
|
|
|
||||||
|
|
@ -937,6 +937,7 @@ Utils.initDataConstructorBySettings = function (oData)
|
||||||
oData.allowCustomTheme = ko.observable(false);
|
oData.allowCustomTheme = ko.observable(false);
|
||||||
oData.allowAdditionalAccounts = ko.observable(false);
|
oData.allowAdditionalAccounts = ko.observable(false);
|
||||||
oData.allowIdentities = ko.observable(false);
|
oData.allowIdentities = ko.observable(false);
|
||||||
|
oData.allowGravatar = ko.observable(false);
|
||||||
oData.determineUserLanguage = ko.observable(false);
|
oData.determineUserLanguage = ko.observable(false);
|
||||||
|
|
||||||
oData.messagesPerPage = ko.observable(Consts.Defaults.MessagesPerPage);//.extend({'throttle': 200});
|
oData.messagesPerPage = ko.observable(Consts.Defaults.MessagesPerPage);//.extend({'throttle': 200});
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ function AbstractCacheStorage()
|
||||||
{
|
{
|
||||||
this.oEmailsPicsHashes = {};
|
this.oEmailsPicsHashes = {};
|
||||||
this.oServices = {};
|
this.oServices = {};
|
||||||
|
this.bAllowGravatar = !!RL.settingsGet('AllowGravatar');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -19,6 +20,11 @@ AbstractCacheStorage.prototype.oEmailsPicsHashes = {};
|
||||||
*/
|
*/
|
||||||
AbstractCacheStorage.prototype.oServices = {};
|
AbstractCacheStorage.prototype.oServices = {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
AbstractCacheStorage.prototype.bAllowGravatar = false;
|
||||||
|
|
||||||
AbstractCacheStorage.prototype.clear = function ()
|
AbstractCacheStorage.prototype.clear = function ()
|
||||||
{
|
{
|
||||||
this.oServices = {};
|
this.oServices = {};
|
||||||
|
|
@ -51,14 +57,14 @@ AbstractCacheStorage.prototype.getUserPic = function (sEmail, fCallback)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// if ('' === sUrl) // Gravatar // TODO
|
if (this.bAllowGravatar && '' === sUrl)
|
||||||
// {
|
{
|
||||||
// fCallback('//secure.gravatar.com/avatar/' + Utils.md5(sEmailLower) + '.jpg?s=80&d=mm', sEmail);
|
fCallback('//secure.gravatar.com/avatar/' + Utils.md5(sEmailLower) + '.jpg?s=80&d=mm', sEmail);
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
fCallback(sUrl, sEmail);
|
fCallback(sUrl, sEmail);
|
||||||
// }
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ AbstractData.prototype.populateDataOnStart = function()
|
||||||
this.allowCustomTheme(!!RL.settingsGet('AllowCustomTheme'));
|
this.allowCustomTheme(!!RL.settingsGet('AllowCustomTheme'));
|
||||||
this.allowAdditionalAccounts(!!RL.settingsGet('AllowAdditionalAccounts'));
|
this.allowAdditionalAccounts(!!RL.settingsGet('AllowAdditionalAccounts'));
|
||||||
this.allowIdentities(!!RL.settingsGet('AllowIdentities'));
|
this.allowIdentities(!!RL.settingsGet('AllowIdentities'));
|
||||||
|
this.allowGravatar(!!RL.settingsGet('AllowGravatar'));
|
||||||
this.determineUserLanguage(!!RL.settingsGet('DetermineUserLanguage'));
|
this.determineUserLanguage(!!RL.settingsGet('DetermineUserLanguage'));
|
||||||
|
|
||||||
this.allowThemes(!!RL.settingsGet('AllowThemes'));
|
this.allowThemes(!!RL.settingsGet('AllowThemes'));
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,10 @@ label {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
label.inline {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
.legend {
|
.legend {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
||||||
|
|
@ -985,6 +985,7 @@ class Actions
|
||||||
'AllowAdditionalAccounts' => (bool) $oConfig->Get('webmail', 'allow_additional_accounts', true),
|
'AllowAdditionalAccounts' => (bool) $oConfig->Get('webmail', 'allow_additional_accounts', true),
|
||||||
'AllowIdentities' => (bool) $oConfig->Get('webmail', 'allow_identities', true),
|
'AllowIdentities' => (bool) $oConfig->Get('webmail', 'allow_identities', true),
|
||||||
'AllowPrefetch' => (bool) $oConfig->Get('labs', 'allow_prefetch', true),
|
'AllowPrefetch' => (bool) $oConfig->Get('labs', 'allow_prefetch', true),
|
||||||
|
'AllowGravatar' => (bool) $oConfig->Get('labs', 'allow_gravatar', true),
|
||||||
'AllowCustomLogin' => (bool) $oConfig->Get('login', 'allow_custom_login', false),
|
'AllowCustomLogin' => (bool) $oConfig->Get('login', 'allow_custom_login', false),
|
||||||
'LoginDefaultDomain' => $oConfig->Get('login', 'default_domain', ''),
|
'LoginDefaultDomain' => $oConfig->Get('login', 'default_domain', ''),
|
||||||
'DetermineUserLanguage' => (bool) $oConfig->Get('login', 'determine_user_language', true),
|
'DetermineUserLanguage' => (bool) $oConfig->Get('login', 'determine_user_language', true),
|
||||||
|
|
@ -2098,6 +2099,8 @@ class Actions
|
||||||
$this->setConfigFromParams($oConfig, 'AllowAdditionalAccounts', 'webmail', 'allow_additional_accounts', 'bool');
|
$this->setConfigFromParams($oConfig, 'AllowAdditionalAccounts', 'webmail', 'allow_additional_accounts', 'bool');
|
||||||
$this->setConfigFromParams($oConfig, 'AllowIdentities', 'webmail', 'allow_identities', 'bool');
|
$this->setConfigFromParams($oConfig, 'AllowIdentities', 'webmail', 'allow_identities', 'bool');
|
||||||
|
|
||||||
|
$this->setConfigFromParams($oConfig, 'AllowGravatar', 'labs', 'allow_gravatar', 'bool');
|
||||||
|
|
||||||
$this->setConfigFromParams($oConfig, 'DetermineUserLanguage', 'login', 'determine_user_language', 'bool');
|
$this->setConfigFromParams($oConfig, 'DetermineUserLanguage', 'login', 'determine_user_language', 'bool');
|
||||||
|
|
||||||
$this->setConfigFromParams($oConfig, 'Title', 'webmail', 'title', 'string');
|
$this->setConfigFromParams($oConfig, 'Title', 'webmail', 'title', 'string');
|
||||||
|
|
|
||||||
|
|
@ -212,6 +212,7 @@ Enables caching in the system'),
|
||||||
'Experimental settings. Handle with care.
|
'Experimental settings. Handle with care.
|
||||||
'),
|
'),
|
||||||
'check_new_password_strength' => array(true),
|
'check_new_password_strength' => array(true),
|
||||||
|
'allow_gravatar' => array(true),
|
||||||
'allow_prefetch' => array(true),
|
'allow_prefetch' => array(true),
|
||||||
'allow_smart_html_links' => array(true),
|
'allow_smart_html_links' => array(true),
|
||||||
'cache_system_data' => array(true),
|
'cache_system_data' => array(true),
|
||||||
|
|
|
||||||
|
|
@ -64,5 +64,14 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="controls">
|
||||||
|
<label class="inline" data-bind="click: function () { allowGravatar(!allowGravatar()); }">
|
||||||
|
<i data-bind="css: allowGravatar() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
|
||||||
|
Allow Gravatar
|
||||||
|
</label>
|
||||||
|
(<a class="g-ui-link" href="http://en.gravatar.com/" target="_blank">http://en.gravatar.com/</a>)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -6243,6 +6243,9 @@ body {
|
||||||
label {
|
label {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
label.inline {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
.legend {
|
.legend {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
||||||
2
rainloop/v/0.0.0/static/css/app.min.css
vendored
2
rainloop/v/0.0.0/static/css/app.min.css
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1661,6 +1661,7 @@ Utils.initDataConstructorBySettings = function (oData)
|
||||||
oData.allowCustomTheme = ko.observable(false);
|
oData.allowCustomTheme = ko.observable(false);
|
||||||
oData.allowAdditionalAccounts = ko.observable(false);
|
oData.allowAdditionalAccounts = ko.observable(false);
|
||||||
oData.allowIdentities = ko.observable(false);
|
oData.allowIdentities = ko.observable(false);
|
||||||
|
oData.allowGravatar = ko.observable(false);
|
||||||
oData.determineUserLanguage = ko.observable(false);
|
oData.determineUserLanguage = ko.observable(false);
|
||||||
|
|
||||||
oData.messagesPerPage = ko.observable(Consts.Defaults.MessagesPerPage);//.extend({'throttle': 200});
|
oData.messagesPerPage = ko.observable(Consts.Defaults.MessagesPerPage);//.extend({'throttle': 200});
|
||||||
|
|
@ -5769,6 +5770,7 @@ function AdminGeneral()
|
||||||
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
|
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
|
||||||
this.allowAdditionalAccounts = oData.allowAdditionalAccounts;
|
this.allowAdditionalAccounts = oData.allowAdditionalAccounts;
|
||||||
this.allowIdentities = oData.allowIdentities;
|
this.allowIdentities = oData.allowIdentities;
|
||||||
|
this.allowGravatar = oData.allowGravatar;
|
||||||
|
|
||||||
this.themesOptions = ko.computed(function () {
|
this.themesOptions = ko.computed(function () {
|
||||||
return _.map(oData.themes(), function (sTheme) {
|
return _.map(oData.themes(), function (sTheme) {
|
||||||
|
|
@ -5831,6 +5833,12 @@ AdminGeneral.prototype.onBuild = function ()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
self.allowGravatar.subscribe(function (bValue) {
|
||||||
|
RL.remote().saveAdminConfig(null, {
|
||||||
|
'AllowGravatar': bValue ? '1' : '0'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
self.allowThemes.subscribe(function (bValue) {
|
self.allowThemes.subscribe(function (bValue) {
|
||||||
RL.remote().saveAdminConfig(null, {
|
RL.remote().saveAdminConfig(null, {
|
||||||
'AllowThemes': bValue ? '1' : '0'
|
'AllowThemes': bValue ? '1' : '0'
|
||||||
|
|
@ -6842,6 +6850,7 @@ AbstractData.prototype.populateDataOnStart = function()
|
||||||
this.allowCustomTheme(!!RL.settingsGet('AllowCustomTheme'));
|
this.allowCustomTheme(!!RL.settingsGet('AllowCustomTheme'));
|
||||||
this.allowAdditionalAccounts(!!RL.settingsGet('AllowAdditionalAccounts'));
|
this.allowAdditionalAccounts(!!RL.settingsGet('AllowAdditionalAccounts'));
|
||||||
this.allowIdentities(!!RL.settingsGet('AllowIdentities'));
|
this.allowIdentities(!!RL.settingsGet('AllowIdentities'));
|
||||||
|
this.allowGravatar(!!RL.settingsGet('AllowGravatar'));
|
||||||
this.determineUserLanguage(!!RL.settingsGet('DetermineUserLanguage'));
|
this.determineUserLanguage(!!RL.settingsGet('DetermineUserLanguage'));
|
||||||
|
|
||||||
this.allowThemes(!!RL.settingsGet('AllowThemes'));
|
this.allowThemes(!!RL.settingsGet('AllowThemes'));
|
||||||
|
|
@ -7453,6 +7462,7 @@ function AbstractCacheStorage()
|
||||||
{
|
{
|
||||||
this.oEmailsPicsHashes = {};
|
this.oEmailsPicsHashes = {};
|
||||||
this.oServices = {};
|
this.oServices = {};
|
||||||
|
this.bAllowGravatar = !!RL.settingsGet('AllowGravatar');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -7465,6 +7475,11 @@ AbstractCacheStorage.prototype.oEmailsPicsHashes = {};
|
||||||
*/
|
*/
|
||||||
AbstractCacheStorage.prototype.oServices = {};
|
AbstractCacheStorage.prototype.oServices = {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
AbstractCacheStorage.prototype.bAllowGravatar = false;
|
||||||
|
|
||||||
AbstractCacheStorage.prototype.clear = function ()
|
AbstractCacheStorage.prototype.clear = function ()
|
||||||
{
|
{
|
||||||
this.oServices = {};
|
this.oServices = {};
|
||||||
|
|
@ -7497,14 +7512,14 @@ AbstractCacheStorage.prototype.getUserPic = function (sEmail, fCallback)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// if ('' === sUrl) // Gravatar // TODO
|
if (this.bAllowGravatar && '' === sUrl)
|
||||||
// {
|
{
|
||||||
// fCallback('//secure.gravatar.com/avatar/' + Utils.md5(sEmailLower) + '.jpg?s=80&d=mm', sEmail);
|
fCallback('//secure.gravatar.com/avatar/' + Utils.md5(sEmailLower) + '.jpg?s=80&d=mm', sEmail);
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
fCallback(sUrl, sEmail);
|
fCallback(sUrl, sEmail);
|
||||||
// }
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
8
rainloop/v/0.0.0/static/js/admin.min.js
vendored
8
rainloop/v/0.0.0/static/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1665,6 +1665,7 @@ Utils.initDataConstructorBySettings = function (oData)
|
||||||
oData.allowCustomTheme = ko.observable(false);
|
oData.allowCustomTheme = ko.observable(false);
|
||||||
oData.allowAdditionalAccounts = ko.observable(false);
|
oData.allowAdditionalAccounts = ko.observable(false);
|
||||||
oData.allowIdentities = ko.observable(false);
|
oData.allowIdentities = ko.observable(false);
|
||||||
|
oData.allowGravatar = ko.observable(false);
|
||||||
oData.determineUserLanguage = ko.observable(false);
|
oData.determineUserLanguage = ko.observable(false);
|
||||||
|
|
||||||
oData.messagesPerPage = ko.observable(Consts.Defaults.MessagesPerPage);//.extend({'throttle': 200});
|
oData.messagesPerPage = ko.observable(Consts.Defaults.MessagesPerPage);//.extend({'throttle': 200});
|
||||||
|
|
@ -15188,6 +15189,7 @@ AbstractData.prototype.populateDataOnStart = function()
|
||||||
this.allowCustomTheme(!!RL.settingsGet('AllowCustomTheme'));
|
this.allowCustomTheme(!!RL.settingsGet('AllowCustomTheme'));
|
||||||
this.allowAdditionalAccounts(!!RL.settingsGet('AllowAdditionalAccounts'));
|
this.allowAdditionalAccounts(!!RL.settingsGet('AllowAdditionalAccounts'));
|
||||||
this.allowIdentities(!!RL.settingsGet('AllowIdentities'));
|
this.allowIdentities(!!RL.settingsGet('AllowIdentities'));
|
||||||
|
this.allowGravatar(!!RL.settingsGet('AllowGravatar'));
|
||||||
this.determineUserLanguage(!!RL.settingsGet('DetermineUserLanguage'));
|
this.determineUserLanguage(!!RL.settingsGet('DetermineUserLanguage'));
|
||||||
|
|
||||||
this.allowThemes(!!RL.settingsGet('AllowThemes'));
|
this.allowThemes(!!RL.settingsGet('AllowThemes'));
|
||||||
|
|
@ -17557,6 +17559,7 @@ function AbstractCacheStorage()
|
||||||
{
|
{
|
||||||
this.oEmailsPicsHashes = {};
|
this.oEmailsPicsHashes = {};
|
||||||
this.oServices = {};
|
this.oServices = {};
|
||||||
|
this.bAllowGravatar = !!RL.settingsGet('AllowGravatar');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -17569,6 +17572,11 @@ AbstractCacheStorage.prototype.oEmailsPicsHashes = {};
|
||||||
*/
|
*/
|
||||||
AbstractCacheStorage.prototype.oServices = {};
|
AbstractCacheStorage.prototype.oServices = {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
AbstractCacheStorage.prototype.bAllowGravatar = false;
|
||||||
|
|
||||||
AbstractCacheStorage.prototype.clear = function ()
|
AbstractCacheStorage.prototype.clear = function ()
|
||||||
{
|
{
|
||||||
this.oServices = {};
|
this.oServices = {};
|
||||||
|
|
@ -17601,14 +17609,14 @@ AbstractCacheStorage.prototype.getUserPic = function (sEmail, fCallback)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// if ('' === sUrl) // Gravatar // TODO
|
if (this.bAllowGravatar && '' === sUrl)
|
||||||
// {
|
{
|
||||||
// fCallback('//secure.gravatar.com/avatar/' + Utils.md5(sEmailLower) + '.jpg?s=80&d=mm', sEmail);
|
fCallback('//secure.gravatar.com/avatar/' + Utils.md5(sEmailLower) + '.jpg?s=80&d=mm', sEmail);
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
fCallback(sUrl, sEmail);
|
fCallback(sUrl, sEmail);
|
||||||
// }
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
8
rainloop/v/0.0.0/static/js/app.min.js
vendored
8
rainloop/v/0.0.0/static/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue