|
|
@ -2,24 +2,33 @@ var yo = require('yo-yo') |
|
|
|
var csjs = require('csjs-inject') |
|
|
|
var csjs = require('csjs-inject') |
|
|
|
var remixLib = require('remix-lib') |
|
|
|
var remixLib = require('remix-lib') |
|
|
|
|
|
|
|
|
|
|
|
var Debugger = require('../debugger/debugger') |
|
|
|
var DebuggerUI = require('../debugger/debuggerUI') |
|
|
|
var SourceHighlighter = require('../editor/sourceHighlighter') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var executionContext = require('../../execution-context') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var globalRegistry = require('../../global/registry') |
|
|
|
var globalRegistry = require('../../global/registry') |
|
|
|
var EventManager = remixLib.EventManager |
|
|
|
var EventManager = remixLib.EventManager |
|
|
|
var styles = require('../ui/styles-guide/theme-chooser').chooser() |
|
|
|
var styles = require('../ui/styles-guide/theme-chooser').chooser() |
|
|
|
|
|
|
|
|
|
|
|
module.exports = class DebuggerTab { |
|
|
|
const css = csjs` |
|
|
|
|
|
|
|
.debuggerTabView { |
|
|
|
|
|
|
|
padding: 2%; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.debugger { |
|
|
|
|
|
|
|
margin-bottom: 1%; |
|
|
|
|
|
|
|
${styles.rightPanel.debuggerTab.box_Debugger} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DebuggerTab { |
|
|
|
constructor (localRegistry) { |
|
|
|
constructor (localRegistry) { |
|
|
|
const self = this |
|
|
|
const self = this |
|
|
|
self.event = new EventManager() |
|
|
|
self.event = new EventManager() |
|
|
|
self._view = { el: null } |
|
|
|
self._view = { el: null } |
|
|
|
self.data = {} |
|
|
|
self.data = {} |
|
|
|
self._components = {} |
|
|
|
self._components = {} |
|
|
|
|
|
|
|
// TODO: what is this used for? is repated in debugger.js
|
|
|
|
self._components.registry = localRegistry || globalRegistry |
|
|
|
self._components.registry = localRegistry || globalRegistry |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
render () { |
|
|
|
render () { |
|
|
|
const self = this |
|
|
|
const self = this |
|
|
|
if (self._view.el) return self._view.el |
|
|
|
if (self._view.el) return self._view.el |
|
|
@ -29,23 +38,14 @@ module.exports = class DebuggerTab { |
|
|
|
<div id="debugger" class="${css.debugger}"></div> |
|
|
|
<div id="debugger" class="${css.debugger}"></div> |
|
|
|
</div>` |
|
|
|
</div>` |
|
|
|
|
|
|
|
|
|
|
|
self._view.transactionDebugger = new Debugger(self._view.el.querySelector('#debugger'), new SourceHighlighter()) |
|
|
|
let debuggerUI = new DebuggerUI(self._view.el.querySelector('#debugger')) |
|
|
|
self._view.transactionDebugger.addProvider('vm', executionContext.vm()) |
|
|
|
self._view.transactionDebugger = debuggerUI.view() |
|
|
|
self._view.transactionDebugger.addProvider('injected', executionContext.internalWeb3()) |
|
|
|
|
|
|
|
self._view.transactionDebugger.addProvider('web3', executionContext.internalWeb3()) |
|
|
|
|
|
|
|
self._view.transactionDebugger.switchProvider(executionContext.getProvider()) |
|
|
|
|
|
|
|
return self._view.el |
|
|
|
return self._view.el |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
debugger () { |
|
|
|
debugger () { |
|
|
|
return this._view.transactionDebugger |
|
|
|
return this._view.transactionDebugger |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
const css = csjs` |
|
|
|
|
|
|
|
.debuggerTabView { |
|
|
|
module.exports = DebuggerTab |
|
|
|
padding: 2%; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.debugger { |
|
|
|
|
|
|
|
margin-bottom: 1%; |
|
|
|
|
|
|
|
${styles.rightPanel.debuggerTab.box_Debugger} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
` |
|
|
|
|
|
|
|