aboutsummaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authorAdam Hovorka <[email protected]>2020-05-13 19:30:02 -0600
committerAdam Hovorka <[email protected]>2020-05-13 19:30:02 -0600
commit143ec6503417530f831c8d42b5eb50cd9f2e47ac (patch)
tree3ca548e24df5852ef36c787f64b9bc8cf91c9a2e /main.js
parent41ec8ac05a86527c49403f4972eb9b857372790a (diff)
Add page word countHEADmain
Diffstat (limited to 'main.js')
-rw-r--r--main.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.js b/main.js
index 9285947..18b8c97 100644
--- a/main.js
+++ b/main.js
@@ -26,6 +26,10 @@ const wordCount = () => {
nodes.reduce((a,p) => { const n = data.pages[data.paths[p]];
return a + n.body.trim().split(/\s+/).length +
n.choices.reduce((a,c) => a + c[1].trim().split(/\s+/).length, 0)}, 0);
+ const n = data.pages[data.paths[data.current]];
+ document.querySelector("#page-word-count span").innerText =
+ n.body.trim().split(/\s+/).length +
+ n.choices.reduce((a,c) => a + c[1].trim().split(/\s+/).length, 0);
};
const db = new Dexie("vanguard-editor");