MCPcopy Create free account
hub / github.com/BloombergGraphics/whatiscode / loadStats

Function loadStats

modules/toc/toc.js:82–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80 }
81
82 function loadStats() {
83 var stats = JSON.parse(localStorage.getItem('stats'));
84 if(!stats) {
85 stats = {
86 scrollLog: [],
87 wordCount: getWordCount(),
88 timeOnPage: 0,
89 visits: 1,
90 histogram: {},
91 windows: {
92 "current": 0,
93 "previous": 0,
94 "hover": null
95 }
96 }
97 } else {
98 stats.visits++;
99 }
100 return stats;
101 }
102
103 function makeHistogram() {
104 stats.histogram = histogram(stats.scrollLog)

Callers 1

toc.jsFile · 0.85

Calls 1

getWordCountFunction · 0.85

Tested by

no test coverage detected