diff --git a/HELP.md b/HELP.md index 9597a931..ce1e7af5 100644 --- a/HELP.md +++ b/HELP.md @@ -156,6 +156,7 @@ Then, start the server again with `cloudcmd` and reload the page. | `F1` | help | `F2` | show `user menu` | `F3` | view, change directory +| `Shift + F3` | view raw file, change directory | `F4` | edit | `Shift + F4` | edit in "vim" mode | `F5` | copy diff --git a/client/key/index.js b/client/key/index.js index 186df052..f85285b7 100644 --- a/client/key/index.js +++ b/client/key/index.js @@ -198,7 +198,9 @@ async function switchKey(event) { path, }); else if (shift) - CloudCmd.Markdown.show(path); + CloudCmd.View.show(null, { + raw: true, + }); else if (ctrlMeta) CloudCmd.sortPanel('name'); else diff --git a/client/modules/view/index.js b/client/modules/view/index.js index b42b7ddd..263f8d1c 100644 --- a/client/modules/view/index.js +++ b/client/modules/view/index.js @@ -95,7 +95,7 @@ module.exports.init = async () => { events.forEach(addEvent(Overlay, onOverlayClick)); }; -async function show(data, options) { +async function show(data, options = {}) { const prefixURL = CloudCmd.prefixURL + FS; if (Loading) @@ -124,7 +124,7 @@ async function show(data, options) { Images.show.load(); const path = prefixURL + Info.path; - const type = getType(path); + const type = options.raw ? '' : getType(path); switch(type) { default: