1/* global NexT, CONFIG, Pjax */ 2 3const pjax = new Pjax({ 4 selectors: [ 5 'head title', 6 'script[type="application/json"]', 7 // Precede .main-inner to prevent placeholder TOC changes asap 8 '.post-toc-wrap', 9 '.main-inner', 10 '.languages', 11 '.pjax' 12 ], 13 switches: { 14 '.post-toc-wrap': function(oldWrap, newWrap) { 15 if (newWrap.querySelector('.post-toc')) { 16 Pjax.switches.outerHTML.call(this, oldWrap, newWrap); 17 } else { 18 const curTOC = oldWrap.querySelector('.post-toc'); 19 if (curTOC) { 20 curTOC.classList.add('placeholder-toc'); 21 } 22 this.onSwitch(); 23 } 24 } 25 }, 26 analytics: false, 27 cacheBust: false, 28 scrollTo : !CONFIG.bookmark.enable 29}); 30 31document.addEventListener('pjax:success', () => { 32 pjax.executeScripts(document.querySelectorAll('script[data-pjax]')); 33 NexT.boot.refresh(); 34 // Define Motion Sequence & Bootstrap Motion. 35 if (CONFIG.motion.enable) { 36 NexT.motion.integrator 37 .init() 38 .add(NexT.motion.middleWares.subMenu) 39 .add(NexT.motion.middleWares.postList) 40 // Add sidebar-post-related transition. 41 .add(NexT.motion.middleWares.sidebar) 42 .bootstrap(); 43 } 44 if (CONFIG.sidebar.display !== 'remove') { 45 const hasTOC = document.querySelector('.post-toc:not(.placeholder-toc)'); 46 document.querySelector('.sidebar-inner').classList.toggle('sidebar-nav-active', hasTOC); 47 NexT.utils.activateSidebarPanel(hasTOC ? 0 : 1); 48 NexT.utils.updateSidebarPosition(); 49 } 50});
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.