Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix broken inline PDF viewer, #1833
zadamdcd35b1ea26d
diff --git a/package.json b/package.jsonindex 4f280c3380..e3d6192f1a 100644--- a/package.json+++ b/package.json@@ -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": {diff --git a/src/public/app/services/note_content_renderer.js b/src/public/app/services/note_content_renderer.jsindex 1ae731dddd..e01fbd2fca 100644--- a/src/public/app/services/note_content_renderer.js+++ b/src/public/app/services/note_content_renderer.js@@ -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%");diff --git a/src/public/app/widgets/type_widgets/file.js b/src/public/app/widgets/type_widgets/file.jsindex ae88275eb9..a5e7410bdb 100644--- a/src/public/app/widgets/type_widgets/file.js+++ b/src/public/app/widgets/type_widgets/file.js@@ -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());}diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.cssindex 9b01b031d3..afab962f51 100644--- a/src/public/stylesheets/style.css+++ b/src/public/stylesheets/style.css@@ -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[hrefwidth: 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;}diff --git a/src/routes/routes.js b/src/routes/routes.jsindex 4c9e9a6c78..681c6afe59 100644--- a/src/routes/routes.js+++ b/src/routes/routes.js@@ -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); }}));