- var pjaxExclude = 'a:not([target="_blank"])' if theme.pjax.exclude each val in theme.pjax.exclude - pjaxExclude = pjaxExclude + `:not([href="${val}"])` script(src=url_for(theme.CDN.pjax)) script. let pjaxSelectors = [ 'title', 'meta[name=description]', '#config_change', '#body-wrap', '#rightside-config-hide', '#rightside-config-show', '.js-pjax' ] if (!{theme.Open_Graph_meta && theme.comments.use && theme.comments.use.includes('Livere')}) { pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]') } var pjax = new Pjax({ elements: '!{pjaxExclude}', selectors: pjaxSelectors, cacheBust: false, analytics: !{theme.google_analytics ? true : false}, scrollRestoration: false }) document.addEventListener('pjax:complete', function () { refreshFn() $('script[data-pjax]').each(function () { $(this).parent().append($(this).remove()) }) GLOBAL_CONFIG.islazyload && lazyLoadInstance.update() typeof chatBtnFn === 'function' && chatBtnFn() typeof panguInit === 'function' && panguInit() if (typeof gtag === 'function') { gtag('config', '!{theme.google_analytics}', {'page_path': window.location.pathname}); } typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting() // Analytics if (!{theme.tencent_analytics ? true : false}) { MtaH5.pgv() } // prismjs typeof Prism === 'object' && Prism.highlightAll() }) document.addEventListener('pjax:send', function () { if (window.aplayers) { for (let i = 0; i < window.aplayers.length; i++) { if (!window.aplayers[i].options.fixed) { window.aplayers[i].destroy() } } } typeof typed === 'object' && typed.destroy() $(window).off('scroll') //reset readmode $('body').hasClass('read-mode') && $('body').removeClass('read-mode') })