diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2015-05-20 11:00:27 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2015-05-20 11:00:27 +0200 |
commit | 0deefd4d9d7ce24cc193ec0db47152957fdd3da3 (patch) | |
tree | a817038e0210dd6a260b0ac18210472e948c74af /data | |
parent | 725e08d259249402aec29d82017a1c0d694a1d4e (diff) | |
download | comatose-0deefd4d9d7ce24cc193ec0db47152957fdd3da3.tar.gz comatose-0deefd4d9d7ce24cc193ec0db47152957fdd3da3.tar.bz2 comatose-0deefd4d9d7ce24cc193ec0db47152957fdd3da3.zip |
Implement PageRank for protocol ranking
Diffstat (limited to 'data')
-rw-r--r-- | data/script.js | 4 |
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); |