mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix broken inline PDF viewer, #1833
This commit is contained in:
parent
a74741343e
commit
dcd35b1ea2
@ -89,7 +89,7 @@
|
||||
"jsdoc": "3.6.6",
|
||||
"lorem-ipsum": "2.0.3",
|
||||
"rcedit": "3.0.0",
|
||||
"webpack": "5.35.0",
|
||||
"webpack": "5.35.1",
|
||||
"webpack-cli": "4.6.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
|
@ -59,7 +59,7 @@ async function getRenderedContent(note, options = {}) {
|
||||
}
|
||||
else if (type === 'audio') {
|
||||
const $audioPreview = $('<audio controls></audio>')
|
||||
.attr("src", openService.getUrlForDownload("api/notes/" + note.noteId + "/open"))
|
||||
.attr("src", openService.getUrlForStreaming("api/notes/" + note.noteId + "/open-partial"))
|
||||
.attr("type", note.mime)
|
||||
.css("width", "100%");
|
||||
|
||||
@ -67,7 +67,7 @@ async function getRenderedContent(note, options = {}) {
|
||||
}
|
||||
else if (type === 'video') {
|
||||
const $videoPreview = $('<video controls></video>')
|
||||
.attr("src", openService.getUrlForDownload("api/notes/" + note.noteId + "/open"))
|
||||
.attr("src", openService.getUrlForDownload("api/notes/" + note.noteId + "/open-partial"))
|
||||
.attr("type", note.mime)
|
||||
.css("width", "100%");
|
||||
|
||||
|
@ -93,14 +93,14 @@ export default class FileTypeWidget extends TypeWidget {
|
||||
else if (note.mime.startsWith('video/')) {
|
||||
this.$videoPreview
|
||||
.show()
|
||||
.attr("src", openService.getUrlForDownload("api/notes/" + this.noteId + "/open"))
|
||||
.attr("src", openService.getUrlForDownload("api/notes/" + this.noteId + "/open-partial"))
|
||||
.attr("type", this.note.mime)
|
||||
.css("width", this.$widget.width());
|
||||
}
|
||||
else if (note.mime.startsWith('audio/')) {
|
||||
this.$audioPreview
|
||||
.show()
|
||||
.attr("src", openService.getUrlForDownload("api/notes/" + this.noteId + "/open"))
|
||||
.attr("src", openService.getUrlForDownload("api/notes/" + this.noteId + "/open-partial"))
|
||||
.attr("type", this.note.mime)
|
||||
.css("width", this.$widget.width());
|
||||
}
|
||||
|
@ -164,11 +164,6 @@ div.ui-tooltip {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.alert {
|
||||
padding: 5px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
* .search-inactive is added to search window <webview> when the window
|
||||
* is inactive.
|
||||
@ -761,9 +756,14 @@ a.external:not(.no-arrow):after, a[href^="http://"]:not(.no-arrow):after, a[href
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.alert {
|
||||
padding: 8px 14px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.alert-warning, .alert-info {
|
||||
color: var(--main-text-color) !important;
|
||||
background-color: var(--accented-background-color) !important;
|
||||
background-color: transparent !important;
|
||||
border-color: var(--main-border-color) !important;
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,8 @@ function register(app) {
|
||||
route(PUT, '/api/notes/:noteId/file', [auth.checkApiAuthOrElectron, uploadMiddleware, csrfMiddleware],
|
||||
filesRoute.updateFile, apiResultHandler);
|
||||
|
||||
route(GET, '/api/notes/:noteId/open', [auth.checkApiAuthOrElectron],
|
||||
route(GET, '/api/notes/:noteId/open', [auth.checkApiAuthOrElectron], filesRoute.openFile);
|
||||
route(GET, '/api/notes/:noteId/open-partial', [auth.checkApiAuthOrElectron],
|
||||
createPartialContentHandler(filesRoute.fileContentProvider, {
|
||||
debug: (string, extra) => { console.log(string, extra); }
|
||||
}));
|
||||
|
Loading…
x
Reference in New Issue
Block a user