From b0693906eb17eb2acc2e3dc44d8096ebc10eefa6 Mon Sep 17 00:00:00 2001
From: Ramires Viana <59319979+ramiresviana@users.noreply.github.com>
Date: Fri, 10 Jan 2020 00:50:46 +0000
Subject: [PATCH] feat: rework preview and editor fix
filebrowser/filebrowser#750, fix filebrowser/filebrowser#553 Preview: - Opens
and cycle all files types. - Support for text, mardown and html. - Added
filename title, esc key shortcut and editor button. Editor: - Shows on full
screen overlay. - Added esc key shortcut.
---
frontend/package.json | 1 +
frontend/public/themes/dark.css | 6 +++
frontend/src/components/Header.vue | 2 +-
frontend/src/components/buttons/Edit.vue | 17 +++++++
frontend/src/components/buttons/Rename.vue | 2 +-
frontend/src/components/files/Editor.vue | 59 ++++++++++++++--------
frontend/src/components/files/Preview.vue | 52 +++++++++++++------
frontend/src/css/styles.css | 41 ++++++++++++++-
frontend/src/i18n/en.json | 1 +
frontend/src/store/getters.js | 5 +-
frontend/src/store/index.js | 4 +-
frontend/src/store/mutations.js | 6 +++
frontend/src/utils/constants.js | 4 +-
frontend/src/views/Files.vue | 9 ++--
14 files changed, 160 insertions(+), 49 deletions(-)
create mode 100644 frontend/src/components/buttons/Edit.vue
diff --git a/frontend/package.json b/frontend/package.json
index 93865b95..cf73f65f 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -13,6 +13,7 @@
"clipboard": "^2.0.4",
"js-base64": "^2.5.1",
"lodash.clonedeep": "^4.5.0",
+ "marked": "^0.8.0",
"material-design-icons": "^3.0.1",
"moment": "^2.24.0",
"normalize.css": "^8.0.1",
diff --git a/frontend/public/themes/dark.css b/frontend/public/themes/dark.css
index 3fba1f70..e7a47e7e 100644
--- a/frontend/public/themes/dark.css
+++ b/frontend/public/themes/dark.css
@@ -124,6 +124,12 @@ nav > div {
color: var(--textPrimary);
}
+#previewer .text,
+#previewer .markdown,
+#previewer .html {
+ background: var(--surfacePrimary);
+}
+
@media (max-width: 736px) {
#file-selection {
background: var(--surfaceSecondary) !important;
diff --git a/frontend/src/components/Header.vue b/frontend/src/components/Header.vue
index 2ca5658d..bbdc0595 100644
--- a/frontend/src/components/Header.vue
+++ b/frontend/src/components/Header.vue
@@ -8,7 +8,7 @@