diff --git a/package.json b/package.json index 8ca7f55e7a..e8aa6317df 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "babel-preset-react": "^6.5.0", - "babelify": "^7.2.0", + "babelify": "^7.2.0" }, "scripts": { "install": "npm install --save react react-dom; npm install -g browserify; npm install --save babelify babel-preset-react; npm install web3", diff --git a/src/assemblyItemsBrowser.js b/src/assemblyItemsBrowser.js index 52e2d0ec14..ab62adfcf3 100644 --- a/src/assemblyItemsBrowser.js +++ b/src/assemblyItemsBrowser.js @@ -1,8 +1,10 @@ var React = require('react'); var BasicPanel = require('./basicPanel') var Sticker = require('./sticker') +var ButtonNavigator = require('./vmTraceButtonNavigator') var codeUtils = require('./codeUtils') var style = require('./basicStyles') +var Slider = require('./slider'); module.exports = React.createClass({ @@ -36,14 +38,10 @@ module.exports = React.createClass({ return (
Current code: {this.state.currentAddress}
-
- - - - + +
-
@@ -82,7 +80,7 @@ module.exports = React.createClass({ ); }, - + renderStorageRow: function(data) { var ret = [] @@ -117,17 +115,7 @@ module.exports = React.createClass({ this.state.codes[address] = code[0] this.state.instructionsIndexByBytesOffset[address] = code[1] } - }, - - checkButtonState: function(incr) - { - if (!this.props.vmTrace) - return "disabled" - if (incr === -1) - return this.state.currentSelected === 0 ? "disabled" : "" - else if (incr === 1) - return this.state.currentSelected >= this.props.vmTrace.length - 1 ? "disabled" : "" - }, + }, renderAssemblyItems: function() { @@ -170,7 +158,7 @@ module.exports = React.createClass({ updateState: function(props, vmTraceIndex) { - if (!props.vmTrace) + if (!props.vmTrace || !props.vmTrace[vmTraceIndex]) return var previousState = this.state.currentSelected var stateChanges = {} @@ -245,22 +233,6 @@ module.exports = React.createClass({ this.moveSelection(-1) }, - stepOverBack: function() - { - if (this.isReturnInstruction(this.state.currentSelected - 1)) - this.stepOutBack(); - else - this.moveSelection(-1); - }, - - stepOverForward: function() - { - if (this.isCallInstruction(this.state.currentSelected)) - this.stepOutForward(); - else - this.moveSelection(1); - }, - stepIntoForward: function() { this.moveSelection(1) diff --git a/src/debugger.js b/src/debugger.js index 8838d8aa21..fdb570a8d4 100644 --- a/src/debugger.js +++ b/src/debugger.js @@ -6,19 +6,19 @@ var style = require('./basicStyles') module.exports = React.createClass({ getInitialState: function() { - return {vmTrace: null, state: ""} + return {vmTrace: null, state: "", currentStep: -1} }, render: function() { return (
-

Eth Debugger

- -
{this.state.state}
- +

Eth Debugger

+ +
{this.state.state}
+
); - }, + }, retrieveVmTrace: function(blockNumber, txNumber) { diff --git a/src/slider.js b/src/slider.js new file mode 100644 index 0000000000..4205460fca --- /dev/null +++ b/src/slider.js @@ -0,0 +1,31 @@ +var React = require('react'); +var style = require('./sliderStyles') + +module.exports = React.createClass({ + + propTypes: { + onChange: React.PropTypes.func.isRequired, + }, + + getDefaultProps: function() + { + return { + min: 0, + max: 500, + step: 0 + }; + }, + + render: function() { + return ( +
+ +
+ ); + }, + + onChange: function(event) + { + this.props.onChange(event.currentTarget.value) + } +}) diff --git a/src/sliderStyles.js b/src/sliderStyles.js new file mode 100644 index 0000000000..d6cc8de75d --- /dev/null +++ b/src/sliderStyles.js @@ -0,0 +1,17 @@ +module.exports = { + rule: + { + 'width': '600px', + }, + runner: + { + 'position': 'absolute', + 'width': '16px', + 'height': '16px', + 'margin': '0', + 'padding': '0', + 'overflow': 'hidden', + 'border': '1px solid #a4bed4', + 'background-color': '#f1f7ff' + } +} \ No newline at end of file diff --git a/src/vmTraceBrowser.js b/src/vmTraceBrowser.js index 2704e68e2e..11e53326cd 100644 --- a/src/vmTraceBrowser.js +++ b/src/vmTraceBrowser.js @@ -2,7 +2,12 @@ var React = require('react'); var AssemblyItemsBrowser = require('./assemblyItemsBrowser'); module.exports = React.createClass({ + render: function() { - return ( ) - } + return ( +
+ +
+ ) + }, }); diff --git a/src/vmTraceButtonNavigator.js b/src/vmTraceButtonNavigator.js new file mode 100644 index 0000000000..85592c7983 --- /dev/null +++ b/src/vmTraceButtonNavigator.js @@ -0,0 +1,30 @@ +var React = require('react'); + +module.exports = React.createClass({ + + propTypes: { + stepIntoBack: React.PropTypes.func.isRequired, + stepIntoForward: React.PropTypes.func.isRequired, + stepOverBack: React.PropTypes.func.isRequired, + stepOverForward: React.PropTypes.func.isRequired, + }, + + render: function() { + return ( +
+ + + + +
+ ); + }, + + checkButtonState: function(incr) + { + if (incr === -1) + return this.props.step === 0 ? "disabled" : "" + else if (incr === 1) + return this.props.step >= this.props.vmTraceLength - 1 ? "disabled" : "" + }, +}) \ No newline at end of file