OSDN Git Service

fix: read time
authorfrank-xjh <frank99-xu@outlook.com>
Fri, 31 Aug 2018 14:21:16 +0000 (22:21 +0800)
committerfrank-xjh <frank99-xu@outlook.com>
Fri, 31 Aug 2018 14:21:16 +0000 (22:21 +0800)
docs/_static/js/extra.js

index 9b816ae..d075e63 100644 (file)
@@ -52,7 +52,7 @@ if (cur) {
   var textLength = 0;
   if (pos < 0) textLength = (document.getElementsByClassName('md-content__inner')[0].textContent.slice(0, pos).replace(/\s/g, '').length - document.getElementsByTagName('h1')[0].textContent.replace(/\s/g, '').length - document.getElementsByClassName('page-copyright')[0].textContent.replace(/\s/g, '').length - 4);
   else textLength = (document.getElementsByClassName('md-content__inner')[0].textContent.replace(/\s/g, '').length - document.getElementsByTagName('h1')[0].textContent.replace(/\s/g, '').length - document.getElementsByClassName('page-copyright')[0].textContent.replace(/\s/g, '').length - 4);
-  var ti = Math.ceil(textLength / 400);
+  var ti = Math.ceil(textLength / 80);
   if (textLength > 0) cur.innerHTML = `<p>本页面共 ${textLength} 字,预计阅读需要 ${ti} 分钟</p>`;
   else cur.innerHTML = `<p>本页面还在建设中,欢迎参与完善!</p>`;
 }