Add config file for default hs/is urls

This commit is contained in:
David Baker 2015-10-02 11:48:52 +01:00
parent 7b9cd7c232
commit 2247d951d6
3 changed files with 11 additions and 7 deletions

4
config.json Normal file
View File

@ -0,0 +1,4 @@
{
"default_hs_url": "https://matrix.org",
"default_is_url": "https://vector.im"
}

View File

@ -39,6 +39,7 @@
"babel-loader": "^5.3.2", "babel-loader": "^5.3.2",
"catw": "^1.0.1", "catw": "^1.0.1",
"http-server": "^0.8.4", "http-server": "^0.8.4",
"json-loader": "^0.5.3",
"parallelshell": "^1.2.0", "parallelshell": "^1.2.0",
"rimraf": "^2.4.3", "rimraf": "^2.4.3",
"source-map-loader": "^0.1.5", "source-map-loader": "^0.1.5",

View File

@ -25,10 +25,9 @@ var Loader = require("react-loader");
var LoginController = require('matrix-react-sdk/lib/controllers/templates/Login') var LoginController = require('matrix-react-sdk/lib/controllers/templates/Login')
module.exports = React.createClass({ var config = require('../../../../../config.json');
DEFAULT_HS_URL: 'https://matrix.org',
DEFAULT_IS_URL: 'https://vector.im',
module.exports = React.createClass({
displayName: 'Login', displayName: 'Login',
mixins: [LoginController], mixins: [LoginController],
@ -40,15 +39,15 @@ module.exports = React.createClass({
componentWillMount: function() { componentWillMount: function() {
this.onHSChosen(); this.onHSChosen();
this.customHsUrl = this.DEFAULT_HS_URL; this.customHsUrl = config.default_hs_url;
this.customIsUrl = this.DEFAULT_IS_URL; this.customIsUrl = config.default_is_url;
}, },
getHsUrl: function() { getHsUrl: function() {
if (this.state.serverConfigVisible) { if (this.state.serverConfigVisible) {
return this.customHsUrl; return this.customHsUrl;
} else { } else {
return this.DEFAULT_HS_URL; return config.default_hs_url;
} }
}, },
@ -56,7 +55,7 @@ module.exports = React.createClass({
if (this.state.serverConfigVisible) { if (this.state.serverConfigVisible) {
return this.customIsUrl; return this.customIsUrl;
} else { } else {
return this.DEFAULT_IS_URL; return config.default_is_url;
} }
}, },