diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-07-02 17:25:57 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-07-02 17:25:57 +0300 |
commit | e05626f0c8b8c81ec2592e7bf63b3861924a2df6 (patch) | |
tree | 91cfd5b97e7b2d075eb45434933cb50a0586a3d6 /src/components | |
parent | 46e60926dd5a7d1803bddfcf655b2220a5b8d3a8 (diff) |
Split out helper functions and add syntax detection
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/EditorWrapper.vue | 2 | ||||
-rw-r--r-- | src/components/MenuBar.vue | 2 | ||||
-rw-r--r-- | src/components/PublicFilesEditor.vue | 6 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/components/EditorWrapper.vue b/src/components/EditorWrapper.vue index 9f082668a..77b0f897c 100644 --- a/src/components/EditorWrapper.vue +++ b/src/components/EditorWrapper.vue @@ -179,7 +179,7 @@ export default { return this.mime === 'text/markdown' }, fileExtension() { - return this.relativePath.split('/').pop().split('.').pop() + return this.relativePath ? this.relativePath.split('/').pop().split('.').pop() : 'txt' } }, watch: { diff --git a/src/components/MenuBar.vue b/src/components/MenuBar.vue index 798921977..06d162ccf 100644 --- a/src/components/MenuBar.vue +++ b/src/components/MenuBar.vue @@ -67,7 +67,7 @@ import { EditorMenuBar } from 'tiptap' import Tooltip from 'nextcloud-vue/dist/Directives/Tooltip' import menuBarIcons from './../mixins/menubar' -import { fetchFileInfo } from './../helpers' +import { fetchFileInfo } from './../helpers/files' import Actions from 'nextcloud-vue/dist/Components/Actions' import ActionButton from 'nextcloud-vue/dist/Components/ActionButton' diff --git a/src/components/PublicFilesEditor.vue b/src/components/PublicFilesEditor.vue index 6991ad37c..6e8cb3b73 100644 --- a/src/components/PublicFilesEditor.vue +++ b/src/components/PublicFilesEditor.vue @@ -23,7 +23,7 @@ <template> <modal v-if="active" :title="fileName" @close="close"> <editor-wrapper :file-id="fileId" :relative-path="relativePath" :active="active" - :share-token="shareToken" /> + :share-token="shareToken" :mime="mimeType" /> </modal> </template> @@ -52,6 +52,10 @@ export default { shareToken: { type: String, default: null + }, + mimeType: { + type: String, + default: null } }, computed: { |