()
| 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) |