mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
54 lines
1.3 KiB
Plaintext
54 lines
1.3 KiB
Plaintext
script(src=url_for(theme.CDN.pjax))
|
|
script.
|
|
var pjax = new Pjax({
|
|
selectors: [
|
|
'title',
|
|
'meta[name=description]',
|
|
'#config_change',
|
|
'#body-wrap',
|
|
'#rightside',
|
|
'.js-pjax'
|
|
],
|
|
cacheBust: 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});
|
|
}
|
|
|
|
if (document.getElementsByClassName('aplayer').length){
|
|
loadMeting()
|
|
}
|
|
})
|
|
|
|
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()
|
|
}
|
|
}
|
|
}
|
|
|
|
$(window).off('scroll')
|
|
|
|
//reset readmode
|
|
$('body').hasClass('read-mode') && $('body').removeClass('read-mode')
|
|
|
|
//reset font-size
|
|
$('body').css('font-size') !== originFontSize && $('body').css('font-size', parseFloat(originFontSize))
|
|
})
|
|
|