diff options
author | Jason <jason.daurus@gmail.com> | 2016-06-17 21:58:24 +0800 |
---|---|---|
committer | Jason <jason.daurus@gmail.com> | 2016-06-17 21:58:24 +0800 |
commit | c82d27b2a215c075dba71254cafdc86e98e0f2d9 (patch) | |
tree | 84324135951cf67617e4887923bee0627c1d1085 /web/src/js/components/ProxyApp.jsx | |
parent | 6ad2f13341208b8460eae0dd0105c3109e773bae (diff) | |
parent | 9c6199db9be34fad18eaedb86463333671ae190a (diff) | |
download | mitmproxy-c82d27b2a215c075dba71254cafdc86e98e0f2d9.tar.gz mitmproxy-c82d27b2a215c075dba71254cafdc86e98e0f2d9.tar.bz2 mitmproxy-c82d27b2a215c075dba71254cafdc86e98e0f2d9.zip |
Merge branch 'master' into settings
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.jsx | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/web/src/js/components/ProxyApp.jsx b/web/src/js/components/ProxyApp.jsx index 1d27614f..8129b0f0 100644 --- a/web/src/js/components/ProxyApp.jsx +++ b/web/src/js/components/ProxyApp.jsx @@ -1,20 +1,18 @@ -import React, { Component, PropTypes } from "react" -import ReactDOM from "react-dom" -import _ from "lodash" +import React, { Component, PropTypes } from 'react' +import ReactDOM from 'react-dom' +import _ from 'lodash' import { connect } from 'react-redux' import { fetch as fetchSettings } from '../ducks/settings' -import { Splitter } from "./common.js" -import Header from "./Header" -import EventLog from "./EventLog" -import Footer from "./Footer" -import { Key } from "../utils.js" +import Header from './Header' +import EventLog from './EventLog' +import Footer from './Footer' +import { Key } from '../utils.js' class ProxyAppMain extends Component { static childContextTypes = { returnFocus: PropTypes.func.isRequired, - location: PropTypes.object.isRequired, } static contextTypes = { @@ -68,10 +66,7 @@ class ProxyAppMain extends Component { * @todo use props */ getChildContext() { - return { - returnFocus: this.focus, - location: this.props.location - } + return { returnFocus: this.focus } } /** @@ -85,19 +80,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 @@ -112,7 +108,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() }) } @@ -128,12 +124,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> ) |