2015-06-23 11:41:25 -04:00
/ *
Copyright 2015 OpenMarket Ltd
Licensed under the Apache License , Version 2.0 ( the "License" ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
http : //www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing , software
distributed under the License is distributed on an "AS IS" BASIS ,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied .
See the License for the specific language governing permissions and
limitations under the License .
* /
'use strict' ;
2015-06-19 07:53:48 -04:00
var React = require ( 'react' ) ;
2015-08-05 06:37:52 -04:00
var Modal = require ( '../../../../src/Modal' ) ;
var ComponentBroker = require ( '../../../../src/ComponentBroker' ) ;
var ErrorDialog = ComponentBroker . get ( 'organisms/ErrorDialog' ) ;
2015-06-19 07:53:48 -04:00
2015-06-23 09:40:50 -04:00
var ServerConfigController = require ( "../../../../src/controllers/molecules/ServerConfig" ) ;
2015-06-19 07:53:48 -04:00
module . exports = React . createClass ( {
2015-06-19 11:21:09 -04:00
displayName : 'ServerConfig' ,
2015-06-19 07:53:48 -04:00
mixins : [ ServerConfigController ] ,
2015-08-05 06:37:52 -04:00
showHelpPopup : function ( ) {
Modal . createDialog ( ErrorDialog , {
title : 'Custom Server Options' ,
description : "You can use the custom server options to log into other Matrix servers by specifying a different Home server URL. This allows you to use Vector with an existing Matrix account on a different Home server. You can also set a cutom Identity server but this will affect people ability to find you if you use a server in a group other than tha main Matrix.org group." ,
button : "Dismiss" ,
focus : true
} ) ;
} ,
2015-06-19 07:53:48 -04:00
render : function ( ) {
return (
2015-07-18 22:19:37 -04:00
< div className = "mx_ServerConfig" >
< label className = "mx_Login_label mx_ServerConfig_hslabel" htmlFor = "hsurl" > Home server URL < / l a b e l >
< input className = "mx_Login_field" id = "hsurl" type = "text" value = { this . state . hs _url } onChange = { this . hsChanged } / >
< label className = "mx_Login_label mx_ServerConfig_islabel" htmlFor = "isurl" > Identity server URL < / l a b e l >
< input className = "mx_Login_field" type = "text" value = { this . state . is _url } onChange = { this . isChanged } / >
2015-08-05 06:37:52 -04:00
< a className = "mx_ServerConfig_help" href = "#" onClick = { this . showHelpPopup } > What does this mean ? < / a >
2015-06-19 07:53:48 -04:00
< / d i v >
) ;
}
} ) ;