mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 20:30:53 +08:00
pjax
This commit is contained in:
@@ -1,20 +1,29 @@
|
||||
#disqus_thread
|
||||
script.
|
||||
function loadDisqus () {
|
||||
var disqus_config = function () {
|
||||
this.page.url = '!{ page.permalink }';
|
||||
this.page.identifier = '!{ page.path }';
|
||||
this.page.title = '!{ page.title }';
|
||||
this.page.url = '!{ page.permalink }'
|
||||
this.page.identifier = '!{ page.path }'
|
||||
this.page.title = '!{ page.title }'
|
||||
};
|
||||
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = 'https://!{theme.disqus.shortname}.disqus.com/embed.js';
|
||||
s.setAttribute('data-timestamp', +new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
if (window.DISQUS) {
|
||||
DISQUS.reset({
|
||||
reload: true,
|
||||
config: disqus_config
|
||||
})
|
||||
} else {
|
||||
(function() {
|
||||
var d = document, s = d.createElement('script')
|
||||
s.src = 'https://!{theme.disqus.shortname}.disqus.com/embed.js'
|
||||
s.setAttribute('data-timestamp', +new Date())
|
||||
s.setAttribute('data-timestamp', +new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
if ('!{defaultComment}' === 'Disqus' || !{theme.comments.load_begin}) {
|
||||
window.addEventListener('load', loadDisqus)
|
||||
loadDisqus()
|
||||
}
|
||||
else {
|
||||
function loadOtherComment () {
|
||||
@@ -22,6 +31,7 @@ script.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if is_post() && theme.comments.count && defaultComment === 'Disqus'
|
||||
script.
|
||||
function getDisqusCount() {
|
||||
@@ -31,4 +41,4 @@ if is_post() && theme.comments.count && defaultComment === 'Disqus'
|
||||
(d.head || d.body).appendChild(s);
|
||||
}
|
||||
|
||||
window.addEventListener('load', getDisqusCount, false);
|
||||
getDisqusCount()
|
||||
Reference in New Issue
Block a user