diff options
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, { |