You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
557 B
21 lines
557 B
9 months ago
|
script.
|
||
|
(() => {
|
||
|
function loadValine () {
|
||
|
function initValine () {
|
||
|
let initData = {
|
||
|
el: '#vcomment',
|
||
|
appId: '#{theme.valine.appId}',
|
||
|
appKey: '#{theme.valine.appKey}',
|
||
|
serverURLs: '#{theme.valine.serverURLs}'
|
||
|
}
|
||
|
|
||
|
const valine = new Valine(initData)
|
||
|
}
|
||
|
|
||
|
if (typeof Valine === 'function') initValine()
|
||
|
else getScript('!{url_for(theme.asset.valine)}').then(initValine)
|
||
|
}
|
||
|
|
||
|
window.pjax ? loadValine() : window.addEventListener('load', loadValine)
|
||
|
})()
|