This commit is contained in:
Jerry committed 2020-07-16 19:30:54 +08:00
1 parent 5b6e008b84
commit 898cc31c58
93 files changed
+2128 -2151

No files matched your search

+20 -10
View File
@@ -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()
+19 -10
View File
@@ -1,13 +1,15 @@
#disqus_thread
script.
function loadDisqusjs () {
const ele = document.createElement('link')
ele.rel = 'stylesheet'
ele.href= '!{url_for(theme.CDN.disqusjs_css)}'
document.getElementsByTagName('head')[0].appendChild(ele)
function addDisqusjsCSS () {
const ele = document.createElement('link')
ele.rel = 'stylesheet'
ele.href= '!{url_for(theme.CDN.disqusjs_css)}'
document.getElementsByTagName('head')[0].appendChild(ele)
}
loadScript('!{url_for(theme.CDN.disqusjs)}', function() {
var dsqjs = new DisqusJS({
function initDiqusjs () {
window.DISQUS = null
new DisqusJS({
shortname: '!{theme.disqusjs.shortname}',
siteName: '!{theme.disqusjs.siteName}',
identifier: '!{ page.path }',
@@ -19,11 +21,18 @@ script.
admin: '!{theme.disqusjs.admin}',
adminLabel: '!{theme.disqusjs.adminLabel}'
});
})
}
if (window.disqusjsload) initDiqusjs()
else {
addDisqusjsCSS()
$.getScript('!{url_for(theme.CDN.disqusjs)}', initDiqusjs)
window.disqusjsload = true
}
}
if ('!{defaultComment}' === 'Disqusjs' || !{theme.comments.load_begin}) {
window.addEventListener('load', loadDisqusjs)
loadDisqusjs()
}
else {
function loadOtherComment () {
@@ -40,4 +49,4 @@ if is_post() && theme.comments.count && defaultComment === 'Disqusjs'
s.id = 'dsq-count-scr';
(d.head || d.body).appendChild(s);
}
window.addEventListener('load', getDisqusCount, false);
getDisqusCount()
+6 -11
View File
@@ -1,10 +1,4 @@
#fb-root
.fb-comments(data-colorscheme = theme.display_mode === 'dark' ? 'dark' : 'light'
data-href=urlNoIndex()
data-numposts= theme.facebook_comments.pageSize || 10
data-order-by= theme.facebook_comments.order_by || 'social'
data-width="100%")
script.
function loadFBComent () {
let ele = document.createElement('script')
@@ -13,10 +7,15 @@ script.
ele.setAttribute('defer', 'true')
ele.setAttribute('crossorigin', 'anonymous')
document.getElementById('fb-root').insertAdjacentElement('afterbegin',ele)
var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'
document.getElementsByClassName('fb-comments')[0].setAttribute('data-colorscheme',themeNow)
if (typeof FB === 'object') FB.XFBML.parse()
}
if ('!{defaultComment}' === 'Facebook Comments' || !{theme.comments.load_begin}) {
window.addEventListener('load', loadFBComent)
loadFBComent()
}
else {
function loadOtherComment () {
@@ -24,7 +23,3 @@ script.
}
}
if theme.darkmode.enable
script.
var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'
document.getElementsByClassName('fb-comments')[0].setAttribute('data-colorscheme',themeNow)
Loaded 3 of 93 files, more files were not shown because too many files have changed in this diff. Show more