summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-06-16 15:35:34 -0400
committerChristopher Speller <crspeller@gmail.com>2015-06-16 15:35:34 -0400
commiteedced16c37248ea02992262ef0a63638db674d0 (patch)
tree47fc02b1fbba4baef18dc610bcc7a2931b9c1b2f /web/react
parentdae0340d7de308d2e6bc7145fb158635b5cdf0ca (diff)
downloadchat-eedced16c37248ea02992262ef0a63638db674d0.tar.gz
chat-eedced16c37248ea02992262ef0a63638db674d0.tar.bz2
chat-eedced16c37248ea02992262ef0a63638db674d0.zip
Switching from config file to parsing homelink from url
Diffstat (limited to 'web/react')
-rw-r--r--web/react/components/login.jsx4
-rw-r--r--web/react/utils/utils.jsx12
2 files changed, 14 insertions, 2 deletions
diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx
index 685e1b058..103a93bc6 100644
--- a/web/react/components/login.jsx
+++ b/web/react/components/login.jsx
@@ -74,7 +74,7 @@ var FindTeamDomain = React.createClass({
<br/>
<br/>
<div>
- <span>{"Want to create your own " + strings.Team + "?"} <a href={config.HomeLink} className="signup-team-login">Sign up now</a></span>
+ <span>{"Want to create your own " + strings.Team + "?"} <a href={utils.getHomeLink()} className="signup-team-login">Sign up now</a></span>
</div>
</form>
</div>
@@ -188,7 +188,7 @@ module.exports = React.createClass({
<a href="/reset_password">I forgot my password</a>
</div>
<div className="external-link">
- <span>{"Want to create your own " + strings.Team + "?"} <a href={config.HomeLink} className="signup-team-login">Sign up now</a></span>
+ <span>{"Want to create your own " + strings.Team + "?"} <a href={utils.getHomeLink()} className="signup-team-login">Sign up now</a></span>
</div>
</form>
</div>
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 72ed48faf..b20e54e84 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -730,3 +730,15 @@ Image.prototype.load = function(url, progressCallback) {
};
Image.prototype.completedPercentage = 0;
+
+module.exports.getHomeLink = function() {
+ if (config.HomeLink != "") {
+ return config.HomeLink;
+ }
+ var parts = window.location.host.split(".");
+ if (parts.length <= 1) {
+ return window.location.host;
+ }
+ parts[0] = "www";
+ return parts.join(".");
+}