diff --git a/src/app.js b/src/app.js index 739c79fb3..c98d15591 100644 --- a/src/app.js +++ b/src/app.js @@ -39,8 +39,11 @@ app.use(express.static(path.join(__dirname, 'public/root'))); app.use(`/${assetPath}/app`, express.static(path.join(__dirname, 'public/app'))); app.use(`/${assetPath}/app-dist`, express.static(path.join(__dirname, 'public/app-dist'))); app.use(`/${assetPath}/fonts`, express.static(path.join(__dirname, 'public/fonts'))); +app.use(`/assets/vX/fonts`, express.static(path.join(__dirname, 'public/fonts'))); app.use(`/${assetPath}/stylesheets`, express.static(path.join(__dirname, 'public/stylesheets'))); +app.use(`/assets/vX/stylesheets`, express.static(path.join(__dirname, 'public/stylesheets'))); app.use(`/${assetPath}/libraries`, express.static(path.join(__dirname, '..', 'libraries'))); +app.use(`/assets/vX/libraries`, express.static(path.join(__dirname, '..', 'libraries'))); // excalidraw-view mode in shared notes app.use(`/${assetPath}/node_modules/react/umd/react.production.min.js`, express.static(path.join(__dirname, '..', 'node_modules/react/umd/react.production.min.js'))); app.use(`/${assetPath}/node_modules/react-dom/umd/react-dom.production.min.js`, express.static(path.join(__dirname, '..', 'node_modules/react-dom/umd/react-dom.production.min.js'))); @@ -48,6 +51,7 @@ app.use(`/${assetPath}/node_modules/react-dom/umd/react-dom.production.min.js`, app.use(`/node_modules/@excalidraw/excalidraw/dist/`, express.static(path.join(__dirname, '..', 'node_modules/@excalidraw/excalidraw/dist/'))); app.use(`/${assetPath}/node_modules/@excalidraw/excalidraw/dist/`, express.static(path.join(__dirname, '..', 'node_modules/@excalidraw/excalidraw/dist/'))); app.use(`/${assetPath}/images`, express.static(path.join(__dirname, '..', 'images'))); +app.use(`/assets/vX/images`, express.static(path.join(__dirname, '..', 'images'))); const sessionParser = session({ secret: sessionSecret, resave: false, // true forces the session to be saved back to the session store, even if the session was never modified during the request. diff --git a/src/public/manifest.webmanifest b/src/public/manifest.webmanifest index 1468961a8..c0966987b 100644 --- a/src/public/manifest.webmanifest +++ b/src/public/manifest.webmanifest @@ -7,7 +7,7 @@ "scope": "./", "start_url": "./", "icons": [{ - "src": "images/app-icons/ios/apple-touch-icon.png", + "src": "assets/vX/images/app-icons/ios/apple-touch-icon.png", "sizes": "180x180", "type": "image/png" }] diff --git a/src/routes/api/branches.js b/src/routes/api/branches.js index 9292de5c8..a44a93f1e 100644 --- a/src/routes/api/branches.js +++ b/src/routes/api/branches.js @@ -191,6 +191,11 @@ function deleteBranch(req) { const last = req.query.last === 'true'; const eraseNotes = req.query.eraseNotes === 'true'; const branch = becca.getBranch(req.params.branchId); + + if (!branch) { + return [404, `Branch ${req.params.branchId} not found`]; + } + const taskContext = TaskContext.getInstance(req.query.taskId, 'delete-notes'); const deleteId = utils.randomString(10); diff --git a/src/share/content_renderer.js b/src/share/content_renderer.js index c6bc914be..a795ee084 100644 --- a/src/share/content_renderer.js +++ b/src/share/content_renderer.js @@ -1,7 +1,16 @@ const {JSDOM} = require("jsdom"); const shaca = require("./shaca/shaca"); +const assetPath = require("../services/asset_path"); function getContent(note) { + if (note.isProtected) { + return { + header: '', + content: '
Protected note cannot be displayed
', + isEmpty: false + }; + } + let content = note.getContent(); let header = ''; let isEmpty = false; @@ -36,10 +45,10 @@ function getContent(note) { if (content.includes(``)) { header += ` - - - - + + + + `; + header += ``; } else if (note.type === 'image') { content = ``; @@ -89,9 +98,9 @@ document.addEventListener("DOMContentLoaded", function() { header += ``; - header += ``; - header += ``; - header += ``; + header += ``; + header += ``; + header += ``; header += `