@xiee/utils
Advanced tools
Comparing version 1.1.13 to 1.1.14
@@ -80,2 +80,18 @@ // lazyload Disqus on my personal site | ||
}; | ||
s.onload = function(e) { | ||
// if Disqus comment count is zero, just get rid of the Disqus tab | ||
var dc = d.getElementById('disqus_count'); | ||
if (!dc) return; | ||
var s3 = d.createElement('script'); | ||
s3.src = '//yihui.disqus.com/count.js'; | ||
s3.id = 'dsq-count-scr'; | ||
t.appendChild(s3); | ||
new MutationObserver(() => { | ||
if (dc.innerText == '' || dc.innerText > 0) return; | ||
selectTab2(); loadScript(); | ||
a.append(a.querySelector('#tab-2 ~ .panel')); | ||
a.querySelector('.tabs').remove(); | ||
a.querySelector('.panel').style.display = 'block'; | ||
}).observe(dc, {characterData: true, childList: true}); | ||
}; | ||
// show comments when the hash means to jump to a comment | ||
@@ -82,0 +98,0 @@ if (location.hash.match(/^#comment-[0-9]+$/)) return l(true); |
{ | ||
"name": "@xiee/utils", | ||
"version": "1.1.13", | ||
"version": "1.1.14", | ||
"description": "Miscellaneous tools and utilities to manipulate HTML pages", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21068
443