From 98be3062753dd0bffe9bd38b4f24f6167bdb50b4 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Thu, 11 Apr 2019 13:58:18 +0200 Subject: [PATCH] Update FileManager --- src/app/files/fileManager.js | 8 +++++--- src/app/tabs/testTab/testTab.js | 2 +- test-browser/plugin/index.html | 2 +- test-browser/plugin/plugin.js | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index da1f7204df..373f6451e3 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -15,12 +15,14 @@ import { FileSystemApi } from 'remix-plugin' const profile = { displayName: 'file manager', name: 'fileManager', - methods: ['getFilesFromPath', 'getCurrentFile', 'getFile', 'setFile'], - events: ['currentFileChanged'], description: 'service - read/write to any files or folders, require giving permissions', permission: true } +// File System profile +// - events: ['currentFileChanged'] +// - methods: ['getFolder', 'getCurrentFile', 'getFile', 'setFile'] + class FileManager extends FileSystemApi { constructor (localRegistry) { super(profile) @@ -220,7 +222,7 @@ class FileManager extends FileSystemApi { } } - getFilesFromPath (path) { + getFolder (path) { // TODO : Change provider with promise return new Promise((resolve, reject) => { const provider = this.fileProviderOf(path) diff --git a/src/app/tabs/testTab/testTab.js b/src/app/tabs/testTab/testTab.js index 1fb04e19e1..620b40aa57 100644 --- a/src/app/tabs/testTab/testTab.js +++ b/src/app/tabs/testTab/testTab.js @@ -26,7 +26,7 @@ class TestTabLogic { var tests = [] let files try { - files = await this.fileManager.getFilesFromPath(path) + files = await this.fileManager.getFolder(path) } catch (e) { cb(e.message) } diff --git a/test-browser/plugin/index.html b/test-browser/plugin/index.html index 62cac2d321..a5a861d9cc 100644 --- a/test-browser/plugin/index.html +++ b/test-browser/plugin/index.html @@ -48,7 +48,7 @@ get content of
get current
set highlight
- get files from path
+ get files from path
add network
remove network

diff --git a/test-browser/plugin/plugin.js b/test-browser/plugin/plugin.js index 1226446c22..62bb971037 100644 --- a/test-browser/plugin/plugin.js +++ b/test-browser/plugin/plugin.js @@ -74,8 +74,8 @@ window.onload = function () { function (error, result) { console.log(error, result) }) }) - document.querySelector('input#getfilesfrompath').addEventListener('click', function () { - extension.call('editor', 'getFilesFromPath', [document.getElementById('filename').value], + document.querySelector('input#getFolder').addEventListener('click', function () { + extension.call('fileManager', 'getFolder', [document.getElementById('filename').value], function (error, result) { console.log(error, result) }) })