Attachments control panel

This commit is contained in:
RainLoop Team 2015-04-11 01:52:15 +04:00
parent 1d943356f5
commit af2815cd61
21 changed files with 239 additions and 18 deletions

View file

@ -566,15 +566,15 @@ class HtmlUtils
if ($oElement->hasAttribute('href'))
{
$sHref = \trim($oElement->getAttribute('href'));
if (!\preg_match('/^(http[s]?|ftp|skype|mailto):/i', $sHref) ||
'//' !== \substr($sHref, 0, 2))
if (!\preg_match('/^(http[s]?|ftp|skype|mailto):/i', $sHref) && '//' !== \substr($sHref, 0, 2))
{
$oElement->setAttribute('data-x-broken-href', $sHref);
$oElement->setAttribute('href', 'javascript:false');
}
else if ('a' === $sTagNameLower)
if ('a' === $sTagNameLower)
{
$oElement->setAttribute('rel', 'external');
$oElement->setAttribute('rel', 'external nofollow');
}
}
@ -595,8 +595,7 @@ class HtmlUtils
}
else
{
if (\preg_match('/^http[s]?:\/\//i', $sSrc) ||
'//' === \substr($sSrc, 0, 2))
if (\preg_match('/^http[s]?:\/\//i', $sSrc) || '//' === \substr($sSrc, 0, 2))
{
if ($bDoNotReplaceExternalUrl)
{

View file

@ -1315,6 +1315,7 @@ class Actions
'AllowAppendMessage' => (bool) $oConfig->Get('labs', 'allow_message_append', false),
'MaterialDesign' => (bool) $oConfig->Get('labs', 'use_material_design', true),
'PremType' => $this->PremType(),
'ZipSupported' => !!\class_exists('ZipArchive'),
'Admin' => array(),
'Capa' => array(),
'Plugins' => array()

View file

@ -380,11 +380,11 @@
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
style="margin-bottom: 0" data-i18n="[placeholder]MESSAGE/PGP_PASSWORD_INPUT_PLACEHOLDER" data-bind="value: viewPgpPassword, onEnter: function() { decryptPgpEncryptedMessage(message()); }" />
</div>
<div class="attachmentsPlace" data-bind="visible: message() && message().hasVisibleAttachments()">
<div class="attachmentsPlace" data-bind="visible: message() && message().hasVisibleAttachments(), css: {'selection-mode' : showAttachmnetControls}">
<ul class="attachmentList" data-bind="foreach: message() ? message().attachments() : []">
<li class="attachmentItem clearfix" draggable="true" data-tooltip-join="top"
data-bind="visible: !isLinked, event: { 'dragstart': eventDragStart }, attr: { 'title': fileName }">
<div class="attachmentIconParent pull-left" data-bind="css: { 'hasPreview': hasPreview(), 'hasPreplay': hasPreplay() }">
data-bind="visible: !isLinked, event: { 'dragstart': eventDragStart }, attr: { 'title': fileName }, css: {'checked': checked}">
<div class="attachmentIconParent pull-left" data-bind="css: { 'hasPreview': hasPreview(), 'hasPreplay': hasPreplay(), 'isImage': isImage() }">
<div class="hidePreview">
<div class="iconMain">
<i class="attachmentIcon attachmentMainIcon" data-bind="css: iconClass()"></i>
@ -408,7 +408,7 @@
<i class="attachmentIcon attachmentMainIcon" data-bind="css: iconClass()"></i>
</div>
<div class="iconPreview">
<i class="attachmentIcon icon-right-dir show-hover"></i>
<i class="attachmentIcon icon-play show-hover"></i>
</div>
</div>
</div>
@ -420,8 +420,26 @@
<span class="attachmentSize" data-bind="text: friendlySize"></span>&nbsp;
</div>
</div>
<div class="checkedParent">
<i class="checkboxAttachment icon-checkbox-unchecked"
data-bind="css: checked() ? 'checkboxMessage icon-checkbox-checked' : 'checkboxMessage icon-checkbox-unchecked',
click: function () { checked(!checked()); return false }"></i>
</div>
</li>
</ul>
<i class="icon-cog controls-handle" data-bind="visible: allowAttachmnetControls() && !showAttachmnetControls(), click: function () { showAttachmnetControls(true) }"></i>
</div>
<div class="attachmentsControls"
data-bind="visible: showAttachmnetControls() && message() && message().hasVisibleAttachments()">
<i class="icon-file-zip"></i>
&nbsp;&nbsp;
<span class="g-ui-link">Download as zip</span>
&nbsp;&nbsp;&nbsp;&nbsp;
<i class="icon-cloud-up"></i>
&nbsp;&nbsp;
<span class="g-ui-link">Save to ownCloud</span>
<button type="button" class="close" style="margin-right: 5px;"
data-bind="click: function () { showAttachmnetControls(false); }">×</button>
</div>
<div class="bodyText g-ui-min-height-300" data-bind="initDom: messagesBodiesDom"></div>
</div>

View file

@ -70,8 +70,14 @@
<div class="accountPlace pull-right" data-bind="text: emailTitle()"></div>
<div class="audioPlace pull-right" data-tooltip-i18n="off" data-tooltip-mobile="on" data-tooltip-join="right top"
data-bind="visible: '' !== currentAudio(), tooltip: currentAudio, click: stopPlay">
<i class="playIcon icon-right-dir"></i>
<div class="playIcon equaliser" data-bind="css: {'animated': '' !== currentAudio()}">
<div class="bar first"></div>
<div class="bar second"></div>
<div class="bar third"></div>
</div>
<i class="stopIcon icon-pause"></i>
</div>
</div>
</div>
</div>