PageSourceSearch

https://chenzaichun.github.io/js/main.min.c99b103c33d1539acf3025e1913697534542c4a5aa5af0ccc20475ed2863603b.js

js chenzaichun.github.io collected 2026-10-03 08:47:16 UTC 5,222 bytes, 1 lines download raw bytes

1'use strict';const Even={};Even.backToTop=function(){const a=$('#back-to-top');$(window).scroll(function(){$(window).scrollTop()>100?a.fadeIn(1e3):a.fadeOut(1e3)}),a.click(function(){$('body,html').animate({scrollTop:0})})},Even.mobileNavbar=function(){const c=$('#mobile-navbar'),b=$('.mobile-navbar-icon'),a=new Slideout({panel:document.getElementById('mobile-panel'),menu:document.getElementById('mobile-menu'),padding:180,tolerance:70});a.disableTouch(),b.click(function(){a.toggle()}),a.on('beforeopen',function(){c.addClass('fixed-open'),b.addClass('icon-click').removeClass('icon-out')}),a.on('beforeclose',function(){c.removeClass('fixed-open'),b.addClass('icon-out').removeClass('icon-click')}),$('#mobile-panel').on('touchend',function(){a.isOpen()&&b.click()})},Even._initToc=function(){const c=20,a=$('.post-toc'),d=$('.post-footer');if(a.length){const e=a.offset().top-c,f=d.offset().top-a.height()-c,b={start:{position:'absolute',top:e},process:{position:'fixed',top:c},end:{position:'absolute',top:f}};$(window).scroll(function(){const c=$(window).scrollTop();c<e?a.css(b.start):c>f?a.css(b.end):a.css(b.process)})}const e=30,b=$('.toc-link'),f=$('.headerlink'),g=$('.post-toc-content li'),h=$.map(f,function(a){return $(a).offset().top}),i=$.map(h,function(a){return a-e}),j=function(a,b){for(let c=0;c<a.length-1;c++)if(b>a[c]&&b<=a[c+1])return c;return b>a[a.length-1]?a.length-1:-1};$(window).scroll(function(){const c=$(window).scrollTop(),a=j(i,c);if($(b).removeClass('active'),$(g).removeClass('has-active'),a!==-1&&b[a]!=null){$(b[a]).addClass('active');let c=b[a].parentNode;while(c.tagName!=='NAV')$(c).addClass('has-active'),c=c.parentNode.parentNode}})},Even.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}))},Even.highlight=function(){const a=document.querySelectorAll('pre code');for(let d=0;d<a.length;d++){const c=a[d],f=c.parentElement,b=c.innerHTML.split(/\n/);b[b.length-1]===''&&b.pop();const g=b.length;let h='';for(let a=0;a<g;a++)h+=`<div class="line">${a+1}</div>`;let i='';for(let a=0;a<g;a++)i+=`<div class="line">${b[a]}</div>`;c.className+=' highlight';const e=document.createElement('figure');e.className=c.className,e.innerHTML=`<table><tbody><tr><td class="gutter"><pre>${h}</pre></td><td class="code"><pre>${i}</pre></td></tr></tbody></table>`,f.parentElement.replaceChild(e,f)}},Even.chroma=function(){const a=document.querySelectorAll('.highlight > .chroma');for(let b=0;b<a.length;b++){const c=a[b],d=c.querySelector('pre.chroma > code[data-lang]'),e=d?d.className:'';c.className+=' '+e}},Even.toc=function(){const a=document.getElementById('post-toc');if(a!==null){const b=document.getElementById('TableOfContents');b===null?a.parentNode.removeChild(a):(this._refactorToc(b),this._linkToc(),this._initToc())}},Even._refactorToc=function(c){const b=c.children[0];let a=b,d;while(a.children.length===1&&(d=a.children[0].children[0]).tagName==='UL')a=d;a!==b&&c.replaceChild(a,b)},Even._linkToc=function(){const a=document.querySelectorAll('#TableOfContents a:first-child');for(let b=0;b<a.length;b++)a[b].className+=' toc-link';for(let a=1;a<=6;a++){const b=document.querySelectorAll('.post-content>h'+a);for(let a=0;a<b.length;a++){const c=b[a];c.innerHTML=`<a href="#${c.id}" class="headerlink anchor"><i class="iconfont icon-link"></i></a>${c.innerHTML}`}}},Even.flowchart=function(){if(!window.flowchart)return;const a=document.querySelectorAll('pre code.language-flowchart, pre code.language-flow');for(let b=0;b<a.length;b++){if(!window.hljs&&b%2===0)continue;const c=a[b],e=window.hljs?c.parentElement:c.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement,d=document.createElement('div'),f=`js-flowchart-diagrams-${b}`;d.id=f,d.className='align-center',e.parentElement.replaceChild(d,e);const g=flowchart.parse(c.childNodes[0].nodeValue);g.drawSVG(f,window.flowchartDiagramsOptions?window.flowchartDiagramsOptions:{})}},Even.sequence=function(){if(!window.Diagram)return;const a=document.querySelectorAll('pre code.language-sequence');for(let b=0;b<a.length;b++){if(!window.hljs&&b%2===0)continue;const c=a[b],e=window.hljs?c.parentElement:c.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement,d=document.createElement('div'),f=`js-sequence-diagrams-${b}`;d.id=f,d.className='align-center',e.parentElement.replaceChild(d,e);const g=Diagram.parse(c.childNodes[0].nodeValue);
1g.drawSVG(f,window.sequenceDiagramsOptions?window.sequenceDiagramsOptions:{theme:'simple'})}},Even.responsiveTable=function(){const a=document.querySelectorAll('.post-content table:not(.lntable)');for(let b=0;b<a.length;b++){const c=a[b],d=document.createElement('div');d.className='table-wrapper',c.parentElement.replaceChild(d,c),d.appendChild(c)}},$(document).ready(function(){Even.backToTop(),Even.mobileNavbar(),Even.toc(),Even.fancybox()}),Even.responsiveTable(),Even.flowchart(),Even.sequence(),window.hljs?(hljs.initHighlighting(),Even.highlight()):Even.chroma()

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.