Commit 9280d2c8 authored by LianaHus's avatar LianaHus

fixed some errors. Todo: Home is broken

parent cf854ccd
This diff is collapsed.
...@@ -384,12 +384,12 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -384,12 +384,12 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
console.log('couldn\'t register iframe plugins', e.message) console.log('couldn\'t register iframe plugins', e.message)
} }
await appManager.activate(['contentImport', 'theme', 'editor', 'fileManager', 'compilerMetadata', 'compilerArtefacts', 'network', 'offsetToLineColumnConverter']) await appManager.activatePlugin(['contentImport', 'theme', 'editor', 'fileManager', 'compilerMetadata', 'compilerArtefacts', 'network', 'offsetToLineColumnConverter'])
await appManager.activate(['mainPanel']) await appManager.activatePlugin(['mainPanel', 'menuicons'])
await appManager.activate(['menuicons', 'home', 'sidePanel', 'pluginManager', 'fileExplorers', 'settings', 'contextualListener', 'terminal']) await appManager.activatePlugin(['home', 'sidePanel', 'pluginManager', 'fileExplorers', 'settings', 'contextualListener', 'terminal'])
// Set workspace after initial activation // Set workspace after initial activation
if (Array.isArray(workspace)) await appManager.activate(workspace) if (Array.isArray(workspace)) await appManager.activatePlugin(workspace)
// Load and start the service who manager layout and frame // Load and start the service who manager layout and frame
const framingService = new FramingService(sidePanel, menuicons, mainview, this._components.resizeFeature) const framingService = new FramingService(sidePanel, menuicons, mainview, this._components.resizeFeature)
...@@ -415,6 +415,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -415,6 +415,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
} }
if (isElectron()) { if (isElectron()) {
appManager.activate(['remixd']) appManager.activatePlugin(['remixd'])
} }
} }
...@@ -14,7 +14,7 @@ const profile = { ...@@ -14,7 +14,7 @@ const profile = {
displayName: 'Hidden Panel', displayName: 'Hidden Panel',
description: '', description: '',
version: packageJson.version, version: packageJson.version,
methods: {} methods: []
} }
export class HiddenPanel extends AbstractPanel { export class HiddenPanel extends AbstractPanel {
......
import { EventEmitter } from 'events' import { EventEmitter } from 'events'
const csjs = require('csjs-inject') const csjs = require('csjs-inject')
const yo = require('yo-yo') const yo = require('yo-yo')
const { HostPlugin } = require('@remixproject/engine') import { HostPlugin } from '@remixproject/engine'
const css = csjs` const css = csjs`
.plugins { .plugins {
......
...@@ -62,7 +62,8 @@ export class SidePanel extends AbstractPanel { ...@@ -62,7 +62,8 @@ export class SidePanel extends AbstractPanel {
constructor (appManager, verticalIcons) { constructor (appManager, verticalIcons) {
super(sidePanel) super(sidePanel)
this.appManager = appManager this.appManager = appManager
this.header = this.renderHeader() this.header = yo`<header></header>`
this.renderHeader()
this.verticalIcons = verticalIcons this.verticalIcons = verticalIcons
// Toggle content // Toggle content
...@@ -103,18 +104,18 @@ export class SidePanel extends AbstractPanel { ...@@ -103,18 +104,18 @@ export class SidePanel extends AbstractPanel {
* Display content and update the header * Display content and update the header
* @param {String} name The name of the plugin to display * @param {String} name The name of the plugin to display
*/ */
showContent (name) { async showContent (name) {
super.showContent(name) super.showContent(name)
yo.update(this.header, this.renderHeader()) this.renderHeader()
} }
/** The header of the side panel */ /** The header of the side panel */
renderHeader () { async renderHeader () {
let name = ' - ' let name = ' - '
let docLink = '' let docLink = ''
let versionWarning let versionWarning
if (this.active) { if (this.active) {
const { profile } = this.appManager.getPlugin(this.active) const profile = await this.appManager.getProfile(this.active)
name = profile.displayName ? profile.displayName : profile.name name = profile.displayName ? profile.displayName : profile.name
docLink = profile.documentation ? yo`<a href="${profile.documentation}" class="${css.titleInfo}" title="link to documentation" target="_blank"><i aria-hidden="true" class="fas fa-book"></i></a>` : '' docLink = profile.documentation ? yo`<a href="${profile.documentation}" class="${css.titleInfo}" title="link to documentation" target="_blank"><i aria-hidden="true" class="fas fa-book"></i></a>` : ''
if (profile.version && profile.version.match(/\b(\w*alpha\w*)\b/g)) { if (profile.version && profile.version.match(/\b(\w*alpha\w*)\b/g)) {
...@@ -126,13 +127,14 @@ export class SidePanel extends AbstractPanel { ...@@ -126,13 +127,14 @@ export class SidePanel extends AbstractPanel {
} }
} }
return yo` const header = yo`
<header class="${css.swapitHeader} px-3"> <header class="${css.swapitHeader} px-3">
<h6 class="${css.swapitTitle}" data-id="sidePanelSwapitTitle">${name}</h6> <h6 class="${css.swapitTitle}" data-id="sidePanelSwapitTitle">${name}</h6>
${docLink} ${docLink}
${versionWarning} ${versionWarning}
</header> </header>
` `
yo.update(this.header, header)
} }
render () { render () {
......
...@@ -98,9 +98,6 @@ class Terminal extends Plugin { ...@@ -98,9 +98,6 @@ class Terminal extends Plugin {
if (opts.shell) self._shell = opts.shell // ??? if (opts.shell) self._shell = opts.shell // ???
register(self) register(self)
} }
setTxListener(txListener) {
this._opts.txListener = txListener
}
logHtml (html) { logHtml (html) {
var command = this.commands['html'] var command = this.commands['html']
if (typeof command === 'function') command(html) if (typeof command === 'function') command(html)
...@@ -137,7 +134,7 @@ class Terminal extends Plugin { ...@@ -137,7 +134,7 @@ class Terminal extends Plugin {
self._view.inputSearch = yo`<input self._view.inputSearch = yo`<input
spellcheck="false" spellcheck="false"
type="text" type="text"
class="${css.filter} form-control" class="border ${css.filter} form-control"
id="searchInput" id="searchInput"
onkeydown=${filter} onkeydown=${filter}
placeholder="Search with transaction hash or address"> placeholder="Search with transaction hash or address">
...@@ -436,7 +433,7 @@ class Terminal extends Plugin { ...@@ -436,7 +433,7 @@ class Terminal extends Plugin {
self._shell('remix.help()', self.commands, () => {}) self._shell('remix.help()', self.commands, () => {})
self.commands.html(intro) self.commands.html(intro)
self._components.txLogger = new TxLogger(self._opts.eventsDecoder, self._opts.txListener, this, self.blockchain) self._components.txLogger = new TxLogger(this, self.blockchain)
self._components.txLogger.event.register('debuggingRequested', (hash) => { self._components.txLogger.event.register('debuggingRequested', (hash) => {
// TODO should probably be in the run module // TODO should probably be in the run module
if (!self._opts.appManager.isActive('debugger')) self._opts.appManager.activatePlugin('debugger') if (!self._opts.appManager.isActive('debugger')) self._opts.appManager.activatePlugin('debugger')
......
...@@ -189,8 +189,8 @@ class AutoCompletePopup { ...@@ -189,8 +189,8 @@ class AutoCompletePopup {
extendAutocompletion () { extendAutocompletion () {
// TODO: this is not using the appManager interface. Terminal should be put as module // TODO: this is not using the appManager interface. Terminal should be put as module
this.opts.appManager.event.on('activate', (id) => { this.opts.appManager.event.on('activate', async (id) => {
const profile = this.opts.appManager.getPlugin(id).profile const profile = await this.opts.appManager.getProfile(id)
if (!profile.methods) return if (!profile.methods) return
profile.methods.forEach((method) => { profile.methods.forEach((method) => {
const key = `remix.call({name: '${id}', key:'${method}', payload: []}).then((result) => { console.log(result) }).catch((error) => { console.log(error) })` const key = `remix.call({name: '${id}', key:'${method}', payload: []}).then((result) => { console.log(result) }).catch((error) => { console.log(error) })`
......
...@@ -125,8 +125,8 @@ class TxLogger { ...@@ -125,8 +125,8 @@ class TxLogger {
} }
return false return false
} }
this.eventsDecoder = globalRegistry.get('eventsDecoder').api this.eventsDecoder = globlalRegistry.get('eventsDecoder').api
this.txListener = globalRegistry.get('txListener').api this.txListener = globlalRegistry.get('txlistener').api
this.terminal = terminal this.terminal = terminal
// dependencies // dependencies
this._deps = { this._deps = {
......
...@@ -8,9 +8,9 @@ const requiredModules = [ // services + layout views + system views ...@@ -8,9 +8,9 @@ const requiredModules = [ // services + layout views + system views
'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons', 'fileExplorers', 'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons', 'fileExplorers',
'terminal', 'settings', 'pluginManager'] 'terminal', 'settings', 'pluginManager']
export function isNative(name) { export function isNative (name) {
const nativePlugins = ['vyper', 'workshops', 'ethdoc', 'etherscan'] const nativePlugins = ['vyper', 'workshops', 'ethdoc', 'etherscan']
return nativePlugins.includes(name) return nativePlugins.includes(name) || requiredModules.includes(name)
} }
export class RemixAppManager extends PluginManager { export class RemixAppManager extends PluginManager {
......
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