diff --git a/static/js/broadcast.js b/static/js/broadcast.js index c2ab308e..32424731 100644 --- a/static/js/broadcast.js +++ b/static/js/broadcast.js @@ -741,7 +741,7 @@ function loadBroadcastJS() for (var author in newAuthorData) { var data = newAuthorData[author]; - var bgcolor = data.colorId; + var bgcolor = typeof data.colorId == "number" ? clientVars.colorPalette[data.colorId] : data.colorId; if (bgcolor && dynamicCSS) { dynamicCSS.selectorStyle('.' + linestylefilter.getAuthorClassName(author)).backgroundColor = bgcolor; diff --git a/static/js/collab_client.js b/static/js/collab_client.js index dd744be4..c5635aa5 100644 --- a/static/js/collab_client.js +++ b/static/js/collab_client.js @@ -407,6 +407,7 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options) { var userInfo = msg.userInfo; var id = userInfo.userId; + if (userSet[id]) { userSet[id] = userInfo; @@ -471,6 +472,11 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options) function tellAceAuthorInfo(userId, colorId, inactive) { + if(typeof colorId == "number") + { + colorId = clientVars.colorPalette[colorId]; + } + var cssColor = colorId; if (inactive) { diff --git a/static/js/pad2.js b/static/js/pad2.js index b568973d..b71e2a3c 100644 --- a/static/js/pad2.js +++ b/static/js/pad2.js @@ -226,12 +226,6 @@ function handshake() clientVars = obj; clientVars.userAgent = "Anonymous"; clientVars.collab_client_vars.clientAgent = "Anonymous"; - - //translate old colorIDs to RGB strings - if(typeof clientVars.userColor == "number") - { - clientVars.userColor = clientVars.colorPalette[clientVars.userColor]; - } //initalize the pad pad.init(); diff --git a/static/js/pad_userlist.js b/static/js/pad_userlist.js index 1217affc..68f33419 100644 --- a/static/js/pad_userlist.js +++ b/static/js/pad_userlist.js @@ -499,6 +499,12 @@ var paduserlist = (function() }, setMyUserInfo: function(info) { + //translate the colorId + if(typeof info.colorId == "number") + { + info.colorId = clientVars.colorPalette[info.colorId]; + } + myUserInfo = $.extend( {}, info); @@ -513,7 +519,7 @@ var paduserlist = (function() } var userData = {}; - userData.color = info.colorId; + userData.color = typeof info.colorId == "number" ? clientVars.colorPalette[info.colorId] : info.colorId; userData.name = info.name; userData.status = ''; userData.activity = '';