refactored file-panel a bit

pull/1/head
LianaHus 5 years ago
parent e62ab213d1
commit efbe7ba8b9
  1. 34
      src/app/panels/file-panel.js

@ -55,21 +55,22 @@ module.exports = class Filepanel extends ViewPlugin {
var fileExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['browser'],
['createNewFile', 'publishToGist', 'copyFiles', canUpload ? 'uploadFile' : '']
)
var fileSystemExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['localhost'])
var swarmExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['swarm'])
var githubExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['github'])
var gistExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['gist'], ['updateGist'])
var httpExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['http'])
var httpsExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['https'])
var ipfsExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['ipfs'])
function createProvider(key) {
return new FileExplorer(self._components.registry, self._deps.fileProviders[key])
}
var fileSystemExplorer = createProvider('localhost')
var swarmExplorer = createProvider('swarm')
var githubExplorer = createProvider('github')
var gistExplorer = createProvider('updateGist')
var httpExplorer = createProvider('http')
var httpsExplorer = createProvider('https')
var httpsExplorer = createProvider('ipfs')
self.remixdHandle = new RemixdHandle(fileSystemExplorer, self._deps.fileProviders['localhost'], appManager)
function template () {
return yo`
<div class=${css.container}>
<div class="${css.fileexplorer}">
<div class="${css.fileExplorerTree}">
const explorers = yo`
<div class=${css.treeview}>${fileExplorer.init()}</div>
<div class="filesystemexplorer ${css.treeview}">${fileSystemExplorer.init()}</div>
<div class="swarmexplorer ${css.treeview}">${swarmExplorer.init()}</div>
@ -77,7 +78,14 @@ module.exports = class Filepanel extends ViewPlugin {
<div class="gistexplorer ${css.treeview}">${gistExplorer.init()}</div>
<div class="httpexplorer ${css.treeview}">${httpExplorer.init()}</div>
<div class="httpsexplorer ${css.treeview}">${httpsExplorer.init()}</div>
<div class="httpsexplorer ${css.treeview}">${ipfsExplorer.init()}</div>
`
function template () {
return yo`
<div class=${css.container}>
<div class="${css.fileexplorer}">
<div class="${css.fileExplorerTree}">
${explorers}
</div>
</div>
</div>

Loading…
Cancel
Save