From e5bf1e930a5b6ba0b3300b02daf792d65d795202 Mon Sep 17 00:00:00 2001
From: Jason <jason.daurus@gmail.com>
Date: Tue, 14 Jun 2016 23:52:00 +0800
Subject: [web] FlowView and ContentView

---
 web/src/js/components/ProxyApp.jsx | 36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)

(limited to 'web/src/js/components/ProxyApp.jsx')

diff --git a/web/src/js/components/ProxyApp.jsx b/web/src/js/components/ProxyApp.jsx
index 81272268..967cc921 100644
--- a/web/src/js/components/ProxyApp.jsx
+++ b/web/src/js/components/ProxyApp.jsx
@@ -1,14 +1,13 @@
-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 { Splitter } from "./common.js"
-import Header from "./Header"
-import EventLog from "./EventLog"
-import Footer from "./Footer"
-import { SettingsStore } from "../store/store.js"
-import { Key } from "../utils.js"
+import Header from './Header'
+import EventLog from './EventLog'
+import Footer from './Footer'
+import { SettingsStore } from '../store/store.js'
+import { Key } from '../utils.js'
 
 class ProxyAppMain extends Component {
 
@@ -67,7 +66,7 @@ class ProxyAppMain extends Component {
      */
     componentDidMount() {
         this.focus()
-        this.settingsStore.addListener("recalculate", this.onSettingsChange)
+        this.settingsStore.addListener('recalculate', this.onSettingsChange)
     }
 
     /**
@@ -76,7 +75,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)
     }
 
     /**
@@ -113,13 +112,13 @@ class ProxyAppMain extends Component {
 
         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
@@ -134,7 +133,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()
             })
         }
@@ -151,12 +150,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>
         )
-- 
cgit v1.2.3


From 034287edcf00eb734cb67e62de58c3bfebf6bb44 Mon Sep 17 00:00:00 2001
From: Jason <jason.daurus@gmail.com>
Date: Fri, 17 Jun 2016 07:57:06 +0800
Subject: [web] clean up

---
 web/src/js/components/ProxyApp.jsx | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

(limited to 'web/src/js/components/ProxyApp.jsx')

diff --git a/web/src/js/components/ProxyApp.jsx b/web/src/js/components/ProxyApp.jsx
index 967cc921..c458639d 100644
--- a/web/src/js/components/ProxyApp.jsx
+++ b/web/src/js/components/ProxyApp.jsx
@@ -13,7 +13,6 @@ class ProxyAppMain extends Component {
 
     static childContextTypes = {
         returnFocus: PropTypes.func.isRequired,
-        location: PropTypes.object.isRequired,
     }
 
     static contextTypes = {
@@ -89,10 +88,7 @@ class ProxyAppMain extends Component {
      * @todo use props
      */
     getChildContext() {
-        return {
-            returnFocus: this.focus,
-            location: this.props.location
-        }
+        return { returnFocus: this.focus }
     }
 
     /**
@@ -106,6 +102,7 @@ class ProxyAppMain extends Component {
 
     /**
      * @todo move to actions
+     * @todo bind on window
      */
     onKeyDown(e) {
         let name = null
-- 
cgit v1.2.3

