diff options
author | Corey Hulen <corey@hulen.com> | 2015-09-02 13:54:15 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-09-02 13:54:15 -0700 |
commit | 858896bd440799ddfe95b6d1cfd8671e2b9b0249 (patch) | |
tree | e4e04e8e59104f259f9e0e9a3954eaf8e1e7205e /web/templates | |
parent | aeecb467d752d01cb345b59876be7f284cf61285 (diff) | |
parent | f79eea185426f28fbe68d87f4360cb714db5f56d (diff) | |
download | chat-858896bd440799ddfe95b6d1cfd8671e2b9b0249.tar.gz chat-858896bd440799ddfe95b6d1cfd8671e2b9b0249.tar.bz2 chat-858896bd440799ddfe95b6d1cfd8671e2b9b0249.zip |
Merge pull request #565 from mattermost/mm-2081
MM-2081 Moving config.js to /web/react/utils/ Including in every file needed
Diffstat (limited to 'web/templates')
-rw-r--r-- | web/templates/head.html | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/web/templates/head.html b/web/templates/head.html index 6b6b7f09d..76ee70ced 100644 --- a/web/templates/head.html +++ b/web/templates/head.html @@ -37,8 +37,8 @@ <script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['annotationchart']}]}"></script> <script type="text/javascript" src="https://cloudfront.loggly.com/js/loggly.tracker.js" async></script> - <script id="config" type="text/javascript" src="/static/config/config.js"></script> <style id="antiClickjack">body{display:none !important;}</style> + <script src="/static/js/bundle.js"></script> <script type="text/javascript"> if (self === top) { var blocker = document.getElementById("antiClickjack"); @@ -46,30 +46,29 @@ } </script> <script> - if (config == null) { - config = {}; + if (window.config == null) { + window.config = {}; } - config.SiteName = '{{ .SiteName }}'; - config.ProfileWidth = '{{ .Props.ProfileWidth }}' - config.ProfileHeight = '{{ .Props.ProfileHeight }}' + window.config.SiteName = '{{ .SiteName }}'; + window.config.ProfileWidth = '{{ .Props.ProfileWidth }}' + window.config.ProfileHeight = '{{ .Props.ProfileHeight }}' </script> - <script src="/static/js/bundle.js"></script> <script> - if (config.LogglyWriteKey != null && config.LogglyWriteKey !== "") { + if (window.config.LogglyWriteKey != null && window.config.LogglyWriteKey !== "") { var LTracker = LTracker || []; window.LTracker = LTracker; - LTracker.push({'logglyKey': config.LogglyWriteKey, 'sendConsoleErrors' : config.LogglyConsoleErrors }); + LTracker.push({'logglyKey': window.config.LogglyWriteKey, 'sendConsoleErrors' : window.config.LogglyConsoleErrors }); } else { window.LTracker = []; console.warn("config.js missing LogglyWriteKey, Loggly analytics is not reporting"); } </script> <script type="text/javascript"> - if (config.SegmentWriteKey != null && config.SegmentWriteKey !== "") { + if (window.config.SegmentWriteKey != null && window.config.SegmentWriteKey !== "") { !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.1"; - analytics.load(config.SegmentWriteKey); + analytics.load(window.config.SegmentWriteKey); var user = window.UserStore.getCurrentUser(true); if (user) { analytics.identify(user.id, { |