From 706ee1f86628af5f35332222f1d3cbce98ba6cfc Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 15 Apr 2014 18:11:41 +0100 Subject: [PATCH 1/2] fix color --- src/static/js/pad_userlist.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/static/js/pad_userlist.js b/src/static/js/pad_userlist.js index f54b3e54..9228408f 100644 --- a/src/static/js/pad_userlist.js +++ b/src/static/js/pad_userlist.js @@ -728,11 +728,11 @@ var paduserlist = (function() $("#myswatch").css({'background-color': myUserInfo.colorId}); if ($.browser.msie && parseInt($.browser.version) <= 8) { - $("#usericon a").css({'box-shadow': 'inset 0 0 30px ' + myUserInfo.colorId,'background-color': myUserInfo.colorId}); + $("li[data-key=showusers] > a").css({'box-shadow': 'inset 0 0 30px ' + myUserInfo.colorId,'background-color': myUserInfo.colorId}); } else { - $("#usericon a").css({'box-shadow': 'inset 0 0 30px ' + myUserInfo.colorId}); + $("li[data-key=showusers] > a").css({'box-shadow': 'inset 0 0 30px ' + myUserInfo.colorId}); } } }; From 46ef83d7106c1a94c9db161203f4df7b2773cbf4 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 30 Apr 2014 22:32:08 +0200 Subject: [PATCH 2/2] Fix #online_count Rather dirty, but works. --- src/static/js/pad_userlist.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/static/js/pad_userlist.js b/src/static/js/pad_userlist.js index 9228408f..ebb057c8 100644 --- a/src/static/js/pad_userlist.js +++ b/src/static/js/pad_userlist.js @@ -1,5 +1,5 @@ /** - * This code is mostly from the old Etherpad. Please help us to comment this code. + * This code is mostly from the old Etherpad. Please help us to comment this code. * This helps other people to understand this code better and helps them to improve it. * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED */ @@ -513,7 +513,7 @@ var paduserlist = (function() { info.colorId = clientVars.colorPalette[info.colorId]; } - + myUserInfo = $.extend( {}, info); @@ -602,7 +602,13 @@ var paduserlist = (function() online++; } } - $("#online_count").text(online); + var $btn = $("#editbar [data-key=showusers] > a") + , $counter = $('#online_count', $btn) + if(!$counter.length) { + $counter = $('') + $btn.append($counter) + } + $counter.text(online); return online; }, @@ -724,9 +730,9 @@ var paduserlist = (function() { $("#myswatchbox").addClass('myswatchboxhoverable').removeClass('myswatchboxunhoverable'); } - + $("#myswatch").css({'background-color': myUserInfo.colorId}); - + if ($.browser.msie && parseInt($.browser.version) <= 8) { $("li[data-key=showusers] > a").css({'box-shadow': 'inset 0 0 30px ' + myUserInfo.colorId,'background-color': myUserInfo.colorId}); } @@ -748,7 +754,7 @@ function getColorPickerSwatchIndex(jnode) function closeColorPicker(accept) { if (accept) - { + { var newColor = $("#mycolorpickerpreview").css("background-color"); var parts = newColor.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); // parts now should be ["rgb(0, 70, 255", "0", "70", "255"]