aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorolOwOlo <26087907+olOwOlo@users.noreply.github.com>2017-10-12 23:01:06 +0800
committerolOwOlo <26087907+olOwOlo@users.noreply.github.com>2017-10-12 23:01:06 +0800
commit0ba82dd1768e941a5c7014b47a5eacaaefcc4f58 (patch)
tree5028ec809874af388fe88a70df4cd49c8322e876
parent3483df9d839671bfd944fdaec6145ef87a54cdec (diff)
feat: only init toc when there are headings
release 2.6.3
-rw-r--r--layouts/partials/head.html2
-rw-r--r--layouts/partials/scripts.html2
-rw-r--r--src/js/even.js18
-rw-r--r--src/js/main.js1
-rw-r--r--src/package.json2
-rw-r--r--static/dist/even.min.js2
-rw-r--r--static/dist/even.min.js.map2
7 files changed, 21 insertions, 8 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 853aabf..892a857 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -51,7 +51,7 @@
<link rel="mask-icon" href="{{ "safari-pinned-tab.svg" | relURL }}" color="#5bbad5">
<!-- Styles -->
-<link href="{{ "dist/even.min.css?v=2.6.2" | relURL }}" rel="stylesheet">
+<link href="{{ "dist/even.min.css?v=2.6.3" | relURL }}" rel="stylesheet">
{{ if .Site.Params.bootcdn -}}
{{ if .Site.Params.fancybox }}<link href="https://cdn.bootcss.com/fancybox/3.1.20/jquery.fancybox.min.css" rel="stylesheet" crossorigin="anonymous">{{ end }}
{{- else if .Site.Params.publicCDN.enable -}}
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index 285b53b..f966eb2 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -13,7 +13,7 @@
<script type="text/javascript" src="{{ "lib/slideout/slideout-1.0.1.min.js" | relURL }}"></script>
{{ if .Site.Params.fancybox }}<script type="text/javascript" src="{{ "lib/fancybox/jquery.fancybox-3.1.20.min.js" | relURL }}"></script>{{ end }}
{{- end }}
-<script type="text/javascript" src="{{ "dist/even.min.js?v=2.6.2" | relURL }}"></script>
+<script type="text/javascript" src="{{ "dist/even.min.js?v=2.6.3" | relURL }}"></script>
{{- if and (and .Site.Params.mathjax (ne .Params.mathjax false)) (or .IsPage .IsHome) }}
<script type="text/javascript">
diff --git a/src/js/even.js b/src/js/even.js
index 8aa8459..87494c4 100644
--- a/src/js/even.js
+++ b/src/js/even.js
@@ -48,7 +48,7 @@ Even.mobileNavbar = function () {
})
}
-Even.toc = function () {
+Even._initToc = function () {
var SPACING = 20
var $toc = $('.post-toc')
var $footer = $('.post-footer')
@@ -152,7 +152,21 @@ Even.highlight = function () {
}
}
-Even.beforeToc = function () {
+Even.toc = function () {
+ const tocContainer = document.getElementById('post-toc')
+ if (tocContainer !== null) {
+ const toc = document.getElementById('TableOfContents')
+ if (toc === null) {
+ // toc = true, but there are no headings
+ tocContainer.parentNode.removeChild(tocContainer)
+ } else {
+ this._linkToc()
+ this._initToc()
+ }
+ }
+}
+
+Even._linkToc = function () {
const links = document.querySelectorAll('#TableOfContents a')
for (let i = 0; i < links.length; i++) links[i].className += ' toc-link'
diff --git a/src/js/main.js b/src/js/main.js
index 6539cf2..1764dfd 100644
--- a/src/js/main.js
+++ b/src/js/main.js
@@ -5,7 +5,6 @@ import '../css/style.scss'
$(document).ready(function () {
Even.backToTop()
Even.mobileNavbar()
- Even.beforeToc()
Even.toc()
Even.fancybox()
})
diff --git a/src/package.json b/src/package.json
index d44cdaa..2a9fa73 100644
--- a/src/package.json
+++ b/src/package.json
@@ -1,6 +1,6 @@
{
"name": "even-src",
- "version": "2.6.2",
+ "version": "2.6.3",
"description": "even source file",
"main": "index.js",
"scripts": {
diff --git a/static/dist/even.min.js b/static/dist/even.min.js
index 8290fd5..edc1040 100644
--- a/static/dist/even.min.js
+++ b/static/dist/even.min.js
@@ -1,2 +1,2 @@
-!function(e){function n(t){if(o[t])return o[t].exports;var c=o[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,n),c.l=!0,c.exports}var o={};n.m=e,n.c=o,n.d=function(e,o,t){n.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(o,"a",o),o},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=0)}([function(e,n,o){"use strict";var t=o(1);o(2),$(document).ready(function(){t.Even.backToTop(),t.Even.mobileNavbar(),t.Even.beforeToc(),t.Even.toc(),t.Even.fancybox()}),hljs.initHighlighting(),t.Even.highlight()},function(e,n,o){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t={};t.backToTop=function(){var e=$("#back-to-top");$(window).scroll(function(){$(window).scrollTop()>100?e.fadeIn(1e3):e.fadeOut(1e3)}),e.click(function(){$("body,html").animate({scrollTop:0})})},t.mobileNavbar=function(){var e=$("#mobile-navbar"),n=$(".mobile-navbar-icon"),o=new Slideout({panel:document.getElementById("mobile-panel"),menu:document.getElementById("mobile-menu"),padding:180,tolerance:70});o.disableTouch(),n.click(function(){o.toggle()}),o.on("beforeopen",function(){e.addClass("fixed-open"),n.addClass("icon-click").removeClass("icon-out")}),o.on("beforeclose",function(){e.removeClass("fixed-open"),n.addClass("icon-out").removeClass("icon-click")}),$("#mobile-panel").on("touchend",function(){o.isOpen()&&n.click()})},t.toc=function(){var e=$(".post-toc"),n=$(".post-footer");if(e.length){var o=e.offset().top-20,t=n.offset().top-e.height()-20,c={start:{position:"absolute",top:o},process:{position:"fixed",top:20},end:{position:"absolute",top:t}};$(window).scroll(function(){var n=$(window).scrollTop();n<o?e.css(c.start):n>t?e.css(c.end):e.css(c.process)})}var r=$(".toc-link"),i=$(".headerlink"),a=$.map(i,function(e){return $(e).offset().top});$(window).scroll(function(){for(var e=$(window).scrollTop(),n=0;n<r.length;n++){var o=n+1===r.length,t=a[n]-30,c=o?1/0:a[n+1]-30;t<e&&e<=c?$(r[n]).addClass("active"):$(r[n]).removeClass("active")}})},t.fancybox=function(){$.fancybox&&($(".post-content").each(function(){$(this).find("img").each(function(){$(this).wrap('<a class="fancybox" href="'+this.src+'" data-fancybox="gallery" data-caption="'+this.title+'"></a>')})}),$(".fancybox").fancybox({selector:".fancybox",protect:!0}))},t.highlight=function(){for(var e=document.querySelectorAll("pre code"),n=0;n<e.length;n++){for(var o=e[n],t=o.parentElement,c=o.innerHTML.split(/\n/).slice(0,-1),r=c.length,i="",a=0;a<r;a++)i+='<div class="line">'+(a+1)+"</div>";for(var l="",s=0;s<r;s++)l+='<div class="line">'+c[s]+"</div>";o.className+=" highlight";var f=document.createElement("figure");f.className=o.className,f.innerHTML='<table><tbody><tr><td class="gutter"><pre>'+i+'</pre></td><td class="code"><pre>'+l+"</pre></td></tr></tbody></table>",t.parentElement.replaceChild(f,t)}},t.beforeToc=function(){for(var e=document.querySelectorAll("#TableOfContents a"),n=0;n<e.length;n++)e[n].className+=" toc-link";for(var o=1;o<=6;o++)for(var t=document.querySelectorAll(".post-content>h"+o),c=0;c<t.length;c++){var r=t[c];r.innerHTML='<a href="#'+r.id+'" class="headerlink" title="'+r.innerHTML+'"></a>'+r.innerHTML}},n.Even=t},function(e,n){}]);
+!function(e){function n(o){if(t[o])return t[o].exports;var c=t[o]={i:o,l:!1,exports:{}};return e[o].call(c.exports,c,c.exports,n),c.l=!0,c.exports}var t={};n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=0)}([function(e,n,t){"use strict";var o=t(1);t(2),$(document).ready(function(){o.Even.backToTop(),o.Even.mobileNavbar(),o.Even.toc(),o.Even.fancybox()}),hljs.initHighlighting(),o.Even.highlight()},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o={};o.backToTop=function(){var e=$("#back-to-top");$(window).scroll(function(){$(window).scrollTop()>100?e.fadeIn(1e3):e.fadeOut(1e3)}),e.click(function(){$("body,html").animate({scrollTop:0})})},o.mobileNavbar=function(){var e=$("#mobile-navbar"),n=$(".mobile-navbar-icon"),t=new Slideout({panel:document.getElementById("mobile-panel"),menu:document.getElementById("mobile-menu"),padding:180,tolerance:70});t.disableTouch(),n.click(function(){t.toggle()}),t.on("beforeopen",function(){e.addClass("fixed-open"),n.addClass("icon-click").removeClass("icon-out")}),t.on("beforeclose",function(){e.removeClass("fixed-open"),n.addClass("icon-out").removeClass("icon-click")}),$("#mobile-panel").on("touchend",function(){t.isOpen()&&n.click()})},o._initToc=function(){var e=$(".post-toc"),n=$(".post-footer");if(e.length){var t=e.offset().top-20,o=n.offset().top-e.height()-20,c={start:{position:"absolute",top:t},process:{position:"fixed",top:20},end:{position:"absolute",top:o}};$(window).scroll(function(){var n=$(window).scrollTop();n<t?e.css(c.start):n>o?e.css(c.end):e.css(c.process)})}var i=$(".toc-link"),l=$(".headerlink"),a=$.map(l,function(e){return $(e).offset().top});$(window).scroll(function(){for(var e=$(window).scrollTop(),n=0;n<i.length;n++){var t=n+1===i.length,o=a[n]-30,c=t?1/0:a[n+1]-30;o<e&&e<=c?$(i[n]).addClass("active"):$(i[n]).removeClass("active")}})},o.fancybox=function(){$.fancybox&&($(".post-content").each(function(){$(this).find("img").each(function(){$(this).wrap('<a class="fancybox" href="'+this.src+'" data-fancybox="gallery" data-caption="'+this.title+'"></a>')})}),$(".fancybox").fancybox({selector:".fancybox",protect:!0}))},o.highlight=function(){for(var e=document.querySelectorAll("pre code"),n=0;n<e.length;n++){for(var t=e[n],o=t.parentElement,c=t.innerHTML.split(/\n/).slice(0,-1),i=c.length,l="",a=0;a<i;a++)l+='<div class="line">'+(a+1)+"</div>";for(var r="",s=0;s<i;s++)r+='<div class="line">'+c[s]+"</div>";t.className+=" highlight";var f=document.createElement("figure");f.className=t.className,f.innerHTML='<table><tbody><tr><td class="gutter"><pre>'+l+'</pre></td><td class="code"><pre>'+r+"</pre></td></tr></tbody></table>",o.parentElement.replaceChild(f,o)}},o.toc=function(){var e=document.getElementById("post-toc");if(null!==e){null===document.getElementById("TableOfContents")?e.parentNode.removeChild(e):(this._linkToc(),this._initToc())}},o._linkToc=function(){for(var e=document.querySelectorAll("#TableOfContents a"),n=0;n<e.length;n++)e[n].className+=" toc-link";for(var t=1;t<=6;t++)for(var o=document.querySelectorAll(".post-content>h"+t),c=0;c<o.length;c++){var i=o[c];i.innerHTML='<a href="#'+i.id+'" class="headerlink" title="'+i.innerHTML+'"></a>'+i.innerHTML}},n.Even=o},function(e,n){}]);
//# sourceMappingURL=even.min.js.map \ No newline at end of file
diff --git a/static/dist/even.min.js.map b/static/dist/even.min.js.map
index d1cdd07..cd3a06e 100644
--- a/static/dist/even.min.js.map
+++ b/static/dist/even.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///even.min.js","webpack:///webpack/bootstrap d8a7b1fc0ff317775680","webpack:///./js/main.js","webpack:///./js/even.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","_even","$","document","ready","Even","backToTop","mobileNavbar","beforeToc","toc","fancybox","hljs","initHighlighting","highlight","value","$backToTop","window","scroll","scrollTop","fadeIn","fadeOut","click","animate","$mobileNav","$mobileNavIcon","slideout","Slideout","panel","getElementById","menu","padding","tolerance","disableTouch","toggle","on","addClass","removeClass","isOpen","$toc","$footer","length","minScrollTop","offset","top","maxScrollTop","height","tocState","start","position","process","end","css","$toclink","$headerlink","headerlinkTop","map","link","isLastOne","currentTop","nextTop","Infinity","each","this","find","wrap","src","title","selector","protect","blocks","querySelectorAll","block","rootElement","parentElement","lineCodes","innerHTML","split","slice","lineLength","codeLineHtml","codeHtml","className","figure","createElement","replaceChild","links","num","headers","header","id"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,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AASmE,iBAAiB,kBAAoBgB,GACrD3G,EAAI,EAAGA,EAAI4G,EAAQ/C,OAAQ7D,IAAK,CACvC,GAAM6G,GAASD,EAAQ5G,EACvB6G,GAAOb,UAAP,aAAgCa,EAAOC,GAAvC,+BAAwED,EAAOb,UAA/E,SAAiGa,EAAOb,YHoG9GlG,EG/FQ4B,QHmGF,SAAU3B,EAAQD","file":"even.min.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _even = __webpack_require__(1);\n\n__webpack_require__(2);\n\n$(document).ready(function () {\n _even.Even.backToTop();\n _even.Even.mobileNavbar();\n _even.Even.beforeToc();\n _even.Even.toc();\n _even.Even.fancybox();\n});\n\nhljs.initHighlighting();\n_even.Even.highlight();\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar Even = {};\n\nEven.backToTop = function () {\n var $backToTop = $('#back-to-top');\n\n $(window).scroll(function () {\n if ($(window).scrollTop() > 100) {\n $backToTop.fadeIn(1000);\n } else {\n $backToTop.fadeOut(1000);\n }\n });\n\n $backToTop.click(function () {\n $('body,html').animate({ scrollTop: 0 });\n });\n};\n\nEven.mobileNavbar = function () {\n var $mobileNav = $('#mobile-navbar');\n var $mobileNavIcon = $('.mobile-navbar-icon');\n var slideout = new Slideout({\n 'panel': document.getElementById('mobile-panel'),\n 'menu': document.getElementById('mobile-menu'),\n 'padding': 180,\n 'tolerance': 70\n });\n slideout.disableTouch();\n\n $mobileNavIcon.click(function () {\n slideout.toggle();\n });\n\n slideout.on('beforeopen', function () {\n $mobileNav.addClass('fixed-open');\n $mobileNavIcon.addClass('icon-click').removeClass('icon-out');\n });\n\n slideout.on('beforeclose', function () {\n $mobileNav.removeClass('fixed-open');\n $mobileNavIcon.addClass('icon-out').removeClass('icon-click');\n });\n\n $('#mobile-panel').on('touchend', function () {\n slideout.isOpen() && $mobileNavIcon.click();\n });\n};\n\nEven.toc = function () {\n var SPACING = 20;\n var $toc = $('.post-toc');\n var $footer = $('.post-footer');\n\n if ($toc.length) {\n var minScrollTop = $toc.offset().top - SPACING;\n var maxScrollTop = $footer.offset().top - $toc.height() - SPACING;\n\n var tocState = {\n start: {\n 'position': 'absolute',\n 'top': minScrollTop\n },\n process: {\n 'position': 'fixed',\n 'top': SPACING\n },\n end: {\n 'position': 'absolute',\n 'top': maxScrollTop\n }\n };\n\n $(window).scroll(function () {\n var scrollTop = $(window).scrollTop();\n\n if (scrollTop < minScrollTop) {\n $toc.css(tocState.start);\n } else if (scrollTop > maxScrollTop) {\n $toc.css(tocState.end);\n } else {\n $toc.css(tocState.process);\n }\n });\n }\n\n var HEADERFIX = 30;\n var $toclink = $('.toc-link');\n var $headerlink = $('.headerlink');\n\n var headerlinkTop = $.map($headerlink, function (link) {\n return $(link).offset().top;\n });\n\n $(window).scroll(function () {\n var scrollTop = $(window).scrollTop();\n\n for (var i = 0; i < $toclink.length; i++) {\n var isLastOne = i + 1 === $toclink.length;\n var currentTop = headerlinkTop[i] - HEADERFIX;\n var nextTop = isLastOne ? Infinity : headerlinkTop[i + 1] - HEADERFIX;\n\n if (currentTop < scrollTop && scrollTop <= nextTop) {\n $($toclink[i]).addClass('active');\n } else {\n $($toclink[i]).removeClass('active');\n }\n }\n });\n};\n\nEven.fancybox = function () {\n if ($.fancybox) {\n $('.post-content').each(function () {\n $(this).find('img').each(function () {\n $(this).wrap('<a class=\"fancybox\" href=\"' + this.src + '\" data-fancybox=\"gallery\" data-caption=\"' + this.title + '\"></a>');\n });\n });\n\n $('.fancybox').fancybox({\n selector: '.fancybox',\n protect: true\n });\n }\n};\n\nEven.highlight = function () {\n var blocks = document.querySelectorAll('pre code');\n for (var i = 0; i < blocks.length; i++) {\n var block = blocks[i];\n var rootElement = block.parentElement;\n var lineCodes = block.innerHTML.split(/\\n/).slice(0, -1);\n var lineLength = lineCodes.length;\n\n var codeLineHtml = '';\n for (var _i = 0; _i < lineLength; _i++) {\n codeLineHtml += '<div class=\"line\">' + (_i + 1) + '</div>';\n }\n\n var codeHtml = '';\n for (var _i2 = 0; _i2 < lineLength; _i2++) {\n codeHtml += '<div class=\"line\">' + lineCodes[_i2] + '</div>';\n }\n\n block.className += ' highlight';\n var figure = document.createElement('figure');\n figure.className = block.className;\n figure.innerHTML = '<table><tbody><tr><td class=\"gutter\"><pre>' + codeLineHtml + '</pre></td><td class=\"code\"><pre>' + codeHtml + '</pre></td></tr></tbody></table>';\n\n rootElement.parentElement.replaceChild(figure, rootElement);\n }\n};\n\nEven.beforeToc = function () {\n var links = document.querySelectorAll('#TableOfContents a');\n for (var i = 0; i < links.length; i++) {\n links[i].className += ' toc-link';\n }for (var num = 1; num <= 6; num++) {\n var headers = document.querySelectorAll('.post-content>h' + num);\n for (var _i3 = 0; _i3 < headers.length; _i3++) {\n var header = headers[_i3];\n header.innerHTML = '<a href=\"#' + header.id + '\" class=\"headerlink\" title=\"' + header.innerHTML + '\"></a>' + header.innerHTML;\n }\n }\n};\n\nexports.Even = Even;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// even.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap d8a7b1fc0ff317775680","import {Even} from './even.js'\r\n\r\nimport '../css/style.scss'\r\n\r\n$(document).ready(function () {\r\n Even.backToTop()\r\n Even.mobileNavbar()\r\n Even.beforeToc()\r\n Even.toc()\r\n Even.fancybox()\r\n})\r\n\r\nhljs.initHighlighting()\r\nEven.highlight()\r\n\n\n\n// WEBPACK FOOTER //\n// ./js/main.js","'use strict'\r\n\r\nvar Even = {}\r\n\r\nEven.backToTop = function () {\r\n var $backToTop = $('#back-to-top')\r\n\r\n $(window).scroll(function () {\r\n if ($(window).scrollTop() > 100) {\r\n $backToTop.fadeIn(1000)\r\n } else {\r\n $backToTop.fadeOut(1000)\r\n }\r\n })\r\n\r\n $backToTop.click(function () {\r\n $('body,html').animate({ scrollTop: 0 })\r\n })\r\n}\r\n\r\nEven.mobileNavbar = function () {\r\n var $mobileNav = $('#mobile-navbar')\r\n var $mobileNavIcon = $('.mobile-navbar-icon')\r\n var slideout = new Slideout({\r\n 'panel': document.getElementById('mobile-panel'),\r\n 'menu': document.getElementById('mobile-menu'),\r\n 'padding': 180,\r\n 'tolerance': 70\r\n })\r\n slideout.disableTouch()\r\n\r\n $mobileNavIcon.click(function () {\r\n slideout.toggle()\r\n })\r\n\r\n slideout.on('beforeopen', function () {\r\n $mobileNav.addClass('fixed-open')\r\n $mobileNavIcon.addClass('icon-click').removeClass('icon-out')\r\n })\r\n\r\n slideout.on('beforeclose', function () {\r\n $mobileNav.removeClass('fixed-open')\r\n $mobileNavIcon.addClass('icon-out').removeClass('icon-click')\r\n })\r\n\r\n $('#mobile-panel').on('touchend', function () {\r\n slideout.isOpen() && $mobileNavIcon.click()\r\n })\r\n}\r\n\r\nEven.toc = function () {\r\n var SPACING = 20\r\n var $toc = $('.post-toc')\r\n var $footer = $('.post-footer')\r\n\r\n if ($toc.length) {\r\n var minScrollTop = $toc.offset().top - SPACING\r\n var maxScrollTop = $footer.offset().top - $toc.height() - SPACING\r\n\r\n var tocState = {\r\n start: {\r\n 'position': 'absolute',\r\n 'top': minScrollTop\r\n },\r\n process: {\r\n 'position': 'fixed',\r\n 'top': SPACING\r\n },\r\n end: {\r\n 'position': 'absolute',\r\n 'top': maxScrollTop\r\n }\r\n }\r\n\r\n $(window).scroll(function () {\r\n var scrollTop = $(window).scrollTop()\r\n\r\n if (scrollTop < minScrollTop) {\r\n $toc.css(tocState.start)\r\n } else if (scrollTop > maxScrollTop) {\r\n $toc.css(tocState.end)\r\n } else {\r\n $toc.css(tocState.process)\r\n }\r\n })\r\n }\r\n\r\n var HEADERFIX = 30\r\n var $toclink = $('.toc-link')\r\n var $headerlink = $('.headerlink')\r\n\r\n var headerlinkTop = $.map($headerlink, function (link) {\r\n return $(link).offset().top\r\n })\r\n\r\n $(window).scroll(function () {\r\n var scrollTop = $(window).scrollTop()\r\n\r\n for (var i = 0; i < $toclink.length; i++) {\r\n var isLastOne = i + 1 === $toclink.length\r\n var currentTop = headerlinkTop[i] - HEADERFIX\r\n var nextTop = isLastOne ? Infinity : headerlinkTop[i + 1] - HEADERFIX\r\n\r\n if (currentTop < scrollTop && scrollTop <= nextTop) {\r\n $($toclink[i]).addClass('active')\r\n } else {\r\n $($toclink[i]).removeClass('active')\r\n }\r\n }\r\n })\r\n}\r\n\r\nEven.fancybox = function () {\r\n if ($.fancybox) {\r\n $('.post-content').each(function () {\r\n $(this).find('img').each(function () {\r\n $(this).wrap(`<a class=\"fancybox\" href=\"${this.src}\" data-fancybox=\"gallery\" data-caption=\"${this.title}\"></a>`)\r\n })\r\n })\r\n\r\n $('.fancybox').fancybox({\r\n selector: '.fancybox',\r\n protect: true\r\n })\r\n }\r\n}\r\n\r\nEven.highlight = function () {\r\n const blocks = document.querySelectorAll('pre code')\r\n for (let i = 0; i < blocks.length; i++) {\r\n const block = blocks[i]\r\n const rootElement = block.parentElement\r\n const lineCodes = block.innerHTML.split(/\\n/).slice(0, -1)\r\n const lineLength = lineCodes.length\r\n\r\n let codeLineHtml = ''\r\n for (let i = 0; i < lineLength; i++) {\r\n codeLineHtml += `<div class=\"line\">${i + 1}</div>`\r\n }\r\n\r\n let codeHtml = ''\r\n for (let i = 0; i < lineLength; i++) {\r\n codeHtml += `<div class=\"line\">${lineCodes[i]}</div>`\r\n }\r\n\r\n block.className += ' highlight'\r\n const figure = document.createElement('figure')\r\n figure.className = block.className\r\n figure.innerHTML = `<table><tbody><tr><td class=\"gutter\"><pre>${codeLineHtml}</pre></td><td class=\"code\"><pre>${codeHtml}</pre></td></tr></tbody></table>`\r\n\r\n rootElement.parentElement.replaceChild(figure, rootElement)\r\n }\r\n}\r\n\r\nEven.beforeToc = function () {\r\n const links = document.querySelectorAll('#TableOfContents a')\r\n for (let i = 0; i < links.length; i++) links[i].className += ' toc-link'\r\n\r\n for (let num = 1; num <= 6; num++) {\r\n const headers = document.querySelectorAll('.post-content>h' + num)\r\n for (let i = 0; i < headers.length; i++) {\r\n const header = headers[i]\r\n header.innerHTML = `<a href=\"#${header.id}\" class=\"headerlink\" title=\"${header.innerHTML}\"></a>${header.innerHTML}`\r\n }\r\n }\r\n}\r\n\r\nexport {Even}\r\n\n\n\n// WEBPACK FOOTER //\n// ./js/even.js"],"sourceRoot":""} \ No newline at end of file
+{"version":3,"sources":["webpack:///even.min.js","webpack:///webpack/bootstrap c06dd7a07f13bd2ed3fb","webpack:///./js/main.js","webpack:///./js/even.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","_even","$","document","ready","Even","backToTop","mobileNavbar","toc","fancybox","hljs","initHighlighting","highlight","value","$backToTop","window","scroll","scrollTop","fadeIn","fadeOut","click","animate","$mobileNav","$mobileNavIcon","slideout","Slideout","panel","getElementById","menu","padding","tolerance","disableTouch","toggle","on","addClass","removeClass","isOpen","_initToc","$toc","$footer","length","minScrollTop","offset","top","maxScrollTop","height","tocState","start","position","process","end","css","$toclink","$headerlink","headerlinkTop","map","link","isLastOne","currentTop","nextTop","Infinity","each","this","find","wrap","src","title","selector","protect","blocks","querySelectorAll","block","rootElement","parentElement","lineCodes","innerHTML","split","slice","lineLength","codeLineHtml","codeHtml","className","figure","createElement","replaceChild","tocContainer","parentNode","removeChild","_linkToc","links","num","headers","header","id"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAA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AAGA,EAAIgH,EAAQnD,OAAQ7D,IAAK,CACvC,GAAMiH,GAASD,EAAQhH,EACvBiH,GAAOjB,UAAP,aAAgCiB,EAAOC,GAAvC,+BAAwED,EAAOjB,UAA/E,SAAiGiB,EAAOjB,YHmG9GlG,EG9FQ4B,QHkGF,SAAU3B,EAAQD","file":"even.min.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _even = __webpack_require__(1);\n\n__webpack_require__(2);\n\n$(document).ready(function () {\n _even.Even.backToTop();\n _even.Even.mobileNavbar();\n _even.Even.toc();\n _even.Even.fancybox();\n});\n\nhljs.initHighlighting();\n_even.Even.highlight();\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar Even = {};\n\nEven.backToTop = function () {\n var $backToTop = $('#back-to-top');\n\n $(window).scroll(function () {\n if ($(window).scrollTop() > 100) {\n $backToTop.fadeIn(1000);\n } else {\n $backToTop.fadeOut(1000);\n }\n });\n\n $backToTop.click(function () {\n $('body,html').animate({ scrollTop: 0 });\n });\n};\n\nEven.mobileNavbar = function () {\n var $mobileNav = $('#mobile-navbar');\n var $mobileNavIcon = $('.mobile-navbar-icon');\n var slideout = new Slideout({\n 'panel': document.getElementById('mobile-panel'),\n 'menu': document.getElementById('mobile-menu'),\n 'padding': 180,\n 'tolerance': 70\n });\n slideout.disableTouch();\n\n $mobileNavIcon.click(function () {\n slideout.toggle();\n });\n\n slideout.on('beforeopen', function () {\n $mobileNav.addClass('fixed-open');\n $mobileNavIcon.addClass('icon-click').removeClass('icon-out');\n });\n\n slideout.on('beforeclose', function () {\n $mobileNav.removeClass('fixed-open');\n $mobileNavIcon.addClass('icon-out').removeClass('icon-click');\n });\n\n $('#mobile-panel').on('touchend', function () {\n slideout.isOpen() && $mobileNavIcon.click();\n });\n};\n\nEven._initToc = function () {\n var SPACING = 20;\n var $toc = $('.post-toc');\n var $footer = $('.post-footer');\n\n if ($toc.length) {\n var minScrollTop = $toc.offset().top - SPACING;\n var maxScrollTop = $footer.offset().top - $toc.height() - SPACING;\n\n var tocState = {\n start: {\n 'position': 'absolute',\n 'top': minScrollTop\n },\n process: {\n 'position': 'fixed',\n 'top': SPACING\n },\n end: {\n 'position': 'absolute',\n 'top': maxScrollTop\n }\n };\n\n $(window).scroll(function () {\n var scrollTop = $(window).scrollTop();\n\n if (scrollTop < minScrollTop) {\n $toc.css(tocState.start);\n } else if (scrollTop > maxScrollTop) {\n $toc.css(tocState.end);\n } else {\n $toc.css(tocState.process);\n }\n });\n }\n\n var HEADERFIX = 30;\n var $toclink = $('.toc-link');\n var $headerlink = $('.headerlink');\n\n var headerlinkTop = $.map($headerlink, function (link) {\n return $(link).offset().top;\n });\n\n $(window).scroll(function () {\n var scrollTop = $(window).scrollTop();\n\n for (var i = 0; i < $toclink.length; i++) {\n var isLastOne = i + 1 === $toclink.length;\n var currentTop = headerlinkTop[i] - HEADERFIX;\n var nextTop = isLastOne ? Infinity : headerlinkTop[i + 1] - HEADERFIX;\n\n if (currentTop < scrollTop && scrollTop <= nextTop) {\n $($toclink[i]).addClass('active');\n } else {\n $($toclink[i]).removeClass('active');\n }\n }\n });\n};\n\nEven.fancybox = function () {\n if ($.fancybox) {\n $('.post-content').each(function () {\n $(this).find('img').each(function () {\n $(this).wrap('<a class=\"fancybox\" href=\"' + this.src + '\" data-fancybox=\"gallery\" data-caption=\"' + this.title + '\"></a>');\n });\n });\n\n $('.fancybox').fancybox({\n selector: '.fancybox',\n protect: true\n });\n }\n};\n\nEven.highlight = function () {\n var blocks = document.querySelectorAll('pre code');\n for (var i = 0; i < blocks.length; i++) {\n var block = blocks[i];\n var rootElement = block.parentElement;\n var lineCodes = block.innerHTML.split(/\\n/).slice(0, -1);\n var lineLength = lineCodes.length;\n\n var codeLineHtml = '';\n for (var _i = 0; _i < lineLength; _i++) {\n codeLineHtml += '<div class=\"line\">' + (_i + 1) + '</div>';\n }\n\n var codeHtml = '';\n for (var _i2 = 0; _i2 < lineLength; _i2++) {\n codeHtml += '<div class=\"line\">' + lineCodes[_i2] + '</div>';\n }\n\n block.className += ' highlight';\n var figure = document.createElement('figure');\n figure.className = block.className;\n figure.innerHTML = '<table><tbody><tr><td class=\"gutter\"><pre>' + codeLineHtml + '</pre></td><td class=\"code\"><pre>' + codeHtml + '</pre></td></tr></tbody></table>';\n\n rootElement.parentElement.replaceChild(figure, rootElement);\n }\n};\n\nEven.toc = function () {\n var tocContainer = document.getElementById('post-toc');\n if (tocContainer !== null) {\n var toc = document.getElementById('TableOfContents');\n if (toc === null) {\n // toc = true, but there are no headings\n tocContainer.parentNode.removeChild(tocContainer);\n } else {\n this._linkToc();\n this._initToc();\n }\n }\n};\n\nEven._linkToc = function () {\n var links = document.querySelectorAll('#TableOfContents a');\n for (var i = 0; i < links.length; i++) {\n links[i].className += ' toc-link';\n }for (var num = 1; num <= 6; num++) {\n var headers = document.querySelectorAll('.post-content>h' + num);\n for (var _i3 = 0; _i3 < headers.length; _i3++) {\n var header = headers[_i3];\n header.innerHTML = '<a href=\"#' + header.id + '\" class=\"headerlink\" title=\"' + header.innerHTML + '\"></a>' + header.innerHTML;\n }\n }\n};\n\nexports.Even = Even;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// even.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap c06dd7a07f13bd2ed3fb","import {Even} from './even.js'\r\n\r\nimport '../css/style.scss'\r\n\r\n$(document).ready(function () {\r\n Even.backToTop()\r\n Even.mobileNavbar()\r\n Even.toc()\r\n Even.fancybox()\r\n})\r\n\r\nhljs.initHighlighting()\r\nEven.highlight()\r\n\n\n\n// WEBPACK FOOTER //\n// ./js/main.js","'use strict'\r\n\r\nvar Even = {}\r\n\r\nEven.backToTop = function () {\r\n var $backToTop = $('#back-to-top')\r\n\r\n $(window).scroll(function () {\r\n if ($(window).scrollTop() > 100) {\r\n $backToTop.fadeIn(1000)\r\n } else {\r\n $backToTop.fadeOut(1000)\r\n }\r\n })\r\n\r\n $backToTop.click(function () {\r\n $('body,html').animate({ scrollTop: 0 })\r\n })\r\n}\r\n\r\nEven.mobileNavbar = function () {\r\n var $mobileNav = $('#mobile-navbar')\r\n var $mobileNavIcon = $('.mobile-navbar-icon')\r\n var slideout = new Slideout({\r\n 'panel': document.getElementById('mobile-panel'),\r\n 'menu': document.getElementById('mobile-menu'),\r\n 'padding': 180,\r\n 'tolerance': 70\r\n })\r\n slideout.disableTouch()\r\n\r\n $mobileNavIcon.click(function () {\r\n slideout.toggle()\r\n })\r\n\r\n slideout.on('beforeopen', function () {\r\n $mobileNav.addClass('fixed-open')\r\n $mobileNavIcon.addClass('icon-click').removeClass('icon-out')\r\n })\r\n\r\n slideout.on('beforeclose', function () {\r\n $mobileNav.removeClass('fixed-open')\r\n $mobileNavIcon.addClass('icon-out').removeClass('icon-click')\r\n })\r\n\r\n $('#mobile-panel').on('touchend', function () {\r\n slideout.isOpen() && $mobileNavIcon.click()\r\n })\r\n}\r\n\r\nEven._initToc = function () {\r\n var SPACING = 20\r\n var $toc = $('.post-toc')\r\n var $footer = $('.post-footer')\r\n\r\n if ($toc.length) {\r\n var minScrollTop = $toc.offset().top - SPACING\r\n var maxScrollTop = $footer.offset().top - $toc.height() - SPACING\r\n\r\n var tocState = {\r\n start: {\r\n 'position': 'absolute',\r\n 'top': minScrollTop\r\n },\r\n process: {\r\n 'position': 'fixed',\r\n 'top': SPACING\r\n },\r\n end: {\r\n 'position': 'absolute',\r\n 'top': maxScrollTop\r\n }\r\n }\r\n\r\n $(window).scroll(function () {\r\n var scrollTop = $(window).scrollTop()\r\n\r\n if (scrollTop < minScrollTop) {\r\n $toc.css(tocState.start)\r\n } else if (scrollTop > maxScrollTop) {\r\n $toc.css(tocState.end)\r\n } else {\r\n $toc.css(tocState.process)\r\n }\r\n })\r\n }\r\n\r\n var HEADERFIX = 30\r\n var $toclink = $('.toc-link')\r\n var $headerlink = $('.headerlink')\r\n\r\n var headerlinkTop = $.map($headerlink, function (link) {\r\n return $(link).offset().top\r\n })\r\n\r\n $(window).scroll(function () {\r\n var scrollTop = $(window).scrollTop()\r\n\r\n for (var i = 0; i < $toclink.length; i++) {\r\n var isLastOne = i + 1 === $toclink.length\r\n var currentTop = headerlinkTop[i] - HEADERFIX\r\n var nextTop = isLastOne ? Infinity : headerlinkTop[i + 1] - HEADERFIX\r\n\r\n if (currentTop < scrollTop && scrollTop <= nextTop) {\r\n $($toclink[i]).addClass('active')\r\n } else {\r\n $($toclink[i]).removeClass('active')\r\n }\r\n }\r\n })\r\n}\r\n\r\nEven.fancybox = function () {\r\n if ($.fancybox) {\r\n $('.post-content').each(function () {\r\n $(this).find('img').each(function () {\r\n $(this).wrap(`<a class=\"fancybox\" href=\"${this.src}\" data-fancybox=\"gallery\" data-caption=\"${this.title}\"></a>`)\r\n })\r\n })\r\n\r\n $('.fancybox').fancybox({\r\n selector: '.fancybox',\r\n protect: true\r\n })\r\n }\r\n}\r\n\r\nEven.highlight = function () {\r\n const blocks = document.querySelectorAll('pre code')\r\n for (let i = 0; i < blocks.length; i++) {\r\n const block = blocks[i]\r\n const rootElement = block.parentElement\r\n const lineCodes = block.innerHTML.split(/\\n/).slice(0, -1)\r\n const lineLength = lineCodes.length\r\n\r\n let codeLineHtml = ''\r\n for (let i = 0; i < lineLength; i++) {\r\n codeLineHtml += `<div class=\"line\">${i + 1}</div>`\r\n }\r\n\r\n let codeHtml = ''\r\n for (let i = 0; i < lineLength; i++) {\r\n codeHtml += `<div class=\"line\">${lineCodes[i]}</div>`\r\n }\r\n\r\n block.className += ' highlight'\r\n const figure = document.createElement('figure')\r\n figure.className = block.className\r\n figure.innerHTML = `<table><tbody><tr><td class=\"gutter\"><pre>${codeLineHtml}</pre></td><td class=\"code\"><pre>${codeHtml}</pre></td></tr></tbody></table>`\r\n\r\n rootElement.parentElement.replaceChild(figure, rootElement)\r\n }\r\n}\r\n\r\nEven.toc = function () {\r\n const tocContainer = document.getElementById('post-toc')\r\n if (tocContainer !== null) {\r\n const toc = document.getElementById('TableOfContents')\r\n if (toc === null) {\r\n // toc = true, but there are no headings\r\n tocContainer.parentNode.removeChild(tocContainer)\r\n } else {\r\n this._linkToc()\r\n this._initToc()\r\n }\r\n }\r\n}\r\n\r\nEven._linkToc = function () {\r\n const links = document.querySelectorAll('#TableOfContents a')\r\n for (let i = 0; i < links.length; i++) links[i].className += ' toc-link'\r\n\r\n for (let num = 1; num <= 6; num++) {\r\n const headers = document.querySelectorAll('.post-content>h' + num)\r\n for (let i = 0; i < headers.length; i++) {\r\n const header = headers[i]\r\n header.innerHTML = `<a href=\"#${header.id}\" class=\"headerlink\" title=\"${header.innerHTML}\"></a>${header.innerHTML}`\r\n }\r\n }\r\n}\r\n\r\nexport {Even}\r\n\n\n\n// WEBPACK FOOTER //\n// ./js/even.js"],"sourceRoot":""} \ No newline at end of file