import React, { Component } from 'react' import PropTypes from 'prop-types' import ValueEditor from './ValueEditor' import classnames from 'classnames' export default class ValidateEditor extends Component { static propTypes = { content: PropTypes.string.isRequired, readonly: PropTypes.bool, onDone: PropTypes.func.isRequired, className: PropTypes.string, isValid: PropTypes.func.isRequired, } constructor(props) { super(props) this.state = { valid: props.isValid(props.content) } this.onInput = this.onInput.bind(this) this.onDone = this.onDone.bind(this) } componentWillReceiveProps(nextProps) { this.setState({ valid: nextProps.isValid(nextProps.content) }) } onInput(content) { this.setState({ valid: this.props.isValid(content) }) } onDone(content) { if (!this.props.isValid(content)) { this.editor.reset() content = this.props.content } this.props.onDone(content) } render() { let className = classnames( this.props.className, { 'has-success': this.state.valid, 'has-warning': !this.state.valid } ) return ( this.editor = e} /> ) } } ect> upstream openwrtJames
aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-3.10/256-crypto_add_kconfig_prompts.patch
blob: 8462c711f02168fbcab88f668cf77aaec48ea634 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47