From 4805bcf3640e1fc8ec2a6260020618bb48b7a7f2 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 1 Jun 2017 10:50:47 +0100 Subject: [PATCH 1/2] outline font correctly in svg --- res/home/images/logo.svg | 77 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/res/home/images/logo.svg b/res/home/images/logo.svg index 49f1186f..a5f70e5e 100644 --- a/res/home/images/logo.svg +++ b/res/home/images/logo.svg @@ -1 +1,76 @@ -New_logoI M. \ No newline at end of file + + + + +New_logo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 623f9959349da0446eb9a409a536aa707bab63f3 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 1 Jun 2017 11:13:04 +0100 Subject: [PATCH 2/2] fix untested stuff with iframe homepages --- src/components/structures/HomePage.js | 45 +++++++++++++-------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/components/structures/HomePage.js b/src/components/structures/HomePage.js index 8b5b2f3c..05bfc0da 100644 --- a/src/components/structures/HomePage.js +++ b/src/components/structures/HomePage.js @@ -38,44 +38,43 @@ module.exports = React.createClass({ getInitialState: function() { return { - page: "" + iframeSrc: '', + page: '', }; }, componentWillMount: function() { if (this.props.teamToken && this.props.teamServerUrl) { - return; + this.setState({ + iframeSrc: `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html` + }); } + else { + // we use request() to inline the homepage into the react component + // so that it can inherit CSS and theming easily rather than mess around + // with iframes and trying to synchronise document.stylesheets. - // we use request() to inline the homepage into the react component - // so that it can inherit CSS and theming easily rather than mess around - // with iframes and trying to synchronise document.stylesheets. + let src = this.props.homePageUrl || '/home.html'; - let src = this.props.homePageUrl || '/home.html'; + request( + { method: "GET", url: src }, + (err, response, body) => { + if (err || response.status < 200 || response.status >= 300) { + console.log(error); + this.setState({ page: "Couldn't load home page" }); + } - request( - { method: "GET", url: src }, - (err, response, body) => { - if (err || response.status < 200 || response.status >= 300) { - console.log(error); - this.setState({ page: "Couldn't load home page" }); + this.setState({ page: body }); } - - // We parse the JSON ourselves rather than use the JSON - // parameter, since this throws a parse error on empty - // which breaks if there's no config.json and we're - // loading from the filesystem (see above). - this.setState({ page: body }); - } - ); + ); + } }, render: function() { - if (this.props.teamToken && this.props.teamServerUrl) { - src = `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`; + if (this.state.iframeSrc) { return (
-