init...
This commit is contained in:
25
themes/butterfly/layout/includes/third-party/comments/livere.pug
vendored
Normal file
25
themes/butterfly/layout/includes/third-party/comments/livere.pug
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
- const { use, lazyload } = theme.comments
|
||||
|
||||
script.
|
||||
(()=>{
|
||||
const loadLivere = () => {
|
||||
if (typeof LivereTower === 'object') window.LivereTower.init()
|
||||
else {
|
||||
(function(d, s) {
|
||||
var j, e = d.getElementsByTagName(s)[0];
|
||||
if (typeof LivereTower === 'function') { return; }
|
||||
j = d.createElement(s);
|
||||
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
|
||||
j.async = true;
|
||||
e.parentNode.insertBefore(j, e);
|
||||
})(document, 'script');
|
||||
}
|
||||
}
|
||||
|
||||
if ('!{use[0]}' === 'Livere' || !!{lazyload}) {
|
||||
if (!{lazyload}) btf.loadComment(document.getElementById('lv-container'), loadLivere)
|
||||
else loadLivere()
|
||||
} else {
|
||||
window.loadOtherComment = loadLivere
|
||||
}
|
||||
})()
|
||||
Reference in New Issue
Block a user