From afc8541c867a42d912c91495c9336a4032c3fadd Mon Sep 17 00:00:00 2001 From: Stéphane Guillou Date: Fri, 5 Apr 2019 15:17:55 +1000 Subject: change default mode to "both" when clicking edit Add "both" mode to URLs because I assume most people want to straight away see the code when they click the "edit" button in a published note. Fixes https://github.com/codimd/server/issues/27 Not tested, followed instructions from @ccoenen , please do review! :) Signed-off-by: Stéphane Guillou --- lib/response.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/response.js b/lib/response.js index 76793a46..9fc9258c 100644 --- a/lib/response.js +++ b/lib/response.js @@ -427,7 +427,7 @@ function publishNoteActions (req, res, next) { actionDownload(req, res, note) break case 'edit': - res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id))) + res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id)) + '?both') break default: res.redirect(config.serverURL + '/s/' + note.shortid) @@ -441,7 +441,7 @@ function publishSlideActions (req, res, next) { var action = req.params.action switch (action) { case 'edit': - res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id))) + res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id)) + '?both') break default: res.redirect(config.serverURL + '/p/' + note.shortid) -- cgit v1.2.3