@@ -74,14 +74,14 @@ module.exports = React.createClass({
7474 */
7575 getFormVals : function ( ) {
7676 return {
77- 'username' : this . refs . user . getDOMNode ( ) . value ,
78- 'password' : this . refs . pass . getDOMNode ( ) . value
77+ 'username' : this . refs . user . getDOMNode ( ) . value . trim ( ) ,
78+ 'password' : this . refs . pass . getDOMNode ( ) . value . trim ( )
7979 } ;
8080 } ,
8181
8282 onHsUrlChanged : function ( ) {
83- this . customHsUrl = this . refs . serverConfig . getHsUrl ( ) ;
84- this . customIsUrl = this . refs . serverConfig . getIsUrl ( ) ;
83+ this . customHsUrl = this . refs . serverConfig . getHsUrl ( ) . trim ( ) ;
84+ this . customIsUrl = this . refs . serverConfig . getIsUrl ( ) . trim ( ) ;
8585 MatrixClientPeg . replaceUsingUrls (
8686 this . getHsUrl ( ) ,
8787 this . getIsUrl ( )
@@ -93,23 +93,24 @@ module.exports = React.createClass({
9393 // XXX: HSes do not have to offer password auth, so we
9494 // need to update and maybe show a different component
9595 // when a new HS is entered.
96- /* if (this.updateHsTimeout) {
96+ if ( this . updateHsTimeout ) {
9797 clearTimeout ( this . updateHsTimeout ) ;
9898 }
9999 var self = this ;
100100 this . updateHsTimeout = setTimeout ( function ( ) {
101101 self . onHSChosen ( ) ;
102- }, 500);*/
102+ } , 500 ) ;
103103 } ,
104104
105105 componentForStep : function ( step ) {
106106 switch ( step ) {
107107 case 'choose_hs' :
108+ case 'fetch_stages' :
108109 var serverConfigStyle = { } ;
109110 serverConfigStyle . display = this . state . serverConfigVisible ? 'block' : 'none' ;
110111 return (
111112 < div >
112- < input className = "mx_Login_checkbox" id = "advanced" type = "checkbox" value = { this . state . serverConfigVisible } onChange = { this . onServerConfigVisibleChange } />
113+ < input className = "mx_Login_checkbox" id = "advanced" type = "checkbox" checked = { this . state . serverConfigVisible } onChange = { this . onServerConfigVisibleChange } />
113114 < label className = "mx_Login_label" htmlFor = "advanced" > Use custom server options (advanced)</ label >
114115 < div style = { serverConfigStyle } >
115116 < ServerConfig ref = "serverConfig"
@@ -126,7 +127,7 @@ module.exports = React.createClass({
126127 < form onSubmit = { this . onUserPassEntered } >
127128 < input className = "mx_Login_field" ref = "user" type = "text" value = { this . state . username } onChange = { this . onUsernameChanged } placeholder = "Email or user name" /> < br />
128129 < input className = "mx_Login_field" ref = "pass" type = "password" value = { this . state . password } onChange = { this . onPasswordChanged } placeholder = "Password" /> < br />
129- { this . componentForStep ( 'choose_hs' ) }
130+ { this . componentForStep ( 'choose_hs' ) }
130131 < input className = "mx_Login_submit" type = "submit" value = "Log in" />
131132 </ form >
132133 </ div >
@@ -143,20 +144,18 @@ module.exports = React.createClass({
143144 } ,
144145
145146 loginContent : function ( ) {
146- if ( this . state . busy ) {
147- return (
148- < Loader />
149- ) ;
150- } else {
151- return (
152- < div >
153- < h2 > Sign in</ h2 >
154- { this . componentForStep ( this . state . step ) }
155- < div className = "mx_Login_error" > { this . state . errorText } </ div >
156- < a className = "mx_Login_create" onClick = { this . showRegister } href = "#" > Create a new account</ a >
147+ var loader = this . state . busy ? < div className = "mx_Login_loader" > < Loader /> </ div > : null ;
148+ return (
149+ < div >
150+ < h2 > Sign in</ h2 >
151+ { this . componentForStep ( this . state . step ) }
152+ < div className = "mx_Login_error" >
153+ { loader }
154+ { this . state . errorText }
157155 </ div >
158- ) ;
159- }
156+ < a className = "mx_Login_create" onClick = { this . showRegister } href = "#" > Create a new account</ a >
157+ </ div >
158+ ) ;
160159 } ,
161160
162161 render : function ( ) {
0 commit comments