disqus/disqusjs/facebook comments 可隨夜間模式按鈕切換而轉換主題

🐛 修復pjax下valine評論顯示不正常的bugs
🐛 修復facebook comments 在手機下寬度不是100%的bugs
This commit is contained in:
Jerry
2020-07-18 22:30:15 +08:00
parent f7d57ac883
commit 4f64768011
17 changed files with 120 additions and 98 deletions

View File

@@ -1,12 +1,12 @@
script.
function loadGitalk () {
function addGitalkSource () {
const ele = document.createElement('link')
ele.rel = 'stylesheet'
ele.href= '!{url_for(theme.CDN.gitalk_css)}'
document.getElementsByTagName('head')[0].appendChild(ele)
}
function addGitalkSource () {
const ele = document.createElement('link')
ele.rel = 'stylesheet'
ele.href= '!{url_for(theme.CDN.gitalk_css)}'
document.getElementsByTagName('head')[0].appendChild(ele)
}
function loadGitalk () {
function initGitalk () {
var gitalk = new Gitalk({
clientID: '!{theme.gitalk.client_id}',
@@ -30,13 +30,11 @@ script.
addGitalkSource()
$.getScript('!{url_for(theme.CDN.gitalk)}', initGitalk)
}
function commentCount(n){
try {
document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n
} catch (e) {
return false
}
}
function commentCount(n){
if (document.querySelector('#post-meta .gitalk-comment-count')) {
document.querySelector('#post-meta .gitalk-comment-count').innerHTML= n
}
}