From 5c6c43e0173ffbfe849eb2725bbbced64239cea1 Mon Sep 17 00:00:00 2001 From: khlieng Date: Wed, 28 Jan 2015 02:54:47 +0100 Subject: [PATCH] Better userlist sorting, started work on default theme --- client/src/js/stores/channel.js | 19 +++++++++++++++++-- client/src/style.css | 22 +++++++++++----------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/client/src/js/stores/channel.js b/client/src/js/stores/channel.js index e9e4fb37..19d5de3c 100644 --- a/client/src/js/stores/channel.js +++ b/client/src/js/stores/channel.js @@ -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; diff --git a/client/src/style.css b/client/src/style.css index f475f601..e04c3728 100644 --- a/client/src/style.css +++ b/client/src/style.css @@ -6,16 +6,14 @@ body { font-family: Inconsolata, sans-serif; - background: #111; - color: #FFF; + background: #f0f0f0; } input { font: 16px Inconsolata, sans-serif; - background: rgba(0,0,0,0.25); - color: #FFF; - outline: none; border: none; + border-top: 1px solid #DDD; + outline: none; } p { @@ -27,9 +25,11 @@ p { left: 0; top: 0; bottom: 0; - right: 200px; + width: 200px; padding: 15px; overflow: auto; + background: #272626; + color: #FFF; } .tablist p { @@ -37,25 +37,24 @@ p { } .tablist p:hover { - color: #AAA; } .chat-title-bar { position: fixed; left: 200px; top: 0; - right: 200px; + right: 0; height: 50px; padding: 0 15px; line-height: 50px; - background: rgba(0,0,0,0.25); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + border-bottom: 1px solid #DDD; } .chat-title { - + font-size: 24px; } .messagebox { @@ -94,10 +93,11 @@ p { .userlist { position: fixed; - top: 0; + top: 50px; bottom: 50px; right: 0; width: 200px; padding: 15px; overflow: auto; + border-left: 1px solid #DDD; } \ No newline at end of file