mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Added resources folder (Code refactoring)
This commit is contained in:
parent
25624c280d
commit
79a5c11556
60 changed files with 246 additions and 349 deletions
|
|
@ -1186,17 +1186,6 @@ RainLoopApp.prototype.bootstart = function ()
|
|||
RL.folderInformationMultiply(true);
|
||||
}, 500);
|
||||
|
||||
_.delay(function () {
|
||||
|
||||
RL.remote().servicesPics(function (sResult, oData) {
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
RL.cache().setServicesData(oData.Result);
|
||||
}
|
||||
});
|
||||
|
||||
}, 2000);
|
||||
|
||||
Plugins.runHook('rl-start-user-screens');
|
||||
RL.pub('rl.bootstart-user-screens');
|
||||
|
||||
|
|
|
|||
|
|
@ -115,6 +115,16 @@ LinkBuilder.prototype.messageDownloadLink = function (sRequestHash)
|
|||
return this.sServer + '/Raw/' + this.sSpecSuffix + '/Download/' + sRequestHash;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} sEmail
|
||||
* @return {string}
|
||||
*/
|
||||
LinkBuilder.prototype.avatarLink = function (sEmail)
|
||||
{
|
||||
return this.sServer + '/Raw/0/Avatar/' + window.encodeURIComponent(sEmail) + '/';
|
||||
// return '//secure.gravatar.com/avatar/' + Utils.md5(sEmail.toLowerCase()) + '.jpg?s=80&d=mm';
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {string}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
function AbstractCacheStorage()
|
||||
{
|
||||
this.oServices = {};
|
||||
this.bCapaGravatar = RL.capa(Enums.Capa.Gravatar);
|
||||
}
|
||||
|
||||
|
|
@ -21,7 +20,7 @@ AbstractCacheStorage.prototype.bCapaGravatar = false;
|
|||
|
||||
AbstractCacheStorage.prototype.clear = function ()
|
||||
{
|
||||
this.oServices = {};
|
||||
this.bCapaGravatar = !!this.bCapaGravatar; // TODO
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -31,30 +30,5 @@ AbstractCacheStorage.prototype.clear = function ()
|
|||
AbstractCacheStorage.prototype.getUserPic = function (sEmail, fCallback)
|
||||
{
|
||||
sEmail = Utils.trim(sEmail);
|
||||
|
||||
var
|
||||
sUrl = '',
|
||||
sService = '',
|
||||
sEmailLower = sEmail.toLowerCase()
|
||||
;
|
||||
|
||||
sService = sEmailLower.substr(sEmail.indexOf('@') + 1);
|
||||
sUrl = '' !== sService && this.oServices[sService] ? this.oServices[sService] : '';
|
||||
|
||||
if (this.bCapaGravatar && '' === sUrl && '' !== sEmailLower)
|
||||
{
|
||||
fCallback('//secure.gravatar.com/avatar/' + Utils.md5(sEmailLower) + '.jpg?s=80&d=mm', sEmail);
|
||||
}
|
||||
else
|
||||
{
|
||||
fCallback(sUrl, sEmail);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Object} oData
|
||||
*/
|
||||
AbstractCacheStorage.prototype.setServicesData = function (oData)
|
||||
{
|
||||
this.oServices = oData;
|
||||
fCallback(this.bCapaGravatar && '' !== sEmail ? RL.link().avatarLink(sEmail) : '', sEmail);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -733,14 +733,6 @@ WebMailAjaxRemoteStorage.prototype.suggestions = function (fCallback, sQuery, iP
|
|||
}, null, '', ['Suggestions']);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
WebMailAjaxRemoteStorage.prototype.servicesPics = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'ServicesPics');
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue