From 42adc374c21d0bce6bb495f5f793d23b77aa9fe0 Mon Sep 17 00:00:00 2001 From: frank-xjh Date: Fri, 31 Aug 2018 22:21:16 +0800 Subject: [PATCH] fix: read time --- docs/_static/js/extra.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_static/js/extra.js b/docs/_static/js/extra.js index 9b816aee..d075e63a 100644 --- a/docs/_static/js/extra.js +++ b/docs/_static/js/extra.js @@ -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 = `

本页面共 ${textLength} 字,预计阅读需要 ${ti} 分钟

`; else cur.innerHTML = `

本页面还在建设中,欢迎参与完善!

`; } -- 2.11.0