stats-web: THIS. SHOULD. WORK
This commit is contained in:
parent
8f0432d587
commit
7211de403a
1 changed files with 2 additions and 3 deletions
|
@ -237,11 +237,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (user in userFreq) {
|
for (user in userFreq) {
|
||||||
userFreq[user].sort();
|
userFreq[user].sort(sortMessages);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sortwords(a,b){return a[1]-b[1]}
|
function formatwords(n){return userFreq[n]?userFreq[n].slice(0,3).map(function(i){return i[0]}).join(" "):""}
|
||||||
function formatwords(n){return userFreq[n]?userFreq[n].sort(sortwords).slice(0,3).map(function(i){return i[0]}).join(" "):""}
|
|
||||||
function percent(a){return Math.round(a/stats.TotalCount*1e4)/1e2}
|
function percent(a){return Math.round(a/stats.TotalCount*1e4)/1e2}
|
||||||
function nick(a){return users[a]?users[a]+" <i>("+a+")</i>":a}
|
function nick(a){return users[a]?users[a]+" <i>("+a+")</i>":a}
|
||||||
function enrich(a){return [nick(a[0]), a[1], percent(a[1]), formatwords(a[0])]}
|
function enrich(a){return [nick(a[0]), a[1], percent(a[1]), formatwords(a[0])]}
|
||||||
|
|
Reference in a new issue