From 5b7eed3541ab68c076d59426aa7e3485a80b71f0 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Wed, 1 May 2013 17:24:07 -0500 Subject: [PATCH] Sort usernames in connection log --- www/assets/js/functions.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/www/assets/js/functions.js b/www/assets/js/functions.js index 5b71c25f..2460c626 100644 --- a/www/assets/js/functions.js +++ b/www/assets/js/functions.js @@ -622,6 +622,18 @@ function updateSeenLogins(entries) { if(tbl.children().length > 1) { $(tbl.children()[1]).remove(); } + entries.sort(function(a, b) { + var x = a.name.toLowerCase(); + var y = b.name.toLowerCase(); + // Force blanknames to the bottom + if(x == "") { + return 1; + } + if(y == "") { + return -1; + } + return x == y ? 0 : (x < y ? -1 : 1); + }); for(var i = 0; i < entries.length; i++) { var tr = $("").appendTo(tbl); var bantd = $("").appendTo(tr);