diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-06-16 15:35:34 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-06-16 15:35:34 -0400 |
commit | 3276b5dbd9479aa0c9fe153878471371bea6bff2 (patch) | |
tree | 44cee0d12c08829c331fdf351bea31481488fcb7 /web/react/utils | |
parent | c556bf3fbae5fab2ce91809aa9956683154a24bb (diff) | |
download | chat-3276b5dbd9479aa0c9fe153878471371bea6bff2.tar.gz chat-3276b5dbd9479aa0c9fe153878471371bea6bff2.tar.bz2 chat-3276b5dbd9479aa0c9fe153878471371bea6bff2.zip |
Switching from config file to parsing homelink from url
Diffstat (limited to 'web/react/utils')
-rw-r--r-- | web/react/utils/utils.jsx | 12 |
1 files changed, 12 insertions, 0 deletions
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("."); +} |