aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/ProxyApp.jsx
diff options
context:
space:
mode:
authorJason <jason.daurus@gmail.com>2016-06-17 21:54:31 +0800
committerJason <jason.daurus@gmail.com>2016-06-17 21:54:31 +0800
commite4addd60f1ffbb445a8c05f3fb2b6c6e61bd7b93 (patch)
treecb5e3be10e8bb813c1ade3aa88204460317d2548 /web/src/js/components/ProxyApp.jsx
parent16a28eca258e07d45c7e2a8ee95368d4eb077d4d (diff)
parent9c6199db9be34fad18eaedb86463333671ae190a (diff)
downloadmitmproxy-e4addd60f1ffbb445a8c05f3fb2b6c6e61bd7b93.tar.gz
mitmproxy-e4addd60f1ffbb445a8c05f3fb2b6c6e61bd7b93.tar.bz2
mitmproxy-e4addd60f1ffbb445a8c05f3fb2b6c6e61bd7b93.zip
Merge branch 'master' into websocket
Conflicts: mitmproxy/web/static/app.css mitmproxy/web/static/app.js web/src/js/components/ProxyApp.jsx
Diffstat (limited to 'web/src/js/components/ProxyApp.jsx')
-rw-r--r--web/src/js/components/ProxyApp.jsx27
1 files changed, 11 insertions, 16 deletions
diff --git a/web/src/js/components/ProxyApp.jsx b/web/src/js/components/ProxyApp.jsx
index 2aedba7c..b5d59b76 100644
--- a/web/src/js/components/ProxyApp.jsx
+++ b/web/src/js/components/ProxyApp.jsx
@@ -3,7 +3,6 @@ import ReactDOM from 'react-dom'
import _ from 'lodash'
import { connect } from 'react-redux'
-import { Splitter } from './common.js'
import { connect as wsConnect } from '../ducks/websocket'
import Header from './Header'
import EventLog from './EventLog'
@@ -15,7 +14,6 @@ class ProxyAppMain extends Component {
static childContextTypes = {
returnFocus: PropTypes.func.isRequired,
- location: PropTypes.object.isRequired,
}
static contextTypes = {
@@ -72,7 +70,7 @@ class ProxyAppMain extends Component {
*/
componentDidMount() {
this.focus()
- this.settingsStore.addListener("recalculate", this.onSettingsChange)
+ this.settingsStore.addListener('recalculate', this.onSettingsChange)
}
/**
@@ -81,7 +79,7 @@ class ProxyAppMain extends Component {
* @todo stop listening to window's key events
*/
componentWillUnmount() {
- this.settingsStore.removeListener("recalculate", this.onSettingsChange)
+ this.settingsStore.removeListener('recalculate', this.onSettingsChange)
}
/**
@@ -95,10 +93,7 @@ class ProxyAppMain extends Component {
* @todo use props
*/
getChildContext() {
- return {
- returnFocus: this.focus,
- location: this.props.location
- }
+ return { returnFocus: this.focus }
}
/**
@@ -112,19 +107,20 @@ class ProxyAppMain extends Component {
/**
* @todo move to actions
+ * @todo bind on window
*/
onKeyDown(e) {
let name = null
switch (e.keyCode) {
case Key.I:
- name = "intercept"
+ name = 'intercept'
break
case Key.L:
- name = "search"
+ name = 'search'
break
case Key.H:
- name = "highlight"
+ name = 'highlight'
break
default:
let main = this.refs.view
@@ -139,7 +135,7 @@ class ProxyAppMain extends Component {
if (name) {
const headerComponent = this.refs.header
- headerComponent.setState({ active: Header.entries.MainMenu }, () => {
+ headerComponent.setState({ active: Header.entries[0] }, () => {
headerComponent.refs.active.refs[name].select()
})
}
@@ -156,12 +152,11 @@ class ProxyAppMain extends Component {
<Header ref="header" settings={settings} updateLocation={this.updateLocation} query={query} />
{React.cloneElement(
children,
- { ref: "view", location, query, updateLocation: this.updateLocation }
+ { ref: 'view', location, query, updateLocation: this.updateLocation }
)}
- {showEventLog && [
- <Splitter key="splitter" axis="y"/>,
+ {showEventLog && (
<EventLog key="eventlog"/>
- ]}
+ )}
<Footer settings={settings}/>
</div>
)