I already have an account
@@ -256,11 +260,13 @@ module.exports = React.createClass({
render: function() {
var LoginHeader = sdk.getComponent('login.LoginHeader');
+ var LoginFooter = sdk.getComponent('login.LoginFooter');
return (
{this._getRegisterContentJsx()}
+
);
diff --git a/src/components/views/login/CustomServerDialog.js b/src/components/views/login/CustomServerDialog.js
index dc6a49abd6..92b6c54ac1 100644
--- a/src/components/views/login/CustomServerDialog.js
+++ b/src/components/views/login/CustomServerDialog.js
@@ -31,12 +31,11 @@ module.exports = React.createClass({
servers by specifying a different Home server URL.
This allows you to use this app with an existing Matrix account on
- a different Home server.
+ a different home server.
- You can also set a custom Identity server but this will affect
- people's ability to find you if you use a server in a group other
- than the main Matrix.org group.
+ You can also set a custom identity server but this will typically prevent
+ interaction with users based on email address.
diff --git a/src/components/views/login/PasswordLogin.js b/src/components/views/login/PasswordLogin.js
index a8751da1a7..db00f0c35f 100644
--- a/src/components/views/login/PasswordLogin.js
+++ b/src/components/views/login/PasswordLogin.js
@@ -23,13 +23,24 @@ var ReactDOM = require('react-dom');
module.exports = React.createClass({displayName: 'PasswordLogin',
propTypes: {
onSubmit: React.PropTypes.func.isRequired, // fn(username, password)
- onForgotPasswordClick: React.PropTypes.func // fn()
+ onForgotPasswordClick: React.PropTypes.func, // fn()
+ initialUsername: React.PropTypes.string,
+ initialPassword: React.PropTypes.string,
+ onUsernameChanged: React.PropTypes.func,
+ onPasswordChanged: React.PropTypes.func,
+ },
+
+ getDefaultProps: function() {
+ return {
+ onUsernameChanged: function() {},
+ onPasswordChanged: function() {},
+ };
},
getInitialState: function() {
return {
- username: "",
- password: ""
+ username: this.props.initialUsername,
+ password: this.props.initialPassword,
};
},
@@ -40,10 +51,12 @@ module.exports = React.createClass({displayName: 'PasswordLogin',
onUsernameChanged: function(ev) {
this.setState({username: ev.target.value});
+ this.props.onUsernameChanged(ev.target.value);
},
onPasswordChanged: function(ev) {
this.setState({password: ev.target.value});
+ this.props.onPasswordChanged(ev.target.value);
},
render: function() {
diff --git a/src/components/views/login/ServerConfig.js b/src/components/views/login/ServerConfig.js
index fe80a0d61b..94b9d73f2f 100644
--- a/src/components/views/login/ServerConfig.js
+++ b/src/components/views/login/ServerConfig.js
@@ -29,8 +29,10 @@ module.exports = React.createClass({
propTypes: {
onHsUrlChanged: React.PropTypes.func,
onIsUrlChanged: React.PropTypes.func,
- defaultHsUrl: React.PropTypes.string,
- defaultIsUrl: React.PropTypes.string,
+ initialHsUrl: React.PropTypes.string, // whatever the current value is when we create the component
+ initialIsUrl: React.PropTypes.string, // whatever the current value is when we create the component
+ defaultHsUrl: React.PropTypes.string, // e.g. https://matrix.org
+ defaultIsUrl: React.PropTypes.string, // e.g. https://vector.im
withToggleButton: React.PropTypes.bool,
delayTimeMs: React.PropTypes.number // time to wait before invoking onChanged
},
@@ -46,19 +48,21 @@ module.exports = React.createClass({
getInitialState: function() {
return {
- hs_url: this.props.defaultHsUrl,
- is_url: this.props.defaultIsUrl,
- original_hs_url: this.props.defaultHsUrl,
- original_is_url: this.props.defaultIsUrl,
- // no toggle button = show, toggle button = hide
- configVisible: !this.props.withToggleButton
+ hs_url: this.props.initialHsUrl,
+ is_url: this.props.initialIsUrl,
+ // if withToggleButton is false, then show the config all the time given we have no way otherwise of making it visible
+ configVisible: !this.props.withToggleButton ||
+ (this.props.initialHsUrl !== this.props.defaultHsUrl) ||
+ (this.props.initialIsUrl !== this.props.defaultIsUrl)
}
},
onHomeserverChanged: function(ev) {
this.setState({hs_url: ev.target.value}, function() {
this._hsTimeoutId = this._waitThenInvoke(this._hsTimeoutId, function() {
- this.props.onHsUrlChanged(this.state.hs_url.replace(/\/$/, ""));
+ var hsUrl = this.state.hs_url.trim().replace(/\/$/, "");
+ if (hsUrl === "") hsUrl = this.props.defaultHsUrl;
+ this.props.onHsUrlChanged(hsUrl);
});
});
},
@@ -66,7 +70,9 @@ module.exports = React.createClass({
onIdentityServerChanged: function(ev) {
this.setState({is_url: ev.target.value}, function() {
this._isTimeoutId = this._waitThenInvoke(this._isTimeoutId, function() {
- this.props.onIsUrlChanged(this.state.is_url.replace(/\/$/, ""));
+ var isUrl = this.state.is_url.trim().replace(/\/$/, "");
+ if (isUrl === "") isUrl = this.props.defaultIsUrl;
+ this.props.onIsUrlChanged(isUrl);
});
});
},
@@ -78,18 +84,18 @@ module.exports = React.createClass({
return setTimeout(fn.bind(this), this.props.delayTimeMs);
},
- getHsUrl: function() {
- return this.state.hs_url;
- },
-
- getIsUrl: function() {
- return this.state.is_url;
- },
-
onServerConfigVisibleChange: function(ev) {
this.setState({
configVisible: ev.target.checked
});
+ if (!ev.target.checked) {
+ this.props.onHsUrlChanged(this.props.defaultHsUrl);
+ this.props.onIsUrlChanged(this.props.defaultIsUrl);
+ }
+ else {
+ this.props.onHsUrlChanged(this.state.hs_url);
+ this.props.onIsUrlChanged(this.state.is_url);
+ }
},
showHelpPopup: function() {
@@ -124,14 +130,14 @@ module.exports = React.createClass({
Home server URL