mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-26 09:03:48 +08:00
Added "use_local_proxy_for_external_images" setting (Closes #211)
This commit is contained in:
parent
a19e19d866
commit
3ae18e76c6
16 changed files with 230 additions and 43 deletions
|
@ -93,6 +93,10 @@
|
|||
<param name="plugin-name" value="override-smtp-credentials"/>
|
||||
</antcall>
|
||||
</target>
|
||||
|
||||
<target name="custom-login-mapping">
|
||||
<antcall target="_build_plugin_">
|
||||
<param name="plugin-name" value="custom-login-mapping"/>
|
||||
</antcall>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
*/
|
||||
function AdminSecurity()
|
||||
{
|
||||
this.useLocalProxyForExternalImages = RL.data().useLocalProxyForExternalImages;
|
||||
|
||||
this.capaOpenPGP = ko.observable(RL.capa(Enums.Capa.OpenPGP));
|
||||
this.capaTwoFactorAuth = ko.observable(RL.capa(Enums.Capa.TwoFactor));
|
||||
|
||||
|
@ -88,6 +90,12 @@ AdminSecurity.prototype.onBuild = function ()
|
|||
'CapaTwoFactorAuth': bValue ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.useLocalProxyForExternalImages.subscribe(function (bValue) {
|
||||
RL.remote().saveAdminConfig(null, {
|
||||
'UseLocalProxyForExternalImages': bValue ? '1' : '0'
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
AdminSecurity.prototype.onHide = function ()
|
||||
|
|
|
@ -777,6 +777,8 @@ Utils.initDataConstructorBySettings = function (oData)
|
|||
oData.capaThemes = ko.observable(false);
|
||||
oData.allowLanguagesOnSettings = ko.observable(true);
|
||||
oData.allowLanguagesOnLogin = ko.observable(true);
|
||||
|
||||
oData.useLocalProxyForExternalImages = ko.observable(false);
|
||||
|
||||
oData.desktopNotifications = ko.observable(false);
|
||||
oData.useThreads = ko.observable(true);
|
||||
|
|
|
@ -14,6 +14,8 @@ function MessageModel()
|
|||
this.dateTimeStampInUTC = ko.observable(0);
|
||||
this.priority = ko.observable(Enums.MessagePriority.Normal);
|
||||
|
||||
this.proxy = false;
|
||||
|
||||
this.fromEmailString = ko.observable('');
|
||||
this.toEmailsString = ko.observable('');
|
||||
this.senderEmailsString = ko.observable('');
|
||||
|
@ -232,6 +234,8 @@ MessageModel.prototype.clear = function ()
|
|||
this.dateTimeStampInUTC(0);
|
||||
this.priority(Enums.MessagePriority.Normal);
|
||||
|
||||
this.proxy = false;
|
||||
|
||||
this.fromEmailString('');
|
||||
this.toEmailsString('');
|
||||
this.senderEmailsString('');
|
||||
|
@ -312,6 +316,8 @@ MessageModel.prototype.initByJson = function (oJsonMessage)
|
|||
this.hash = oJsonMessage.Hash;
|
||||
this.requestHash = oJsonMessage.RequestHash;
|
||||
|
||||
this.proxy = !!oJsonMessage.ExternalProxy;
|
||||
|
||||
this.size(Utils.pInt(oJsonMessage.Size));
|
||||
|
||||
this.from = MessageModel.initEmailsFromJson(oJsonMessage.From);
|
||||
|
@ -365,6 +371,8 @@ MessageModel.prototype.initUpdateByMessageJson = function (oJsonMessage)
|
|||
this.sInReplyTo = oJsonMessage.InReplyTo;
|
||||
this.sReferences = oJsonMessage.References;
|
||||
|
||||
this.proxy = !!oJsonMessage.ExternalProxy;
|
||||
|
||||
if (RL.data().capaOpenPGP())
|
||||
{
|
||||
this.isPgpSigned(!!oJsonMessage.PgpSigned);
|
||||
|
@ -807,6 +815,8 @@ MessageModel.prototype.populateByMessageListItem = function (oMessage)
|
|||
this.dateTimeStampInUTC(oMessage.dateTimeStampInUTC());
|
||||
this.priority(oMessage.priority());
|
||||
|
||||
this.proxy = oMessage.proxy;
|
||||
|
||||
this.fromEmailString(oMessage.fromEmailString());
|
||||
this.toEmailsString(oMessage.toEmailsString());
|
||||
|
||||
|
@ -860,30 +870,33 @@ MessageModel.prototype.showExternalImages = function (bLazy)
|
|||
{
|
||||
if (this.body && this.body.data('rl-has-images'))
|
||||
{
|
||||
var sAttr = '';
|
||||
bLazy = Utils.isUnd(bLazy) ? false : bLazy;
|
||||
|
||||
this.hasImages(false);
|
||||
this.body.data('rl-has-images', false);
|
||||
|
||||
$('[data-x-src]', this.body).each(function () {
|
||||
sAttr = this.proxy ? 'data-x-additional-src' : 'data-x-src';
|
||||
$('[' + sAttr + ']', this.body).each(function () {
|
||||
if (bLazy && $(this).is('img'))
|
||||
{
|
||||
$(this)
|
||||
.addClass('lazy')
|
||||
.attr('data-original', $(this).attr('data-x-src'))
|
||||
.removeAttr('data-x-src')
|
||||
.attr('data-original', $(this).attr(sAttr))
|
||||
.removeAttr(sAttr)
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).attr('src', $(this).attr('data-x-src')).removeAttr('data-x-src');
|
||||
$(this).attr('src', $(this).attr(sAttr)).removeAttr(sAttr);
|
||||
}
|
||||
});
|
||||
|
||||
$('[data-x-style-url]', this.body).each(function () {
|
||||
sAttr = this.proxy ? 'data-x-additional-style-url' : 'data-x-style-url';
|
||||
$('[' + sAttr + ']', this.body).each(function () {
|
||||
var sStyle = Utils.trim($(this).attr('style'));
|
||||
sStyle = '' === sStyle ? '' : (';' === sStyle.substr(-1) ? sStyle + ' ' : sStyle + '; ');
|
||||
$(this).attr('style', sStyle + $(this).attr('data-x-style-url')).removeAttr('data-x-style-url');
|
||||
$(this).attr('style', sStyle + $(this).attr(sAttr)).removeAttr(sAttr);
|
||||
});
|
||||
|
||||
if (bLazy)
|
||||
|
|
|
@ -7,10 +7,10 @@ function AbstractData()
|
|||
{
|
||||
this.leftPanelDisabled = ko.observable(false);
|
||||
this.useKeyboardShortcuts = ko.observable(true);
|
||||
|
||||
|
||||
this.keyScopeReal = ko.observable(Enums.KeyState.All);
|
||||
this.keyScopeFake = ko.observable(Enums.KeyState.All);
|
||||
|
||||
|
||||
this.keyScope = ko.computed({
|
||||
'owner': this,
|
||||
'read': function () {
|
||||
|
@ -35,11 +35,11 @@ function AbstractData()
|
|||
sValue = Enums.KeyState.Menu;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.keyScopeReal(sValue);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.keyScopeReal.subscribe(function (sValue) {
|
||||
// window.console.log(sValue);
|
||||
key.setScope(sValue);
|
||||
|
@ -93,6 +93,7 @@ AbstractData.prototype.populateDataOnStart = function()
|
|||
this.capaThemes(RL.capa(Enums.Capa.Themes));
|
||||
this.allowLanguagesOnLogin(!!RL.settingsGet('AllowLanguagesOnLogin'));
|
||||
this.allowLanguagesOnSettings(!!RL.settingsGet('AllowLanguagesOnSettings'));
|
||||
this.useLocalProxyForExternalImages(!!RL.settingsGet('UseLocalProxyForExternalImages'));
|
||||
|
||||
this.editorDefaultType(RL.settingsGet('EditorDefaultType'));
|
||||
this.showImages(!!RL.settingsGet('ShowImages'));
|
||||
|
@ -105,7 +106,7 @@ AbstractData.prototype.populateDataOnStart = function()
|
|||
this.useThreads(!!RL.settingsGet('UseThreads'));
|
||||
this.replySameFolder(!!RL.settingsGet('ReplySameFolder'));
|
||||
this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList'));
|
||||
|
||||
|
||||
this.layout(Enums.Layout.SidePreview);
|
||||
if (-1 < Utils.inArray(mLayout, [Enums.Layout.NoPreview, Enums.Layout.SidePreview, Enums.Layout.BottomPreview]))
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "RainLoop",
|
||||
"title": "RainLoop Webmail",
|
||||
"version": "1.6.7",
|
||||
"release": "133",
|
||||
"release": "134",
|
||||
"description": "Simple, modern & fast web-based email client",
|
||||
"homepage": "http://rainloop.net",
|
||||
"main": "gulpfile.js",
|
||||
|
|
1
plugins/custom-login-mapping/README
Normal file
1
plugins/custom-login-mapping/README
Normal file
|
@ -0,0 +1 @@
|
|||
Plugin which allows you to set up custom username by email address
|
|
@ -150,16 +150,22 @@ class HtmlUtils
|
|||
* @param array $aContentLocationUrls
|
||||
* @param array $aFoundedContentLocationUrls
|
||||
* @param bool $bDoNotReplaceExternalUrl = false
|
||||
* @param callback|null $fAdditionalExternalFilter = null
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function ClearStyle($sStyle, $oElement, &$bHasExternals, &$aFoundCIDs,
|
||||
$aContentLocationUrls, &$aFoundedContentLocationUrls, $bDoNotReplaceExternalUrl = false)
|
||||
$aContentLocationUrls, &$aFoundedContentLocationUrls, $bDoNotReplaceExternalUrl = false, $fAdditionalExternalFilter = null)
|
||||
{
|
||||
$sStyle = \trim($sStyle);
|
||||
$aOutStyles = array();
|
||||
$aStyles = \explode(';', $sStyle);
|
||||
|
||||
if ($fAdditionalExternalFilter && !\is_callable($fAdditionalExternalFilter))
|
||||
{
|
||||
$fAdditionalExternalFilter = null;
|
||||
}
|
||||
|
||||
$aMatch = array();
|
||||
foreach ($aStyles as $sStyleItem)
|
||||
{
|
||||
|
@ -236,6 +242,16 @@ class HtmlUtils
|
|||
|
||||
$oElement->setAttribute('data-x-style-url', \trim($sTemp.
|
||||
('background' === $sName ? 'background-image' : $sName).': '.$sFullUrl, ' ;'));
|
||||
|
||||
if ($fAdditionalExternalFilter)
|
||||
{
|
||||
$sAdditionalResult = \call_user_func($fAdditionalExternalFilter, $sUrl);
|
||||
if (0 < \strlen($sAdditionalResult))
|
||||
{
|
||||
$oElement->setAttribute('data-x-additional-style-url',
|
||||
('background' === $sName ? 'background-image' : $sName).': url('.$sAdditionalResult.')');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ('data:image/' !== \strtolower(\substr(\trim($sUrl), 0, 11)))
|
||||
|
@ -382,12 +398,13 @@ class HtmlUtils
|
|||
* @param array $aFoundedContentLocationUrls = array()
|
||||
* @param bool $bDoNotReplaceExternalUrl = false
|
||||
* @param bool $bFindLinksInHtml = false
|
||||
* @param callback|null $fAdditionalExternalFilter = null
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function ClearHtml($sHtml, &$bHasExternals = false, &$aFoundCIDs = array(),
|
||||
$aContentLocationUrls = array(), &$aFoundedContentLocationUrls = array(),
|
||||
$bDoNotReplaceExternalUrl = false, $bFindLinksInHtml = false)
|
||||
$bDoNotReplaceExternalUrl = false, $bFindLinksInHtml = false, $fAdditionalExternalFilter = null)
|
||||
{
|
||||
$sHtml = null === $sHtml ? '' : (string) $sHtml;
|
||||
$sHtml = \trim($sHtml);
|
||||
|
@ -396,6 +413,11 @@ class HtmlUtils
|
|||
return '';
|
||||
}
|
||||
|
||||
if ($fAdditionalExternalFilter && !\is_callable($fAdditionalExternalFilter))
|
||||
{
|
||||
$fAdditionalExternalFilter = null;
|
||||
}
|
||||
|
||||
$bHasExternals = false;
|
||||
|
||||
$sHtml = \MailSo\Base\HtmlUtils::ClearTags($sHtml);
|
||||
|
@ -554,6 +576,14 @@ class HtmlUtils
|
|||
else
|
||||
{
|
||||
$oElement->setAttribute('data-x-src', $sSrc);
|
||||
if ($fAdditionalExternalFilter)
|
||||
{
|
||||
$sResult = \call_user_func($fAdditionalExternalFilter, $sSrc);
|
||||
if (0 < \strlen($sResult))
|
||||
{
|
||||
$oElement->setAttribute('data-x-additional-src', $sResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$bHasExternals = true;
|
||||
|
@ -599,7 +629,7 @@ class HtmlUtils
|
|||
{
|
||||
$oElement->setAttribute('style',
|
||||
\MailSo\Base\HtmlUtils::ClearStyle($oElement->getAttribute('style'), $oElement, $bHasExternals,
|
||||
$aFoundCIDs, $aContentLocationUrls, $aFoundedContentLocationUrls, $bDoNotReplaceExternalUrl));
|
||||
$aFoundCIDs, $aContentLocationUrls, $aFoundedContentLocationUrls, $bDoNotReplaceExternalUrl, $fAdditionalExternalFilter));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -684,6 +714,16 @@ class HtmlUtils
|
|||
$oElement->removeAttribute('data-x-href');
|
||||
}
|
||||
|
||||
if ($oElement->hasAttribute('data-x-additional-src'))
|
||||
{
|
||||
$oElement->removeAttribute('data-x-additional-src');
|
||||
}
|
||||
|
||||
if ($oElement->hasAttribute('data-x-additional-style-url'))
|
||||
{
|
||||
$oElement->removeAttribute('data-x-additional-style-url');
|
||||
}
|
||||
|
||||
if ($oElement->hasAttribute('data-x-style-cid-name') && $oElement->hasAttribute('data-x-style-cid'))
|
||||
{
|
||||
$sCidName = $oElement->getAttribute('data-x-style-cid-name');
|
||||
|
|
|
@ -1215,6 +1215,7 @@ class Actions
|
|||
$aResult['AllowLanguagesOnLogin'] = (bool) $oConfig->Get('login', 'allow_languages_on_login', true);
|
||||
$aResult['AttachmentLimit'] = ((int) $oConfig->Get('webmail', 'attachment_size_limit', 10)) * 1024 * 1024;
|
||||
$aResult['SignMe'] = (string) $oConfig->Get('login', 'sign_me_auto', \RainLoop\Enumerations\SignMeType::DEFAILT_OFF);
|
||||
$aResult['UseLocalProxyForExternalImages'] = (bool) $oConfig->Get('labs', 'use_local_proxy_for_external_images', false);
|
||||
|
||||
// user
|
||||
$aResult['EditorDefaultType'] = (string) $oConfig->Get('webmail', 'editor_default_type', '');
|
||||
|
@ -2172,6 +2173,8 @@ class Actions
|
|||
return $self->ValidateTheme($sTheme);
|
||||
});
|
||||
|
||||
$this->setConfigFromParams($oConfig, 'UseLocalProxyForExternalImages', 'labs', 'use_local_proxy_for_external_images', 'bool');
|
||||
|
||||
$this->setConfigFromParams($oConfig, 'AllowLanguagesOnSettings', 'webmail', 'allow_languages_on_settings', 'bool');
|
||||
$this->setConfigFromParams($oConfig, 'AllowLanguagesOnLogin', 'login', 'allow_languages_on_login', 'bool');
|
||||
$this->setConfigFromParams($oConfig, 'AttachmentLimit', 'webmail', 'attachment_size_limit', 'int');
|
||||
|
@ -7009,6 +7012,7 @@ class Actions
|
|||
'ThreadsLen' => $mResponse->ThreadsLen(),
|
||||
'ParentThread' => $mResponse->ParentThread(),
|
||||
'Sensitivity' => $mResponse->Sensitivity(),
|
||||
'ExternalProxy' => false,
|
||||
'ReadReceipt' => ''
|
||||
));
|
||||
|
||||
|
@ -7095,9 +7099,24 @@ class Actions
|
|||
$mResult['DraftInfo'] = $mResponse->DraftInfo();
|
||||
$mResult['InReplyTo'] = $mResponse->InReplyTo();
|
||||
$mResult['References'] = $mResponse->References();
|
||||
|
||||
$fAdditionalExternalFilter = null;
|
||||
if (!!$this->Config()->Get('labs', 'use_local_proxy_for_external_images', false))
|
||||
{
|
||||
$sIndexPrefix = 0 < strlen(APP_INDEX_FILE) ? APP_INDEX_FILE : './';
|
||||
$fAdditionalExternalFilter = function ($sUrl) use ($sIndexPrefix) {
|
||||
return $sIndexPrefix.'?/ProxyExternal/'.\RainLoop\Utils::EncodeKeyValues(array(
|
||||
'Token' => \RainLoop\Utils::GetConnectionToken(),
|
||||
'Url' => $sUrl
|
||||
)).'/';
|
||||
};
|
||||
}
|
||||
|
||||
$mResult['Html'] = 0 === \strlen($sHtml) ? '' : \MailSo\Base\HtmlUtils::ClearHtml(
|
||||
$sHtml, $bHasExternals, $mFoundedCIDs, $aContentLocationUrls, $mFoundedContentLocationUrls, false,
|
||||
!!$this->Config()->Get('labs', 'allow_smart_html_links', true));
|
||||
!!$this->Config()->Get('labs', 'allow_smart_html_links', true), $fAdditionalExternalFilter);
|
||||
|
||||
$mResult['ExternalProxy'] = null !== $fAdditionalExternalFilter;
|
||||
|
||||
$mResult['PlainRaw'] = $sPlain;
|
||||
$mResult['Plain'] = 0 === \strlen($sPlain) ? '' : \MailSo\Base\HtmlUtils::ConvertPlainToHtml($sPlain);
|
||||
|
|
|
@ -245,6 +245,7 @@ Enables caching in the system'),
|
|||
'fast_cache_memcache_host' => array('127.0.0.1'),
|
||||
'fast_cache_memcache_port' => array(11211),
|
||||
'fast_cache_memcache_expire' => array(43200),
|
||||
'use_local_proxy_for_external_images' => array(false),
|
||||
'dev_email' => array(''),
|
||||
'dev_password' => array('')
|
||||
)
|
||||
|
|
|
@ -337,6 +337,66 @@ class ServiceActions
|
|||
return $this->privateUpload('UploadBackground');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function ServiceProxyExternal()
|
||||
{
|
||||
$bResult = false;
|
||||
$sData = empty($this->aPaths[1]) ? '' : $this->aPaths[1];
|
||||
if (!empty($sData) && $this->oActions->Config()->Get('labs', 'use_local_proxy_for_external_images', false))
|
||||
{
|
||||
$this->oActions->verifyCacheByKey($sData);
|
||||
|
||||
$aData = \RainLoop\Utils::DecodeKeyValues($sData);
|
||||
if (\is_array($aData) && !empty($aData['Token']) && !empty($aData['Url']) && $aData['Token'] === \RainLoop\Utils::GetConnectionToken())
|
||||
{
|
||||
$sUrl = $aData['Url'];
|
||||
|
||||
$aOptions = array(
|
||||
CURLOPT_URL => $sUrl,
|
||||
CURLOPT_HEADER => false,
|
||||
CURLOPT_USERAGENT => 'RainLoop External Proxy',
|
||||
CURLOPT_FAILONERROR => true,
|
||||
CURLOPT_SSL_VERIFYPEER => false,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_POST => false,
|
||||
CURLOPT_TIMEOUT => (int) 10
|
||||
);
|
||||
|
||||
$oCurl = \curl_init();
|
||||
\curl_setopt_array($oCurl, $aOptions);
|
||||
|
||||
$mResult = \curl_exec($oCurl);
|
||||
|
||||
$iCode = (int) \curl_getinfo($oCurl, CURLINFO_HTTP_CODE);
|
||||
$sContentType = (string) \curl_getinfo($oCurl, CURLINFO_CONTENT_TYPE);
|
||||
$sContentType = \trim(\strtolower($sContentType));
|
||||
|
||||
if (false !== $mResult && 200 === $iCode &&
|
||||
\in_array($sContentType, array('image/png', 'image/jpeg', 'image/jpg', 'image/bmp', 'image/gif')))
|
||||
{
|
||||
$bResult = true;
|
||||
|
||||
$this->oActions->cacheByKey($sData);
|
||||
|
||||
\header('Content-Type: '.$sContentType);
|
||||
echo $mResult;
|
||||
}
|
||||
|
||||
if (\is_resource($oCurl))
|
||||
{
|
||||
\curl_close($oCurl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$bResult)
|
||||
{
|
||||
$this->oHttp->StatusHeader(404);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
<label data-bind="click: function () { capaOpenPGP(!capaOpenPGP()); }">
|
||||
<i data-bind="css: capaOpenPGP() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
|
||||
|
||||
Allow OpenPGP <span style="color:red">(beta)</span>
|
||||
Allow OpenPGP
|
||||
<span style="color:red">(beta)</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -21,6 +22,16 @@
|
|||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label data-bind="click: function () { useLocalProxyForExternalImages(!useLocalProxyForExternalImages()); }">
|
||||
<i data-bind="css: useLocalProxyForExternalImages() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
|
||||
|
||||
Use local proxy for external images
|
||||
<span style="color:red">(beta)</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<a href="#" target="_blank" class="g-ui-link" data-bind="link: phpInfoLink()">Show PHP information</a>
|
||||
|
|
|
@ -1574,6 +1574,8 @@ Utils.initDataConstructorBySettings = function (oData)
|
|||
oData.capaThemes = ko.observable(false);
|
||||
oData.allowLanguagesOnSettings = ko.observable(true);
|
||||
oData.allowLanguagesOnLogin = ko.observable(true);
|
||||
|
||||
oData.useLocalProxyForExternalImages = ko.observable(false);
|
||||
|
||||
oData.desktopNotifications = ko.observable(false);
|
||||
oData.useThreads = ko.observable(true);
|
||||
|
@ -6607,6 +6609,8 @@ AdminDomains.prototype.onDomainListChangeRequest = function ()
|
|||
*/
|
||||
function AdminSecurity()
|
||||
{
|
||||
this.useLocalProxyForExternalImages = RL.data().useLocalProxyForExternalImages;
|
||||
|
||||
this.capaOpenPGP = ko.observable(RL.capa(Enums.Capa.OpenPGP));
|
||||
this.capaTwoFactorAuth = ko.observable(RL.capa(Enums.Capa.TwoFactor));
|
||||
|
||||
|
@ -6690,6 +6694,12 @@ AdminSecurity.prototype.onBuild = function ()
|
|||
'CapaTwoFactorAuth': bValue ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.useLocalProxyForExternalImages.subscribe(function (bValue) {
|
||||
RL.remote().saveAdminConfig(null, {
|
||||
'UseLocalProxyForExternalImages': bValue ? '1' : '0'
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
AdminSecurity.prototype.onHide = function ()
|
||||
|
@ -7167,10 +7177,10 @@ function AbstractData()
|
|||
{
|
||||
this.leftPanelDisabled = ko.observable(false);
|
||||
this.useKeyboardShortcuts = ko.observable(true);
|
||||
|
||||
|
||||
this.keyScopeReal = ko.observable(Enums.KeyState.All);
|
||||
this.keyScopeFake = ko.observable(Enums.KeyState.All);
|
||||
|
||||
|
||||
this.keyScope = ko.computed({
|
||||
'owner': this,
|
||||
'read': function () {
|
||||
|
@ -7195,11 +7205,11 @@ function AbstractData()
|
|||
sValue = Enums.KeyState.Menu;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.keyScopeReal(sValue);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.keyScopeReal.subscribe(function (sValue) {
|
||||
// window.console.log(sValue);
|
||||
key.setScope(sValue);
|
||||
|
@ -7253,6 +7263,7 @@ AbstractData.prototype.populateDataOnStart = function()
|
|||
this.capaThemes(RL.capa(Enums.Capa.Themes));
|
||||
this.allowLanguagesOnLogin(!!RL.settingsGet('AllowLanguagesOnLogin'));
|
||||
this.allowLanguagesOnSettings(!!RL.settingsGet('AllowLanguagesOnSettings'));
|
||||
this.useLocalProxyForExternalImages(!!RL.settingsGet('UseLocalProxyForExternalImages'));
|
||||
|
||||
this.editorDefaultType(RL.settingsGet('EditorDefaultType'));
|
||||
this.showImages(!!RL.settingsGet('ShowImages'));
|
||||
|
@ -7265,7 +7276,7 @@ AbstractData.prototype.populateDataOnStart = function()
|
|||
this.useThreads(!!RL.settingsGet('UseThreads'));
|
||||
this.replySameFolder(!!RL.settingsGet('ReplySameFolder'));
|
||||
this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList'));
|
||||
|
||||
|
||||
this.layout(Enums.Layout.SidePreview);
|
||||
if (-1 < Utils.inArray(mLayout, [Enums.Layout.NoPreview, Enums.Layout.SidePreview, Enums.Layout.BottomPreview]))
|
||||
{
|
||||
|
|
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
|
@ -1577,6 +1577,8 @@ Utils.initDataConstructorBySettings = function (oData)
|
|||
oData.capaThemes = ko.observable(false);
|
||||
oData.allowLanguagesOnSettings = ko.observable(true);
|
||||
oData.allowLanguagesOnLogin = ko.observable(true);
|
||||
|
||||
oData.useLocalProxyForExternalImages = ko.observable(false);
|
||||
|
||||
oData.desktopNotifications = ko.observable(false);
|
||||
oData.useThreads = ko.observable(true);
|
||||
|
@ -6603,6 +6605,8 @@ function MessageModel()
|
|||
this.dateTimeStampInUTC = ko.observable(0);
|
||||
this.priority = ko.observable(Enums.MessagePriority.Normal);
|
||||
|
||||
this.proxy = false;
|
||||
|
||||
this.fromEmailString = ko.observable('');
|
||||
this.toEmailsString = ko.observable('');
|
||||
this.senderEmailsString = ko.observable('');
|
||||
|
@ -6821,6 +6825,8 @@ MessageModel.prototype.clear = function ()
|
|||
this.dateTimeStampInUTC(0);
|
||||
this.priority(Enums.MessagePriority.Normal);
|
||||
|
||||
this.proxy = false;
|
||||
|
||||
this.fromEmailString('');
|
||||
this.toEmailsString('');
|
||||
this.senderEmailsString('');
|
||||
|
@ -6901,6 +6907,8 @@ MessageModel.prototype.initByJson = function (oJsonMessage)
|
|||
this.hash = oJsonMessage.Hash;
|
||||
this.requestHash = oJsonMessage.RequestHash;
|
||||
|
||||
this.proxy = !!oJsonMessage.ExternalProxy;
|
||||
|
||||
this.size(Utils.pInt(oJsonMessage.Size));
|
||||
|
||||
this.from = MessageModel.initEmailsFromJson(oJsonMessage.From);
|
||||
|
@ -6954,6 +6962,8 @@ MessageModel.prototype.initUpdateByMessageJson = function (oJsonMessage)
|
|||
this.sInReplyTo = oJsonMessage.InReplyTo;
|
||||
this.sReferences = oJsonMessage.References;
|
||||
|
||||
this.proxy = !!oJsonMessage.ExternalProxy;
|
||||
|
||||
if (RL.data().capaOpenPGP())
|
||||
{
|
||||
this.isPgpSigned(!!oJsonMessage.PgpSigned);
|
||||
|
@ -7396,6 +7406,8 @@ MessageModel.prototype.populateByMessageListItem = function (oMessage)
|
|||
this.dateTimeStampInUTC(oMessage.dateTimeStampInUTC());
|
||||
this.priority(oMessage.priority());
|
||||
|
||||
this.proxy = oMessage.proxy;
|
||||
|
||||
this.fromEmailString(oMessage.fromEmailString());
|
||||
this.toEmailsString(oMessage.toEmailsString());
|
||||
|
||||
|
@ -7449,30 +7461,33 @@ MessageModel.prototype.showExternalImages = function (bLazy)
|
|||
{
|
||||
if (this.body && this.body.data('rl-has-images'))
|
||||
{
|
||||
var sAttr = '';
|
||||
bLazy = Utils.isUnd(bLazy) ? false : bLazy;
|
||||
|
||||
this.hasImages(false);
|
||||
this.body.data('rl-has-images', false);
|
||||
|
||||
$('[data-x-src]', this.body).each(function () {
|
||||
sAttr = this.proxy ? 'data-x-additional-src' : 'data-x-src';
|
||||
$('[' + sAttr + ']', this.body).each(function () {
|
||||
if (bLazy && $(this).is('img'))
|
||||
{
|
||||
$(this)
|
||||
.addClass('lazy')
|
||||
.attr('data-original', $(this).attr('data-x-src'))
|
||||
.removeAttr('data-x-src')
|
||||
.attr('data-original', $(this).attr(sAttr))
|
||||
.removeAttr(sAttr)
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).attr('src', $(this).attr('data-x-src')).removeAttr('data-x-src');
|
||||
$(this).attr('src', $(this).attr(sAttr)).removeAttr(sAttr);
|
||||
}
|
||||
});
|
||||
|
||||
$('[data-x-style-url]', this.body).each(function () {
|
||||
sAttr = this.proxy ? 'data-x-additional-style-url' : 'data-x-style-url';
|
||||
$('[' + sAttr + ']', this.body).each(function () {
|
||||
var sStyle = Utils.trim($(this).attr('style'));
|
||||
sStyle = '' === sStyle ? '' : (';' === sStyle.substr(-1) ? sStyle + ' ' : sStyle + '; ');
|
||||
$(this).attr('style', sStyle + $(this).attr('data-x-style-url')).removeAttr('data-x-style-url');
|
||||
$(this).attr('style', sStyle + $(this).attr(sAttr)).removeAttr(sAttr);
|
||||
});
|
||||
|
||||
if (bLazy)
|
||||
|
@ -15697,10 +15712,10 @@ function AbstractData()
|
|||
{
|
||||
this.leftPanelDisabled = ko.observable(false);
|
||||
this.useKeyboardShortcuts = ko.observable(true);
|
||||
|
||||
|
||||
this.keyScopeReal = ko.observable(Enums.KeyState.All);
|
||||
this.keyScopeFake = ko.observable(Enums.KeyState.All);
|
||||
|
||||
|
||||
this.keyScope = ko.computed({
|
||||
'owner': this,
|
||||
'read': function () {
|
||||
|
@ -15725,11 +15740,11 @@ function AbstractData()
|
|||
sValue = Enums.KeyState.Menu;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.keyScopeReal(sValue);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.keyScopeReal.subscribe(function (sValue) {
|
||||
// window.console.log(sValue);
|
||||
key.setScope(sValue);
|
||||
|
@ -15783,6 +15798,7 @@ AbstractData.prototype.populateDataOnStart = function()
|
|||
this.capaThemes(RL.capa(Enums.Capa.Themes));
|
||||
this.allowLanguagesOnLogin(!!RL.settingsGet('AllowLanguagesOnLogin'));
|
||||
this.allowLanguagesOnSettings(!!RL.settingsGet('AllowLanguagesOnSettings'));
|
||||
this.useLocalProxyForExternalImages(!!RL.settingsGet('UseLocalProxyForExternalImages'));
|
||||
|
||||
this.editorDefaultType(RL.settingsGet('EditorDefaultType'));
|
||||
this.showImages(!!RL.settingsGet('ShowImages'));
|
||||
|
@ -15795,7 +15811,7 @@ AbstractData.prototype.populateDataOnStart = function()
|
|||
this.useThreads(!!RL.settingsGet('UseThreads'));
|
||||
this.replySameFolder(!!RL.settingsGet('ReplySameFolder'));
|
||||
this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList'));
|
||||
|
||||
|
||||
this.layout(Enums.Layout.SidePreview);
|
||||
if (-1 < Utils.inArray(mLayout, [Enums.Layout.NoPreview, Enums.Layout.SidePreview, Enums.Layout.BottomPreview]))
|
||||
{
|
||||
|
|
10
rainloop/v/0.0.0/static/js/app.min.js
vendored
10
rainloop/v/0.0.0/static/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue