mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 07:14:40 +03:00
webmail: show all images (inline and attachment) below the text part (for the text view, not for html view)
the attachment buttons for images get some opacity for the text view, to indicate you don't have to open them explicitly.
This commit is contained in:
@ -1,14 +1,29 @@
|
||||
// Javascript is generated from typescript, do not modify generated javascript because changes will be overwritten.
|
||||
|
||||
// Loaded from synchronous javascript.
|
||||
declare let messageItem: api.MessageItem
|
||||
declare let parsedMessage: api.ParsedMessage
|
||||
|
||||
const init = async () => {
|
||||
const pm = api.parser.ParsedMessage(parsedMessage)
|
||||
const mi = api.parser.MessageItem(messageItem)
|
||||
dom._kids(document.body,
|
||||
dom.div(dom._class('pad', 'mono'),
|
||||
dom.div(dom._class('pad', 'mono', 'textmulti'),
|
||||
style({whiteSpace: 'pre-wrap'}),
|
||||
join((pm.Texts || []).map(t => renderText(t)), () => dom.hr(style({margin: '2ex 0'}))),
|
||||
(pm.Texts || []).map(t => renderText(t.replace(/\r\n/g, '\n'))),
|
||||
(mi.Attachments || []).filter(f => isImage(f)).map(f => {
|
||||
const pathStr = [0].concat(f.Path || []).join('.')
|
||||
return dom.div(
|
||||
dom.div(
|
||||
style({flexGrow: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', maxHeight: 'calc(100% - 50px)'}),
|
||||
dom.img(
|
||||
attr.src('view/'+pathStr),
|
||||
attr.title(f.Filename),
|
||||
style({backgroundColor: 'white', maxWidth: '100%', maxHeight: '100%', boxShadow: '0 0 20px rgba(0, 0, 0, 0.1)'})
|
||||
),
|
||||
)
|
||||
)
|
||||
}),
|
||||
)
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user