remix plugin usage & add comments

pull/1/head
yann300 5 years ago
parent f9f5b18555
commit 24ba9f118c
  1. 10
      src/app.js
  2. 1
      src/app/components/side-panel.js
  3. 2
      src/app/components/vertical-icons.js
  4. 3
      src/app/panels/terminal.js
  5. 2
      src/remixAppManager.js

@ -222,7 +222,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
} }
// APP_MANAGER // APP_MANAGER
const appManager = new RemixAppManager([]) const appManager = new RemixAppManager({})
const workspace = JSON.parse(localStorage.getItem('workspace')) const workspace = JSON.parse(localStorage.getItem('workspace'))
// SERVICES // SERVICES
@ -262,7 +262,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
networkModule, networkModule,
offsetToLineColumnConverter offsetToLineColumnConverter
]) ])
appManager.activate(['contentImport', 'theme', 'sourceHighlighters', 'fileManager', 'compilerMetadata', 'compilerArtefacts', 'udapp', 'network', 'offsetToLineColumnConverter'])
// LAYOUT & SYSTEM VIEWS // LAYOUT & SYSTEM VIEWS
const appPanel = new MainPanel() const appPanel = new MainPanel()
@ -272,7 +271,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
appManager.register([ appManager.register([
appPanel appPanel
]) ])
appManager.activate(['mainPanel'])
// those views depend on app_manager // those views depend on app_manager
const menuicons = new VerticalIcons(appManager) const menuicons = new VerticalIcons(appManager)
@ -302,8 +300,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
settings settings
]) ])
appManager.activate(['menuicons', 'home', 'sidePanel', 'pluginManager', 'fileExplorers', 'settings'])
// CONTENT VIEWS & DEFAULT PLUGINS // CONTENT VIEWS & DEFAULT PLUGINS
let compileTab = new CompileTab( let compileTab = new CompileTab(
editor, editor,
@ -342,6 +338,10 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...appManager.registeredPlugins() ...appManager.registeredPlugins()
]) ])
appManager.activate(['contentImport', 'theme', 'sourceHighlighters', 'fileManager', 'compilerMetadata', 'compilerArtefacts', 'udapp', 'network', 'offsetToLineColumnConverter'])
appManager.activate(['mainPanel'])
appManager.activate(['menuicons', 'home', 'sidePanel', 'pluginManager', 'fileExplorers', 'settings'])
// Set workspace after initial activation // Set workspace after initial activation
if (Array.isArray(workspace)) appManager.activate(workspace) if (Array.isArray(workspace)) appManager.activate(workspace)

@ -59,6 +59,7 @@ const sidePanel = {
required: true required: true
} }
// TODO merge with vertical-icons.js
export class SidePanel extends AbstractPanel { export class SidePanel extends AbstractPanel {
constructor (appManager, verticalIcons) { constructor (appManager, verticalIcons) {

@ -16,7 +16,7 @@ const profile = {
required: true required: true
} }
// Component // TODO merge with side-panel.js. VerticalIcons should not be a plugin
export class VerticalIcons extends Plugin { export class VerticalIcons extends Plugin {
constructor (appManager) { constructor (appManager) {

@ -96,7 +96,8 @@ class Terminal extends Plugin {
self._jsSandboxContext = {} self._jsSandboxContext = {}
self._jsSandboxRegistered = {} self._jsSandboxRegistered = {}
// TODO move this to the application start // TODO move this to the application start. Put it in mainView.
// We should have a HostPlugin which add the terminal.
opts.appManager.register(this) opts.appManager.register(this)
opts.appManager.activate('terminal') opts.appManager.activate('terminal')

@ -42,11 +42,13 @@ export class RemixAppManager extends PluginEngine {
this.event.emit('added', plugin.name) this.event.emit('added', plugin.name)
} }
// TODO check whether this can be removed
ensureActivated (apiName) { ensureActivated (apiName) {
if (!this.isActive(apiName)) this.activateOne(apiName) if (!this.isActive(apiName)) this.activateOne(apiName)
this.event.emit('ensureActivated', apiName) this.event.emit('ensureActivated', apiName)
} }
// TODO check whether this can be removed
ensureDeactivated (apiName) { ensureDeactivated (apiName) {
if (this.isActive(apiName)) this.deactivateOne(apiName) if (this.isActive(apiName)) this.deactivateOne(apiName)
this.event.emit('ensureDeactivated', apiName) this.event.emit('ensureDeactivated', apiName)

Loading…
Cancel
Save