diff --git a/js/text-public.js.LICENSE.txt b/js/text-public.js.LICENSE.txt index 0f3a4ff1b12..74436c6cd4b 100644 --- a/js/text-public.js.LICENSE.txt +++ b/js/text-public.js.LICENSE.txt @@ -33,6 +33,13 @@ object-assign * @license MIT */ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + /*! * Vue.js v2.6.14 * (c) 2014-2021 Evan You diff --git a/src/helpers/files.js b/src/helpers/files.js index f4b5625d07e..46a7b058b1b 100644 --- a/src/helpers/files.js +++ b/src/helpers/files.js @@ -136,7 +136,6 @@ const registerFileActionFallback = () => { const FilesWorkspacePlugin = { el: null, - vm: null, attach(fileList) { if (fileList.id !== 'files' && fileList.id !== 'files.public') { @@ -150,51 +149,6 @@ const FilesWorkspacePlugin = { render: this.render.bind(this), priority: 10, }) - - const PROPERTY_WORKSPACE_FILE = `{${OC.Files.Client.NS_NEXTCLOUD}}rich-workspace-file` - - const oldGetWebdavProperties = fileList._getWebdavProperties - fileList._getWebdavProperties = function() { - return [ - ...oldGetWebdavProperties.apply(this, arguments), - PROPERTY_WORKSPACE_FILE, - ] - } - - let readmeId = null - - fileList.filesClient.addFileInfoParser((response, data) => { - if (data.mimetype === 'httpd/unix-directory') { - const props = response.propStat[0].properties - const dir = data.path + (data.path.endsWith('/') ? '' : '/') + data.name - if (dir === fileList.getCurrentDirectory()) { - readmeId = props[PROPERTY_WORKSPACE_FILE] - this.vm.folder = { - permissions: data.permissions, - } - this.vm.loaded = true - // in case no file is found we are done - this.vm.ready = true - } - } - if (readmeId && data.id === readmeId) { - if (data.mimetype !== 'text/markdown') { - console.warn('Expected workspace file to be markdown:', data) - } - this.open(data) - return - } - /* - * Handle the creation of 'Readme.md'. - * The PROPFIND after the creation does not include the parent dir. - */ - if (data.name === 'Readme.md' - && data.mimetype === 'text/markdown' - && data.path === fileList.getCurrentDirectory()) { - this.open(data) - } - }) - }, render(fileList) { @@ -209,37 +163,21 @@ const FilesWorkspacePlugin = { Vue.prototype.n = window.n Vue.prototype.OCA = window.OCA const View = Vue.extend(RichWorkspace) - this.vm = new View({ + const vm = new View({ propsData: { - file: null, - folder: null, + path: fileList.getCurrentDirectory(), }, store, }).$mount(this.el) fileList.$el.on('urlChanged', data => { - this.vm.file = null - this.vm.folder = null + vm.path = data.dir.toString() }) fileList.$el.on('changeDirectory', data => { - this.vm.file = null - this.vm.folder = null + vm.path = data.dir.toString() }) }) }, - - open(data) { - const previous = this.vm.file - const id = parseInt(data.id) - this.vm.file = { - ...data, - id, - } - if (previous?.id !== id) { - // Editor loads new file. Wait for it to be ready. - this.vm.ready = false - } - }, } export { diff --git a/src/views/RichWorkspace.vue b/src/views/RichWorkspace.vue index f67a5d376fc..1d9f18eecec 100644 --- a/src/views/RichWorkspace.vue +++ b/src/views/RichWorkspace.vue @@ -32,7 +32,7 @@ v-show="ready" :key="file.path" :file-id="file.id" - :relative-path="filepath" + :relative-path="file.path" :share-token="shareToken" :active="true" :autohide="true" @@ -46,26 +46,29 @@