Better userlist sorting, started work on default theme

This commit is contained in:
khlieng 2015-01-28 02:54:47 +01:00
parent 721971cbb3
commit 5c6c43e017
2 changed files with 28 additions and 13 deletions

View file

@ -52,10 +52,25 @@ function updateRenderName(user) {
function sortUsers(server, channel) {
channels[server][channel].users.sort(function(a, b) {
if (a.renderName < b.renderName) {
a = a.renderName.toLowerCase();
b = b.renderName.toLowerCase();
if (a[0] === '@' && b[0] !== '@') {
return -1;
}
if (a.renderName > b.renderName) {
if (b[0] === '@' && a[0] !== '@') {
return 1;
}
if (a[0] === '+' && b[0] !== '+') {
return -1;
}
if (b[0] === '+' && a[0] !== '+') {
return 1;
}
if (a < b) {
return -1;
}
if (a > b) {
return 1;
}
return 0;