Merge branch 'swap_it' of https://github.com/ethereum/remix-ide into swap_it

pull/3094/head
Rob Stupay 6 years ago
commit cf112b46c6
  1. 2
      package.json
  2. 69
      src/app.js
  3. 2
      src/app/components/plugin-manager-component.js
  4. 8
      src/lib/store.js

@ -42,7 +42,7 @@
"remix-analyzer": "0.3.1",
"remix-debug": "0.3.1",
"remix-lib": "0.4.1",
"remix-plugin": "0.0.1-alpha.4",
"remix-plugin": "0.0.1-alpha.5",
"remix-solidity": "0.3.1",
"remix-tests": "0.1.1",
"remixd": "0.1.8-alpha.6",

@ -449,15 +449,15 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
// TODOs those are instanciated before hand. should be instanciated on demand
const pluginManagerComponent = new PluginManagerComponent()
let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} }, 'name')
let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} })
const appManager = new RemixAppManager(appStore)
registry.put({api: appManager.proxy(), name: 'pluginmanager'})
pluginManagerComponent.setApp(appManager)
pluginManagerComponent.setStore(appStore)
let filePanel = new FilePanel()
registry.put({api: filePanel, name: 'filepanel'})
let compileTab = new CompileTab(self._components.registry)
let run = new RunTab(self._components.registry)
let settings = new SettingsTab(self._components.registry)
@ -465,28 +465,25 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
let debug = new DebuggerTab(self._components.registry)
let support = new SupportTab(self._components.registry)
let test = new TestTab(self._components.registry, compileTab)
pluginManagerComponent.setApp(appManager)
pluginManagerComponent.setStore(appStore)
let sourceHighlighters = registry.get('editor').api.sourceHighlighters
let configProvider = self._components.filesProviders['config']
appManager.init([
{ profile: this.profile(), api: this },
{ profile: udapp.profile(), api: udapp },
{ profile: fileManager.profile(), api: fileManager },
{ profile: sourceHighlighters.profile(), api: sourceHighlighters },
{ profile: configProvider.profile(), api: configProvider },
{ profile: txListenerModuleProxy.profile(), api: txListenerModuleProxy },
{ profile: compileTab.profile(), api: compileTab },
{ profile: filePanel.profile(), api: filePanel },
{ profile: test.profile(), api: test },
{ profile: support.profile(), api: support },
{ profile: debug.profile(), api: debug },
{ profile: analysis.profile(), api: analysis },
{ profile: settings.profile(), api: settings },
{ profile: run.profile(), api: run },
{ profile: pluginManagerComponent.profile(), api: pluginManagerComponent }])
appStore.addEntities([
{ profile: this.profile(), api: this },
{ profile: udapp.profile(), api: udapp },
{ profile: fileManager.profile(), api: fileManager },
{ profile: sourceHighlighters.profile(), api: sourceHighlighters },
{ profile: configProvider.profile(), api: configProvider },
{ profile: txListenerModuleProxy.profile(), api: txListenerModuleProxy },
{ profile: compileTab.profile(), api: compileTab },
{ profile: filePanel.profile(), api: filePanel },
{ profile: test.profile(), api: test },
{ profile: support.profile(), api: support },
{ profile: debug.profile(), api: debug },
{ profile: analysis.profile(), api: analysis },
{ profile: settings.profile(), api: settings },
{ profile: run.profile(), api: run },
{ profile: pluginManagerComponent.profile(), api: pluginManagerComponent }])
const swapPanelComponent = new SwapPanelComponent()
const verticalIconComponent = new VerticalIconsComponent()
@ -500,18 +497,18 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
self._view.iconpanel.appendChild(verticalIconComponent.render())
self._view.swappanel.appendChild(swapPanelComponent.render())
appManager.doActivate('App')
appManager.doActivate('Udapp')
appManager.doActivate('FileManager')
appManager.doActivate('SourceHighlighters')
appManager.doActivate('config')
appManager.doActivate('TxListener')
appManager.doActivate('FilePanel')
appManager.doActivate('SolidityCompile')
appManager.doActivate('Run')
appManager.doActivate('PluginManager')
appManager.doActivate('Settings')
appManager.doActivate('Support')
appManager.activateOne('App')
appManager.activateOne('Udapp')
appManager.activateOne('FileManager')
appManager.activateOne('SourceHighlighters')
appManager.activateOne('config')
appManager.activateOne('TxListener')
appManager.activateOne('FilePanel')
appManager.activateOne('SolidityCompile')
appManager.activateOne('Run')
appManager.activateOne('PluginManager')
appManager.activateOne('Settings')
appManager.activateOne('Support')
verticalIconComponent.select('FilePanel')

@ -53,7 +53,7 @@ class PluginManagerComponent {
const mod = this.store.getOne(item)
if (!mod) return
let action = () => { this.store.isActive(item) ? this.appManager.doDeactivate(item) : this.appManager.doActivate(item) }
let action = () => { this.store.isActive(item) ? this.appManager.deactivateOne(item) : this.appManager.activateOne(item) }
ctrBtns = yo`<div id='${item}Activation'>
<button onclick=${(event) => { action(event) }} >${this.store.isActive(item) ? 'deactivate' : 'activate'}</button>

@ -135,6 +135,14 @@ export class EntityStore extends Store {
this.state.ids.push(id)
}
/**
* Add entities to the state
* @param {Array} entities
*/
addEntities(entities) {
entities.forEach((entity) => { this.add(entity.profile.name, entity) })
}
/**
* Remove an entity from the state
* @param {(string|number)} id The id of the entity to remove

Loading…
Cancel
Save