Hash :
8ed7ce3a
Author :
Date :
2015-08-18T19:57:17
!function(){function e(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function t(e,t){return t=" "+t+" ",(" "+e.className+" ").replace(/[\n\t]/g," ").indexOf(t)>-1}function n(e,n,i){for(var a,o=n.replace(/\s+/g,"").split(","),l=+e.getAttribute("data-line-offset")||0,d=r()?parseInt:parseFloat,c=d(getComputedStyle(e).lineHeight),s=0;a=o[s++];){a=a.split("-");var u=+a[0],h=+a[1]||u,m=document.createElement("div");m.textContent=Array(h-u+2).join(" \n"),m.className=(i||"")+" line-highlight",t(e,"line-numbers")||(m.setAttribute("data-start",u),h>u&&m.setAttribute("data-end",h)),m.style.top=(u-l-1)*c+"px",t(e,"line-numbers")?e.appendChild(m):(e.querySelector("code")||e).appendChild(m)}}function i(){var t=location.hash.slice(1);e(".temporary.line-highlight").forEach(function(e){e.parentNode.removeChild(e)});var i=(t.match(/\.([\d,-]+)$/)||[,""])[1];if(i&&!document.getElementById(t)){var r=t.slice(0,t.lastIndexOf(".")),a=document.getElementById(r);a&&(a.hasAttribute("data-line")||a.setAttribute("data-line",""),n(a,i,"temporary "),document.querySelector(".temporary.line-highlight").scrollIntoView())}}if(window.Prism){var r=function(){var e;return function(){if("undefined"==typeof e){var t=document.createElement("div");t.style.fontSize="13px",t.style.lineHeight="1.5",t.style.padding=0,t.style.border=0,t.innerHTML=" <br /> ",document.body.appendChild(t),e=38===t.offsetHeight,document.body.removeChild(t)}return e}}(),a=0;Prism.hooks.add("complete",function(t){var r=t.element.parentNode,o=r&&r.getAttribute("data-line");r&&o&&/pre/i.test(r.nodeName)&&(clearTimeout(a),e(".line-highlight",r).forEach(function(e){e.parentNode.removeChild(e)}),n(r,o),a=setTimeout(i,1))}),addEventListener("hashchange",i)}}();