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
change in referencing CSS resources to allow easier relative linking
zadamba1ca506af1a
diff --git a/src/public/javascripts/desktop.js b/src/public/javascripts/desktop.jsindex f9142eb021..50697abb97 100644--- a/src/public/javascripts/desktop.js+++ b/src/public/javascripts/desktop.js@@ -81,7 +81,7 @@ window.onerror = function (msg, url, lineNo, columnNo, error) {};for (const appCssNoteId of window.appCssNoteIds) {- cssLoader.requireCss(`/api/notes/${appCssNoteId}/download`);+ cssLoader.requireCss(`/api/notes/download/${appCssNoteId}`);}const wikiBaseUrl = "https://github.com/zadam/trilium/wiki/";diff --git a/src/public/javascripts/dialogs/options.js b/src/public/javascripts/dialogs/options.jsindex c84bb30744..5d5f4fbc13 100644--- a/src/public/javascripts/dialogs/options.js+++ b/src/public/javascripts/dialogs/options.js@@ -98,7 +98,7 @@ addTabHandler((function() {if (noteId) {// make sure the CSS is loaded// if the CSS has been loaded and then updated then the changes won't take effect though- cssLoader.requireCss(`/api/notes/${noteId}/download`);+ cssLoader.requireCss(`/api/notes/download/${noteId}`);}$body.addClass("theme-" + newTheme);diff --git a/src/routes/routes.js b/src/routes/routes.jsindex 22c96f7a19..4c499e73a0 100644--- a/src/routes/routes.js+++ b/src/routes/routes.js@@ -135,6 +135,8 @@ function register(app) {filesRoute.uploadFile, apiResultHandler);route(GET, '/api/notes/:noteId/download', [auth.checkApiAuthOrElectron], filesRoute.downloadFile);+ // this "hacky" path is used for easier referencing of CSS resources+ route(GET, '/api/notes/download/:noteId', [auth.checkApiAuthOrElectron], filesRoute.downloadFile);apiRoute(GET, '/api/notes/:noteId/attributes', attributesRoute.getEffectiveNoteAttributes);apiRoute(PUT, '/api/notes/:noteId/attributes', attributesRoute.updateNoteAttributes);