Commit c189363e authored by Grandschtroumpf's avatar Grandschtroumpf

Update app and framing service

parent 17bee538
...@@ -33,11 +33,7 @@ var TransactionReceiptResolver = require('./transactionReceiptResolver') ...@@ -33,11 +33,7 @@ var TransactionReceiptResolver = require('./transactionReceiptResolver')
const PluginManagerComponent = require('./app/components/plugin-manager-component') const PluginManagerComponent = require('./app/components/plugin-manager-component')
const VerticalIconsComponent = require('./app/components/vertical-icons-component') const VerticalIcons = require('./app/components/vertical-icons-component')
const VerticalIconsApi = require('./app/components/vertical-icons-api')
const SwapPanelComponent = require('./app/components/swap-panel-component')
const SwapPanelApi = require('./app/components/swap-panel-api')
const CompileTab = require('./app/tabs/compile-tab') const CompileTab = require('./app/tabs/compile-tab')
const SettingsTab = require('./app/tabs/settings-tab') const SettingsTab = require('./app/tabs/settings-tab')
...@@ -55,6 +51,8 @@ import framingService from './framingService' ...@@ -55,6 +51,8 @@ import framingService from './framingService'
import { MainView } from './app/panels/main-view' import { MainView } from './app/panels/main-view'
import { ThemeModule } from './app/tabs/theme-module' import { ThemeModule } from './app/tabs/theme-module'
import { NetworkModule } from './app/tabs/network-module' import { NetworkModule } from './app/tabs/network-module'
import { SwapPanel } from './app/components/swap-panel'
import { MainPanel } from './app/components/main-panel'
var css = csjs` var css = csjs`
html { box-sizing: border-box; } html { box-sizing: border-box; }
...@@ -324,7 +322,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -324,7 +322,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const appManager = new RemixAppManager(appStore) const appManager = new RemixAppManager(appStore)
registry.put({api: appManager, name: 'appmanager'}) registry.put({api: appManager, name: 'appmanager'})
const mainPanelComponent = new SwapPanelComponent('mainPanel', appStore, appManager, { default: false, displayHeader: false })
// ----------------- file manager ---------------------------- // ----------------- file manager ----------------------------
self._components.fileManager = new FileManager() self._components.fileManager = new FileManager()
...@@ -342,6 +339,12 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -342,6 +339,12 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
// ----------------- main view ---------------------- // ----------------- main view ----------------------
self._components.mainview = new MainView(appStore, appManager, mainPanelComponent) self._components.mainview = new MainView(appStore, appManager, mainPanelComponent)
registry.put({ api: self._components.mainview, name: 'mainview' }) registry.put({ api: self._components.mainview, name: 'mainview' })
// ----------------- Vertical Icon ----------------------------
const verticalIcons = new VerticalIcons('swapPanel', appStore)
registry.put({api: verticalIcons, name: 'verticalicon'})
const swapPanel = new SwapPanel(appStore)
const mainPanel = new MainPanel(appStore)
// ----------------- Renderer ----------------- // ----------------- Renderer -----------------
const renderer = new Renderer() const renderer = new Renderer()
...@@ -359,21 +362,11 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -359,21 +362,11 @@ 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()
const swapPanelComponent = new SwapPanelComponent('swapPanel', appStore, appManager, { default: true, displayHeader: true })
registry.put({api: appManager.proxy(), name: 'pluginmanager'}) registry.put({api: appManager.proxy(), name: 'pluginmanager'})
pluginManagerComponent.setApp(appManager) pluginManagerComponent.setApp(appManager)
pluginManagerComponent.setStore(appStore) pluginManagerComponent.setStore(appStore)
// Need to have Home initialized before VerticalIconComponent render to access profile of it for icon
const landingPage = new LandingPage(appManager, appStore)
// ----------------- Vertical Icon ----------------------------
const verticalIconsComponent = new VerticalIconsComponent('swapPanel', appStore, landingPage.profile)
const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconsComponent) // eslint-disable-line
const mainPanelApi = new SwapPanelApi(mainPanelComponent, verticalIconsComponent) // eslint-disable-line
const verticalIconsApi = new VerticalIconsApi(verticalIconsComponent) // eslint-disable-line
registry.put({api: verticalIconsApi, name: 'verticalicon'})
self._components.mainview.init() self._components.mainview.init()
self._components.fileManager.init() self._components.fileManager.init()
...@@ -423,7 +416,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -423,7 +416,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
fileManager.api(), fileManager.api(),
sourceHighlighters.api(), sourceHighlighters.api(),
filePanel.api(), filePanel.api(),
// { profile: support.profile(), api: support },
settings.api(), settings.api(),
pluginManagerComponent.api(), pluginManagerComponent.api(),
networkModule.api(), networkModule.api(),
...@@ -440,7 +432,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -440,7 +432,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...appManager.plugins() ...appManager.plugins()
]) ])
framingService.start(appStore, swapPanelApi, verticalIconsApi, mainPanelApi, this._components.resizeFeature) framingService.start(appStore, swapPanel, verticalIcons, mainPanel, this._components.resizeFeature)
// The event listener needs to be registered as early as possible, because the // The event listener needs to be registered as early as possible, because the
// parent will send the message upon the "load" event. // parent will send the message upon the "load" event.
...@@ -467,7 +459,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -467,7 +459,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
txLogger.event.register('debuggingRequested', (hash) => { txLogger.event.register('debuggingRequested', (hash) => {
if (!appStore.isActive('debugger')) appManager.activateOne('debugger') if (!appStore.isActive('debugger')) appManager.activateOne('debugger')
debug.debugger().debug(hash) debug.debugger().debug(hash)
verticalIconsApi.select('debugger') verticalIcons.select('debugger')
}) })
let transactionContextAPI = { let transactionContextAPI = {
......
export default { export default {
start: (appStore, swapPanelApi, verticalIconApi, mainPanelApi, resizeFeature) => { start: (appStore, swapPanel, verticalIcon, mainPanel, resizeFeature) => {
swapPanelApi.event.on('toggle', () => { swapPanel.events.on('toggle', () => {
resizeFeature.panel1.clientWidth !== 0 ? resizeFeature.minimize() : resizeFeature.maximise() resizeFeature.panel1.clientWidth !== 0 ? resizeFeature.minimize() : resizeFeature.maximise()
}) })
swapPanelApi.event.on('showing', () => { swapPanel.events.on('showing', () => {
resizeFeature.panel1.clientWidth === 0 ? resizeFeature.maximise() : '' resizeFeature.panel1.clientWidth === 0 ? resizeFeature.maximise() : ''
}) })
mainPanelApi.event.on('toggle', () => { mainPanel.events.on('toggle', () => {
resizeFeature.maximise() resizeFeature.maximise()
}) })
// mainPanelApi.event.on('showing', (moduleName) => {})
verticalIconApi.select('fileExplorers') verticalIcon.select('fileExplorers')
mainPanelApi.showContent('home') mainPanel.showContent('home')
document.addEventListener('keypress', (e) => { document.addEventListener('keypress', (e) => {
if (e.shiftKey && e.ctrlKey) { if (e.shiftKey && e.ctrlKey) {
if (e.code === 'KeyF') { // Ctrl+Shift+F if (e.code === 'KeyF') { // Ctrl+Shift+F
verticalIconApi.select('fileExplorers') verticalIcon.select('fileExplorers')
} else if (e.code === 'KeyA') { // Ctrl+Shift+A } else if (e.code === 'KeyA') { // Ctrl+Shift+A
verticalIconApi.select('pluginManager') verticalIcon.select('pluginManager')
} else if (e.code === 'KeyS') { // Ctrl+Shift+S } else if (e.code === 'KeyS') { // Ctrl+Shift+S
verticalIconApi.select('settings') verticalIcon.select('settings')
} }
e.preventDefault() e.preventDefault()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment