main.js 1.2 KB

1234567891011121314151617181920212223242526
  1. (function(w){
  2. // conditionally load hightlight.js /w sunburst css from cdn
  3. var codes = document.getElementsByTagName('code');
  4. if (codes.length > 0) {
  5. var css = document.createElement("link");
  6. css.setAttribute("rel", "stylesheet");
  7. css.setAttribute("type", "text/css");
  8. css.setAttribute("href", "https://d2xxklvztqk0jd.cloudfront.net/css/sunburst.css");
  9. document.getElementsByTagName("head")[0].appendChild(css);
  10. var js = document.createElement('script');
  11. js.setAttribute("type", "text/javascript");
  12. js.setAttribute("async", true);
  13. js.onload = function() { hljs.initHighlighting(); };
  14. js.setAttribute("src", "https://d2xxklvztqk0jd.cloudfront.net/js/highlight.js");
  15. var t = document.getElementsByTagName('script')[0]; t.parentNode.insertBefore(js, t);
  16. }
  17. // analytics code
  18. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  19. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  20. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  21. })(w,w.document,'script','//www.google-analytics.com/analytics.js','ga');
  22. ga('create', 'UA-9214337-4', 'auto');
  23. ga('send', 'pageview');
  24. })(window);