#221: image paste view fixes
- image pastes scale to fit the viewer box (max-width/max-height, object-fit) - no text/code box rendered below the image for image pastes - link pill positioning cleaned up on the image view - /raw for attachment pastes redirects to the file itself - view details size now uses the attachment blob size, not empty text len
This commit is contained in:
@@ -38,20 +38,22 @@
|
||||
{{end}}
|
||||
{{if .Attachment}}
|
||||
<div class="float">
|
||||
<div class="attachment-bar">
|
||||
<div class="attachment-bar{{if .IsImagePaste}} is-image{{end}}">
|
||||
<a class="attachment-chip" href="/f/{{.Attachment.ID}}/{{.Attachment.Filename}}" data-mime="{{.Attachment.Mime}}">
|
||||
<span class="attachment-name">{{.Attachment.Filename}}</span>
|
||||
<span class="attachment-size">{{.Attachment.SizeHuman}}</span>
|
||||
</a>
|
||||
{{if or (eq .Attachment.Mime "image/png") (eq .Attachment.Mime "image/jpeg") (eq .Attachment.Mime "image/gif") (eq .Attachment.Mime "image/webp")}}
|
||||
{{if .IsImagePaste}}
|
||||
<div class="attachment-preview"><img src="/f/{{.Attachment.ID}}/{{.Attachment.Filename}}" alt="{{.Attachment.Filename}}"></div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if not .IsImagePaste}}
|
||||
<div class="float">
|
||||
<div class="code" id="code"><div class="gutter" id="gutter">{{.Gutter}}</div><div class="codebody" id="codebody">{{.ContentHTML}}</div></div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<input type="hidden" id="raw-content" value="{{.ContentAttr}}">
|
||||
<script src="/static/paste.js" defer data-paste-id="{{.ID}}"></script>
|
||||
|
||||
Reference in New Issue
Block a user