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

pull/1/head
Rob Stupay 6 years ago
commit ae24dd0ea0
  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-analyzer": "0.3.1",
"remix-debug": "0.3.1", "remix-debug": "0.3.1",
"remix-lib": "0.4.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-solidity": "0.3.1",
"remix-tests": "0.1.1", "remix-tests": "0.1.1",
"remixd": "0.1.8-alpha.6", "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 // TODOs those are instanciated before hand. should be instanciated on demand
const pluginManagerComponent = new PluginManagerComponent() const pluginManagerComponent = new PluginManagerComponent()
let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} })
let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} }, 'name')
const appManager = new RemixAppManager(appStore) const appManager = new RemixAppManager(appStore)
registry.put({api: appManager.proxy(), name: 'pluginmanager'}) registry.put({api: appManager.proxy(), name: 'pluginmanager'})
pluginManagerComponent.setApp(appManager)
pluginManagerComponent.setStore(appStore)
let filePanel = new FilePanel() let filePanel = new FilePanel()
registry.put({api: filePanel, name: 'filepanel'}) registry.put({api: filePanel, name: 'filepanel'})
let compileTab = new CompileTab(self._components.registry) let compileTab = new CompileTab(self._components.registry)
let run = new RunTab(self._components.registry) let run = new RunTab(self._components.registry)
let settings = new SettingsTab(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 debug = new DebuggerTab(self._components.registry)
let support = new SupportTab(self._components.registry) let support = new SupportTab(self._components.registry)
let test = new TestTab(self._components.registry, compileTab) let test = new TestTab(self._components.registry, compileTab)
pluginManagerComponent.setApp(appManager)
pluginManagerComponent.setStore(appStore)
let sourceHighlighters = registry.get('editor').api.sourceHighlighters let sourceHighlighters = registry.get('editor').api.sourceHighlighters
let configProvider = self._components.filesProviders['config'] let configProvider = self._components.filesProviders['config']
appManager.init([
{ profile: this.profile(), api: this }, appStore.addEntities([
{ profile: udapp.profile(), api: udapp }, { profile: this.profile(), api: this },
{ profile: fileManager.profile(), api: fileManager }, { profile: udapp.profile(), api: udapp },
{ profile: sourceHighlighters.profile(), api: sourceHighlighters }, { profile: fileManager.profile(), api: fileManager },
{ profile: configProvider.profile(), api: configProvider }, { profile: sourceHighlighters.profile(), api: sourceHighlighters },
{ profile: txListenerModuleProxy.profile(), api: txListenerModuleProxy }, { profile: configProvider.profile(), api: configProvider },
{ profile: compileTab.profile(), api: compileTab }, { profile: txListenerModuleProxy.profile(), api: txListenerModuleProxy },
{ profile: filePanel.profile(), api: filePanel }, { profile: compileTab.profile(), api: compileTab },
{ profile: test.profile(), api: test }, { profile: filePanel.profile(), api: filePanel },
{ profile: support.profile(), api: support }, { profile: test.profile(), api: test },
{ profile: debug.profile(), api: debug }, { profile: support.profile(), api: support },
{ profile: analysis.profile(), api: analysis }, { profile: debug.profile(), api: debug },
{ profile: settings.profile(), api: settings }, { profile: analysis.profile(), api: analysis },
{ profile: run.profile(), api: run }, { profile: settings.profile(), api: settings },
{ profile: pluginManagerComponent.profile(), api: pluginManagerComponent }]) { profile: run.profile(), api: run },
{ profile: pluginManagerComponent.profile(), api: pluginManagerComponent }])
const swapPanelComponent = new SwapPanelComponent() const swapPanelComponent = new SwapPanelComponent()
const verticalIconComponent = new VerticalIconsComponent() 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.iconpanel.appendChild(verticalIconComponent.render())
self._view.swappanel.appendChild(swapPanelComponent.render()) self._view.swappanel.appendChild(swapPanelComponent.render())
appManager.doActivate('App') appManager.activateOne('App')
appManager.doActivate('Udapp') appManager.activateOne('Udapp')
appManager.doActivate('FileManager') appManager.activateOne('FileManager')
appManager.doActivate('SourceHighlighters') appManager.activateOne('SourceHighlighters')
appManager.doActivate('config') appManager.activateOne('config')
appManager.doActivate('TxListener') appManager.activateOne('TxListener')
appManager.doActivate('FilePanel') appManager.activateOne('FilePanel')
appManager.doActivate('SolidityCompile') appManager.activateOne('SolidityCompile')
appManager.doActivate('Run') appManager.activateOne('Run')
appManager.doActivate('PluginManager') appManager.activateOne('PluginManager')
appManager.doActivate('Settings') appManager.activateOne('Settings')
appManager.doActivate('Support') appManager.activateOne('Support')
verticalIconComponent.select('FilePanel') verticalIconComponent.select('FilePanel')

@ -53,7 +53,7 @@ class PluginManagerComponent {
const mod = this.store.getOne(item) const mod = this.store.getOne(item)
if (!mod) return 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'> ctrBtns = yo`<div id='${item}Activation'>
<button onclick=${(event) => { action(event) }} >${this.store.isActive(item) ? 'deactivate' : 'activate'}</button> <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) 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 * Remove an entity from the state
* @param {(string|number)} id The id of the entity to remove * @param {(string|number)} id The id of the entity to remove

Loading…
Cancel
Save