2015-06-19 12:53:48 +01:00
|
|
|
var React = require("react");
|
2015-06-09 17:40:42 +01:00
|
|
|
|
2015-06-19 12:53:48 +01:00
|
|
|
module.exports = {
|
2015-06-11 18:25:29 +01:00
|
|
|
propTypes: {
|
|
|
|
|
onHsUrlChanged: React.PropTypes.func,
|
|
|
|
|
onIsUrlChanged: React.PropTypes.func,
|
|
|
|
|
default_hs_url: React.PropTypes.string,
|
|
|
|
|
default_is_url: React.PropTypes.string
|
|
|
|
|
},
|
|
|
|
|
|
2015-06-09 17:40:42 +01:00
|
|
|
getDefaultProps: function() {
|
|
|
|
|
return {
|
2015-06-11 18:25:29 +01:00
|
|
|
onHsUrlChanged: function() {},
|
|
|
|
|
onIsUrlChanged: function() {},
|
|
|
|
|
default_hs_url: 'https://matrix.org/',
|
|
|
|
|
default_is_url: 'https://matrix.org/'
|
2015-06-09 17:40:42 +01:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getInitialState: function() {
|
|
|
|
|
return {
|
2015-06-11 18:25:29 +01:00
|
|
|
hs_url: this.props.default_hs_url,
|
|
|
|
|
is_url: this.props.default_is_url,
|
2015-06-09 17:40:42 +01:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
hsChanged: function(ev) {
|
2015-06-11 18:25:29 +01:00
|
|
|
this.setState({hs_url: ev.target.value});
|
|
|
|
|
this.props.onHsUrlChanged(this.state.hs_url);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
isChanged: function(ev) {
|
|
|
|
|
this.setState({is_url: ev.target.value});
|
|
|
|
|
this.props.onIsUrlChanged(this.state.is_url);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getHsUrl: function() {
|
|
|
|
|
return this.state.hs_url;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getIsUrl: function() {
|
|
|
|
|
return this.state.is_url;
|
2015-06-09 17:40:42 +01:00
|
|
|
},
|
2015-06-19 12:53:48 +01:00
|
|
|
};
|