From 85c67212ad5f5a0d5ceb9104d4ed22d8e8e54457 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sat, 4 Jul 2015 22:19:09 +0800 Subject: Added profile image on onlineList --- public/js/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'public/js') diff --git a/public/js/index.js b/public/js/index.js index 4d617adb..bf3a3ab2 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -1112,7 +1112,7 @@ var options = { item: '
  • \ \ \ - \ + \ \
  • ' }; @@ -1214,7 +1214,14 @@ function renderUserStatusList(list) { var item = items[j]; var userstatus = $(item.elm).find('.ui-user-status'); var usericon = $(item.elm).find('.ui-user-icon'); - usericon.css('color', item.values().color); + if(item.values().login && item.values().photo) { + usericon.css('background-image', 'url(' + item.values().photo + ')'); + usericon.css('box-shadow', '0px 0px 2px ' + item.values().color); + //add 1px more to right, make it feel aligned + usericon.css('margin-right', '6px'); + } else { + usericon.css('background-color', item.values().color); + } userstatus.removeClass('ui-user-status-offline ui-user-status-online ui-user-status-idle'); if (item.values().idle) userstatus.addClass('ui-user-status-idle'); @@ -1240,6 +1247,7 @@ function deduplicateOnlineUsers(list) { //keep idle state if any of self client not idle if (!user.idle) { _onlineUsers[j].idle = user.idle; + _onlineUsers[j].color = user.color; } found = true; break; -- cgit v1.2.3