Added resources folder (Code refactoring)
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -528,6 +528,11 @@ class Http
|
|||
public function SaveUrlToFile($sUrl, $rFile, $sCustomUserAgent = 'MailSo Http User Agent (v1)', &$sContentType = '', &$iCode = 0,
|
||||
$oLogger = null, $iTimeout = 10, $sProxy = '', $sProxyAuth = '', $aHttpHeaders = array())
|
||||
{
|
||||
if (null === $sCustomUserAgent)
|
||||
{
|
||||
$sCustomUserAgent = 'MailSo Http User Agent (v1)';
|
||||
}
|
||||
|
||||
if (!is_resource($rFile))
|
||||
{
|
||||
if ($oLogger)
|
||||
|
|
|
|||
|
|
@ -5478,22 +5478,6 @@ class Actions
|
|||
return $this->DefaultResponse(__FUNCTION__, $aResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function DoServicesPics()
|
||||
{
|
||||
$aData = \RainLoop\Utils::ServicesPics();
|
||||
$aResult = array();
|
||||
|
||||
foreach ($aData as $sDomain => $sPic)
|
||||
{
|
||||
$aResult[$sDomain] = APP_WEB_STATIC_PATH.'services/'.$sPic;
|
||||
}
|
||||
|
||||
return $this->DefaultResponse(__FUNCTION__, $aResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
|
@ -6493,6 +6477,60 @@ class Actions
|
|||
return $this->rawSmart(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function RawAvatar()
|
||||
{
|
||||
$sData = '';
|
||||
|
||||
$sRawKey = (string) $this->GetActionParam('RawKey', '');
|
||||
$sRawKey = \urldecode($sRawKey);
|
||||
|
||||
$this->verifyCacheByKey($sRawKey);
|
||||
|
||||
if (0 < \strlen($sRawKey) && \preg_match('/^[^@]+@([^@]+)$/', $sRawKey))
|
||||
{
|
||||
$sEmail = \MailSo\Base\Utils::IdnToAscii($sRawKey, true);
|
||||
|
||||
$iCode = 0;
|
||||
$sContentType = '';
|
||||
|
||||
$sData = $this->Http()->GetUrlAsString('http://gravatar.com/avatar/'.\md5($sEmail).'.jpg?s=80&d=404',
|
||||
null, $sContentType, $iCode, $this->Logger(), 5,
|
||||
$this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', ''));
|
||||
|
||||
$sContentType = \strtolower(\trim($sContentType));
|
||||
if (200 !== $iCode || empty($sData) ||
|
||||
!\in_array($sContentType, array('image/jpeg', 'image/jpg', 'image/png')))
|
||||
{
|
||||
$sData = '';
|
||||
|
||||
$aMatch = array();
|
||||
if (\preg_match('/^[^@]+@([a-z0-9\-\.]+)$/', $sEmail, $aMatch) && !empty($aMatch[1]))
|
||||
{
|
||||
$sDomain = $aMatch[1];
|
||||
if (\file_exists(APP_VERSION_ROOT_PATH.'app/resources/images/services/'.$sDomain.'.png'))
|
||||
{
|
||||
$sContentType = 'image/png';
|
||||
$sData = \file_get_contents(APP_VERSION_ROOT_PATH.'app/resources/images/services/'.$sDomain.'.png');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($sData) || empty($sContentType))
|
||||
{
|
||||
$sContentType = 'image/png';
|
||||
$sData = \file_get_contents(APP_VERSION_ROOT_PATH.'app/resources/images/empty-contact.png');
|
||||
}
|
||||
|
||||
$this->cacheByKey($sRawKey);
|
||||
\header('Content-Type: '.$sContentType);
|
||||
echo $sData;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -305,66 +305,6 @@ class Utils
|
|||
@\setcookie($sName, '', \time() - 3600 * 24 * 30, '/');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function ServicesPics()
|
||||
{
|
||||
return array(
|
||||
'ebay.com' => 'ebay.jpg',
|
||||
'reply.ebay.com' => 'ebay.jpg',
|
||||
'reply1.ebay.com' => 'ebay.jpg',
|
||||
'reply2.ebay.com' => 'ebay.jpg',
|
||||
'reply3.ebay.com' => 'ebay.jpg',
|
||||
|
||||
'facebook.com' => 'facebook.png',
|
||||
'facebookmail.com' => 'facebook.png',
|
||||
|
||||
'cnet.online.com' => 'cnet.jpg',
|
||||
'github.com' => 'github.png',
|
||||
'steampowered.com' => 'steam.png',
|
||||
'myspace.com' => 'myspace.png',
|
||||
'new.myspace.com' => 'myspace.png',
|
||||
'youtube.com' => 'youtube.gif',
|
||||
'amazon.com' => 'amazon.png',
|
||||
'ted.com' => 'ted.png',
|
||||
'google.com' => 'google.png',
|
||||
'plus.google.com' => 'google-plus.png',
|
||||
|
||||
'email.microsoft.com' => 'microsoft.jpg',
|
||||
'microsoftonline.com' => 'microsoft.jpg',
|
||||
'microsoft.com' => 'microsoft.jpg',
|
||||
|
||||
'paypal.com' => 'paypal.jpg',
|
||||
'intl.paypal.com' => 'paypal.jpg',
|
||||
'e.paypal.com' => 'paypal.jpg',
|
||||
|
||||
'ea.com' => 'ea.png',
|
||||
'em.ea.com' => 'ea.png',
|
||||
'battlefieldheroes.com' => 'ea.png',
|
||||
|
||||
'battle.net' => 'battle.net.png',
|
||||
'blizzard.com' => 'battle.net.png',
|
||||
'email.blizzard.com' => 'battle.net.png',
|
||||
'battlefieldheroes.com' => 'battle.net.png',
|
||||
|
||||
'twitter.com' => 'twitter.jpg',
|
||||
'postmaster.twitter.com' => 'twitter.jpg',
|
||||
|
||||
'skype.com' => 'skype.png',
|
||||
'email.skype.com' => 'skype.png',
|
||||
|
||||
'apple.com' => 'apple.jpg',
|
||||
'id.apple.com' => 'apple.jpg',
|
||||
|
||||
'onlive.com' => 'onlive.png',
|
||||
'news.onlive.com' => 'onlive.png',
|
||||
|
||||
'asana.com' => 'asana.png',
|
||||
'connect.asana.com' => 'asana.png',
|
||||
);
|
||||
}
|
||||
|
||||
public static function CustomBaseConvert($sNumberInput, $sFromBaseInput = '0123456789', $sToBaseInput = '0123456789')
|
||||
{
|
||||
if ($sFromBaseInput === $sToBaseInput)
|
||||
|
|
|
|||
BIN
rainloop/v/0.0.0/app/resources/images/empty-contact.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/apple.com.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 995 B After Width: | Height: | Size: 995 B |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/blizzard.com.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 995 B |
BIN
rainloop/v/0.0.0/app/resources/images/services/e.paypal.com.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 6 KiB After Width: | Height: | Size: 6 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/ebay.com.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/em.ea.com.png
Normal file
|
After Width: | Height: | Size: 6 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
|
After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/id.apple.com.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/microsoft.com.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/onlive.com.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/paypal.com.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/skype.com.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/twitter.com.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/youtube.com.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
|
|
@ -4007,6 +4007,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}
|
||||
*/
|
||||
|
|
@ -8282,7 +8292,6 @@ AdminAjaxRemoteStorage.prototype.adminPing = function (fCallback)
|
|||
*/
|
||||
function AbstractCacheStorage()
|
||||
{
|
||||
this.oServices = {};
|
||||
this.bCapaGravatar = RL.capa(Enums.Capa.Gravatar);
|
||||
}
|
||||
|
||||
|
|
@ -8298,7 +8307,7 @@ AbstractCacheStorage.prototype.bCapaGravatar = false;
|
|||
|
||||
AbstractCacheStorage.prototype.clear = function ()
|
||||
{
|
||||
this.oServices = {};
|
||||
this.bCapaGravatar = !!this.bCapaGravatar; // TODO
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -8308,32 +8317,7 @@ 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);
|
||||
};
|
||||
|
||||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
|
|
|
|||
8
rainloop/v/0.0.0/static/js/admin.min.js
vendored
|
|
@ -4010,6 +4010,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}
|
||||
*/
|
||||
|
|
@ -18879,14 +18889,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
|
||||
*/
|
||||
|
|
@ -18951,7 +18953,6 @@ WebMailAjaxRemoteStorage.prototype.socialUsers = function (fCallback)
|
|||
*/
|
||||
function AbstractCacheStorage()
|
||||
{
|
||||
this.oServices = {};
|
||||
this.bCapaGravatar = RL.capa(Enums.Capa.Gravatar);
|
||||
}
|
||||
|
||||
|
|
@ -18967,7 +18968,7 @@ AbstractCacheStorage.prototype.bCapaGravatar = false;
|
|||
|
||||
AbstractCacheStorage.prototype.clear = function ()
|
||||
{
|
||||
this.oServices = {};
|
||||
this.bCapaGravatar = !!this.bCapaGravatar; // TODO
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -18977,32 +18978,7 @@ 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);
|
||||
};
|
||||
|
||||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
|
|
@ -21273,17 +21249,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');
|
||||
|
||||
|
|
|
|||
8
rainloop/v/0.0.0/static/js/app.min.js
vendored
|
Before Width: | Height: | Size: 807 B |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |