summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2015-05-20 11:00:27 +0200
committerLars-Dominik Braun <lars@6xq.net>2015-05-20 11:00:27 +0200
commit0deefd4d9d7ce24cc193ec0db47152957fdd3da3 (patch)
treea817038e0210dd6a260b0ac18210472e948c74af /data
parent725e08d259249402aec29d82017a1c0d694a1d4e (diff)
downloadcomatose-0deefd4d9d7ce24cc193ec0db47152957fdd3da3.tar.gz
comatose-0deefd4d9d7ce24cc193ec0db47152957fdd3da3.tar.bz2
comatose-0deefd4d9d7ce24cc193ec0db47152957fdd3da3.zip
Implement PageRank for protocol ranking
Diffstat (limited to 'data')
-rw-r--r--data/script.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/data/script.js b/data/script.js
index 7e8bef3..9d7354e 100644
--- a/data/script.js
+++ b/data/script.js
@@ -5,7 +5,9 @@ $(document).ready (function () {
items.detach ().sort (function (nodeA, nodeB) {
var a = $(nodeA).data (by);
var b = $(nodeB).data (by);
- if (typeof a == 'number' || typeof b == 'number') {
+ if (by == 'rank') {
+ a = parseFloat (a);
+ b = parseFloat (b);
return a > b ? 1 : (a < b ? -1 : 0);
} else {
return a.localeCompare (b);