mirror of
https://github.com/zadam/trilium.git
synced 2026-01-03 05:04:23 +01:00
feat(revisions): display PDF preview for revisions
This commit is contained in:
parent
5ff7764699
commit
951d6d3ce3
@ -75,6 +75,7 @@ body.mobile .revisions-dialog {
|
||||
display: flex;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
flex-grow: 1;
|
||||
|
||||
.file-preview-table {
|
||||
th,
|
||||
@ -97,7 +98,7 @@ body.mobile .revisions-dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
video {
|
||||
> * {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@ -408,6 +408,14 @@ function FilePreviewInner({ revisionItem, fullRevision }: { revisionItem: Revisi
|
||||
);
|
||||
}
|
||||
|
||||
if (revisionItem.mime === "application/pdf") {
|
||||
return (
|
||||
<iframe
|
||||
src={`pdfjs/web/viewer.html?file=../../api/revisions/${revisionItem.revisionId}/download&lang=${options.get("locale")}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (fullRevision.content) {
|
||||
return <pre className="file-preview-content" style={CODE_STYLE}>{fullRevision.content}</pre>;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user