mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Mail: Move attachment placeholder to client side, inserted at cursor position
This commit is contained in:
parent
9ca7c6f373
commit
dfa7f991bb
@ -1404,7 +1404,7 @@ class mail_compose
|
|||||||
$attachment_block = '<fieldset class="attachments mceNonEditable"><legend>Download attachments</legend>' . lang('Attachments') . '</fieldset>';
|
$attachment_block = '<fieldset class="attachments mceNonEditable"><legend>Download attachments</legend>' . lang('Attachments') . '</fieldset>';
|
||||||
if($content['is_html'] && strpos($content['mail_htmltext'], $attachment_block) == false)
|
if($content['is_html'] && strpos($content['mail_htmltext'], $attachment_block) == false)
|
||||||
{
|
{
|
||||||
$content['mail_htmltext'] .= $attachment_block;
|
//$content['mail_htmltext'] .= $attachment_block;
|
||||||
}
|
}
|
||||||
foreach($content['attachments'] as &$attach)
|
foreach($content['attachments'] as &$attach)
|
||||||
{
|
{
|
||||||
|
@ -3977,6 +3977,7 @@ app.classes.mail = AppJS.extend(
|
|||||||
}
|
}
|
||||||
if (_file_count && !jQuery.isEmptyObject(_event.data.getValue()))
|
if (_file_count && !jQuery.isEmptyObject(_event.data.getValue()))
|
||||||
{
|
{
|
||||||
|
this.addAttachmentPlaceholder();
|
||||||
var widget = _event.data;
|
var widget = _event.data;
|
||||||
this.et2_obj.submit();
|
this.et2_obj.submit();
|
||||||
}
|
}
|
||||||
@ -4023,6 +4024,7 @@ app.classes.mail = AppJS.extend(
|
|||||||
if (jQuery.isEmptyObject(_widget)) return;
|
if (jQuery.isEmptyObject(_widget)) return;
|
||||||
if (!jQuery.isEmptyObject(_widget.getValue()))
|
if (!jQuery.isEmptyObject(_widget.getValue()))
|
||||||
{
|
{
|
||||||
|
this.addAttachmentPlaceholder();
|
||||||
this.et2_obj.submit();
|
this.et2_obj.submit();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -5087,6 +5089,7 @@ app.classes.mail = AppJS.extend(
|
|||||||
(mode == 'share_rw' || mode == 'share_ro') ? 'link' : mode;
|
(mode == 'share_rw' || mode == 'share_ro') ? 'link' : mode;
|
||||||
}
|
}
|
||||||
this.et2.setArrayMgr('content', content);
|
this.et2.setArrayMgr('content', content);
|
||||||
|
this.addAttachmentPlaceholder();
|
||||||
attachments.set_value({content:content.data.attachments});
|
attachments.set_value({content:content.data.attachments});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -6275,5 +6278,20 @@ app.classes.mail = AppJS.extend(
|
|||||||
{
|
{
|
||||||
window.open("mailto:" + _address.value);
|
window.open("mailto:" + _address.value);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
addAttachmentPlaceholder: function ()
|
||||||
|
{
|
||||||
|
if (this.et2.getArrayMgr("content").getEntry("is_html"))
|
||||||
|
{
|
||||||
|
// Add link placeholder box
|
||||||
|
const email = this.et2.getWidgetById("mail_htmltext");
|
||||||
|
const placeholder = '<fieldset class="attachments mceNonEditable"><legend>Download attachments</legend>' + this.egw.lang('Attachments') + '</fieldset>';
|
||||||
|
|
||||||
|
if (email && !email.getValue().includes(placeholder))
|
||||||
|
{
|
||||||
|
email.editor.execCommand('mceInsertContent', false, placeholder);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user