main.js 868 B

1234567891011121314151617
  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. })(window);