import React, { Component, PropTypes } from 'react' import classnames from 'classnames' import { Key } from '../../utils' export default class ToggleInputButton extends Component { static propTypes = { name: PropTypes.string.isRequired, txt: PropTypes.string, onToggleChanged: PropTypes.func.isRequired, checked: PropTypes.bool.isRequired, placeholder: PropTypes.string.isRequired, inputType: PropTypes.string } constructor(props) { super(props) this.state = { txt: props.txt || '' } } onKeyDown(e) { e.stopPropagation() if (e.keyCode === Key.ENTER) { this.props.onToggleChanged(this.state.txt) } } render() { const {checked, onToggleChanged, name, inputType, placeholder} = this.props return (
onToggleChanged(this.state.txt)}>
  {name}
this.setState({ txt: e.target.value })} onKeyDown={e => this.onKeyDown(e)} />
) } } ail/mitmproxy/commit/examples/complex/change_upstream_proxy.py?id=dd556f052b0045b5e8f14b4810e302b4c2efc81f'>commitdiffstats
path: root/examples/complex/change_upstream_proxy.py
blob: 089a9df58a8f74330c25b59793b5e78ad9b9bb6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27