commit
373bcafbb5
|
@ -11,13 +11,35 @@
|
||||||
countEl: '#ArtalkCount'
|
countEl: '#ArtalkCount'
|
||||||
}, null))
|
}, null))
|
||||||
|
|
||||||
if (GLOBAL_CONFIG.lightbox === 'null') return
|
function versionOld(ctx){
|
||||||
window.artalkItem.on('list-loaded', () => {
|
// 旧版本兼容性补丁
|
||||||
window.artalkItem.ctx.get('list').getCommentNodes().forEach(comment => {
|
ctx.getCommentList().forEach(comment => {
|
||||||
|
const $content = comment.getRender().$content
|
||||||
|
btf.loadLightbox($content.querySelectorAll('img:not([atk-emoticon])'))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function version_2_7_3_WithUpper(ctx){
|
||||||
|
// 2.7.3 版本及以后版本支持
|
||||||
|
ctx.get('list').getCommentNodes().forEach(comment => {
|
||||||
const $content = comment .getRender().$content
|
const $content = comment .getRender().$content
|
||||||
btf.loadLightbox($content.querySelectorAll('img:not([atk-emoticon])'))
|
btf.loadLightbox($content.querySelectorAll('img:not([atk-emoticon])'))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function versionCheck(ctx){
|
||||||
|
if(ctx.getCommentList != undefined){
|
||||||
|
// Artalk 版本小于于 2.7.3
|
||||||
|
versionOld(ctx);
|
||||||
|
}else{
|
||||||
|
version_2_7_3_WithUpper(ctx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GLOBAL_CONFIG.lightbox === 'null') return
|
||||||
|
window.artalkItem.on('list-loaded', () => {
|
||||||
|
versionCheck(window.artalkItem.ctx);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue