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) { function sortUsers(server, channel) {
channels[server][channel].users.sort(function(a, b) { 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; 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 1;
} }
return 0; return 0;

View File

@ -6,16 +6,14 @@
body { body {
font-family: Inconsolata, sans-serif; font-family: Inconsolata, sans-serif;
background: #111; background: #f0f0f0;
color: #FFF;
} }
input { input {
font: 16px Inconsolata, sans-serif; font: 16px Inconsolata, sans-serif;
background: rgba(0,0,0,0.25);
color: #FFF;
outline: none;
border: none; border: none;
border-top: 1px solid #DDD;
outline: none;
} }
p { p {
@ -27,9 +25,11 @@ p {
left: 0; left: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
right: 200px; width: 200px;
padding: 15px; padding: 15px;
overflow: auto; overflow: auto;
background: #272626;
color: #FFF;
} }
.tablist p { .tablist p {
@ -37,25 +37,24 @@ p {
} }
.tablist p:hover { .tablist p:hover {
color: #AAA;
} }
.chat-title-bar { .chat-title-bar {
position: fixed; position: fixed;
left: 200px; left: 200px;
top: 0; top: 0;
right: 200px; right: 0;
height: 50px; height: 50px;
padding: 0 15px; padding: 0 15px;
line-height: 50px; line-height: 50px;
background: rgba(0,0,0,0.25);
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
border-bottom: 1px solid #DDD;
} }
.chat-title { .chat-title {
font-size: 24px;
} }
.messagebox { .messagebox {
@ -94,10 +93,11 @@ p {
.userlist { .userlist {
position: fixed; position: fixed;
top: 0; top: 50px;
bottom: 50px; bottom: 50px;
right: 0; right: 0;
width: 200px; width: 200px;
padding: 15px; padding: 15px;
overflow: auto; overflow: auto;
border-left: 1px solid #DDD;
} }