add config explorer

pull/3094/head
yann300 7 years ago
parent 505917f918
commit d7d723efbf
  1. 4
      src/app.js
  2. 2
      src/app/files/fileManager.js
  3. 7
      src/app/panels/file-panel.js
  4. 1
      src/config.js

@ -17,6 +17,7 @@ var GistHandler = require('./lib/gist-handler')
var helper = require('./lib/helper')
var Storage = remixLib.Storage
var Browserfiles = require('./app/files/browser-files')
var BrowserfilesTree = require('./app/files/browser-files-tree')
var chromeCloudStorageSync = require('./app/files/chromeCloudStorageSync')
var SharedFolder = require('./app/files/shared-folder')
var Config = require('./config')
@ -111,11 +112,14 @@ class App {
var self = this
self._api = {}
var fileStorage = new Storage('sol:')
var configStorage = new Storage('config:')
self._api.config = new Config(fileStorage)
executionContext.init(self._api.config)
executionContext.listenOnLastBlock()
self._api.filesProviders = {}
self._api.filesProviders['browser'] = new Browserfiles(fileStorage)
self._api.filesProviders['config'] = new BrowserfilesTree('config', configStorage)
self._api.filesProviders['config'].init()
var remixd = new Remixd()
remixd.event.register('system', (message) => {
if (message.error) toolTip(message.error)

@ -24,8 +24,10 @@ class FileManager {
this.opt = opt
this.opt.filesProviders['browser'].event.register('fileRenamed', (oldName, newName, isFolder) => { this.fileRenamedEvent(oldName, newName, isFolder) })
this.opt.filesProviders['localhost'].event.register('fileRenamed', (oldName, newName, isFolder) => { this.fileRenamedEvent(oldName, newName, isFolder) })
this.opt.filesProviders['config'].event.register('fileRenamed', (oldName, newName, isFolder) => { this.fileRenamedEvent(oldName, newName, isFolder) })
this.opt.filesProviders['browser'].event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) })
this.opt.filesProviders['localhost'].event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) })
this.opt.filesProviders['config'].event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) })
// tabs
var $filesEl = $('#files')

@ -45,6 +45,7 @@ function filepanel (appAPI, filesProvider) {
var swarmExplorer = new FileExplorer(appAPI, filesProvider['swarm'])
var githubExplorer = new FileExplorer(appAPI, filesProvider['github'])
var gistExplorer = new FileExplorer(appAPI, filesProvider['gist'])
var configExplorer = new FileExplorer(appAPI, filesProvider['config'])
var dragbar = yo`<div onmousedown=${mousedown} class=${css.dragbar}></div>`
@ -91,6 +92,7 @@ function filepanel (appAPI, filesProvider) {
</div>
<div class=${css.treeviews}>
<div class=${css.treeview}>${fileExplorer.init()}</div>
<div class="configexplorer ${css.treeview}">${configExplorer.init()}</div>
<div class="filesystemexplorer ${css.treeview}">${fileSystemExplorer.init()}</div>
<div class="swarmexplorer ${css.treeview}">${swarmExplorer.init()}</div>
<div class="githubexplorer ${css.treeview}">${githubExplorer.init()}</div>
@ -106,6 +108,7 @@ function filepanel (appAPI, filesProvider) {
self.event = event
var element = template()
fileExplorer.ensureRoot()
configExplorer.ensureRoot()
var websocketconn = element.querySelector('.websocketconn')
filesProvider['localhost'].remixd.event.register('connecting', (event) => {
websocketconn.style.color = styles.colors.yellow
@ -134,6 +137,10 @@ function filepanel (appAPI, filesProvider) {
appAPI.switchFile(path)
})
configExplorer.events.register('focus', function (path) {
appAPI.switchFile(path)
})
fileSystemExplorer.events.register('focus', function (path) {
appAPI.switchFile(path)
})

@ -35,6 +35,7 @@ function Config (storage) {
this.ensureStorageUpdated = function (key) {
if (key === 'currentFile') {
if (this.items[key] && this.items[key] !== '' &&
this.items[key].indexOf('config/') !== 0 &&
this.items[key].indexOf('browser/') !== 0 &&
this.items[key].indexOf('localhost/') !== 0 &&
this.items[key].indexOf('swarm/') !== 0 &&

Loading…
Cancel
Save