diff --git a/js/common.js b/js/common.js index d8da4c1..6b0f9c2 100644 --- a/js/common.js +++ b/js/common.js @@ -1,21 +1,28 @@ remark.macros.scale = function (percentage) { var url = this; return ''; }; var slideshow = remark.create({ highlightLanguage: "terminal", highlightStyle: "tomorrow-night-bright" }); $('code.terminal span.hljs-ansi').replaceWith(function(i, x) { return x.replace(/<(\/?(\w+).*?)>/g, '<$1>') }); $('.quiz td').click(function() { $(this).addClass('clicked'); }); slideshow.on('showSlide', function (slide) { $('.quiz td').removeClass('clicked'); }); + +// If loaded locally, try to inject livereload +if (location.protocol === "file:") { + var s = document.createElement("script"); + s.src = "http://localhost:35729/livereload.js?snipver=1"; + document.body.appendChild(s); +}