mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
✨ 添加第三方chat服務 crisp
This commit is contained in:
81
layout/includes/third-party/pjax.pug
vendored
81
layout/includes/third-party/pjax.pug
vendored
@@ -1,55 +1,58 @@
|
||||
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())
|
||||
$(function () {
|
||||
var pjax = new Pjax({
|
||||
selectors: [
|
||||
'title',
|
||||
'meta[name=description]',
|
||||
'#config_change',
|
||||
'#body-wrap',
|
||||
'#rightside-config-hide',
|
||||
'#rightside-config-show',
|
||||
'.js-pjax'
|
||||
],
|
||||
cacheBust: false,
|
||||
})
|
||||
|
||||
GLOBAL_CONFIG.islazyload && lazyLoadInstance.update()
|
||||
document.addEventListener('pjax:complete', function () {
|
||||
refreshFn()
|
||||
|
||||
typeof chatBtnFn === 'function' && chatBtnFn()
|
||||
typeof panguInit === 'function' && panguInit()
|
||||
$('script[data-pjax]').each(function () {
|
||||
$(this).parent().append($(this).remove())
|
||||
})
|
||||
|
||||
if (typeof gtag === 'function') {
|
||||
gtag('config', '!{theme.google_analytics}', {'page_path': window.location.pathname});
|
||||
}
|
||||
GLOBAL_CONFIG.islazyload && lazyLoadInstance.update()
|
||||
|
||||
if (document.getElementsByClassName('aplayer').length){
|
||||
loadMeting()
|
||||
}
|
||||
})
|
||||
typeof chatBtnFn === 'function' && chatBtnFn()
|
||||
typeof panguInit === 'function' && panguInit()
|
||||
|
||||
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()
|
||||
if (typeof gtag === 'function') {
|
||||
gtag('config', '!{theme.google_analytics}', {'page_path': window.location.pathname});
|
||||
}
|
||||
|
||||
if (document.getElementsByClassName('aplayer').length){
|
||||
typeof loadMeting === 'function' && 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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typeof typed === 'object' && typed.destroy()
|
||||
typeof typed === 'object' && typed.destroy()
|
||||
|
||||
$(window).off('scroll')
|
||||
$(window).off('scroll')
|
||||
|
||||
//reset readmode
|
||||
$('body').hasClass('read-mode') && $('body').removeClass('read-mode')
|
||||
//reset readmode
|
||||
$('body').hasClass('read-mode') && $('body').removeClass('read-mode')
|
||||
|
||||
//reset font-size
|
||||
$('body').css('font-size') !== originFontSize && $('body').css('font-size', parseFloat(originFontSize))
|
||||
//reset font-size
|
||||
$('body').css('font-size') !== originFontSize && $('body').css('font-size', parseFloat(originFontSize))
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user