summaryrefslogtreecommitdiff
path: root/src/static
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2013-03-12 17:34:15 +0000
committerMarcel Klehr <mklehr@gmx.net>2013-03-13 21:55:29 +0100
commitbabb33d8251e93db2eb9472a4e46b3b723b0992f (patch)
tree95035763bcecbc85dba9ab9b1ef3cd2de294d522 /src/static
parent0bceac98e3a3804dac9a6c0f9e70ae535a8b2978 (diff)
downloadetherpad-lite-babb33d8251e93db2eb9472a4e46b3b723b0992f.zip
add authorId to chat and userlist, possibly privacy/security issue?
Diffstat (limited to 'src/static')
-rw-r--r--src/static/js/chat.js2
-rw-r--r--src/static/js/pad_userlist.js10
2 files changed, 7 insertions, 5 deletions
diff --git a/src/static/js/chat.js b/src/static/js/chat.js
index 2dff2edf..83a487de 100644
--- a/src/static/js/chat.js
+++ b/src/static/js/chat.js
@@ -111,7 +111,7 @@ var chat = (function()
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
- var html = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>";
+ var html = "<p data-authorId='" + msg.userId + "' class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>";
if(isHistoryAdd)
$(html).insertAfter('#chatloadmessagesbutton');
else
diff --git a/src/static/js/pad_userlist.js b/src/static/js/pad_userlist.js
index 962595d2..c8f8e2c9 100644
--- a/src/static/js/pad_userlist.js
+++ b/src/static/js/pad_userlist.js
@@ -119,9 +119,9 @@ var paduserlist = (function()
return ['<td style="height:', height, 'px" class="usertdswatch"><div class="swatch" style="background:' + data.color + '">&nbsp;</div></td>', '<td style="height:', height, 'px" class="usertdname">', nameHtml, '</td>', '<td style="height:', height, 'px" class="activity">', padutils.escapeHtml(data.activity), '</td>'].join('');
}
- function getRowHtml(id, innerHtml)
+ function getRowHtml(id, innerHtml, authorId)
{
- return '<tr id="' + id + '">' + innerHtml + '</tr>';
+ return '<tr data-authorId="'+authorId+'" id="' + id + '">' + innerHtml + '</tr>';
}
function rowNode(row)
@@ -191,18 +191,20 @@ var paduserlist = (function()
domId: domId,
animationPower: animationPower
};
+ var authorId = data.id;
+
handleRowData(row);
rowsPresent.splice(position, 0, row);
var tr;
if (animationPower == 0)
{
- tr = $(getRowHtml(domId, getUserRowHtml(getAnimationHeight(0), data)));
+ tr = $(getRowHtml(domId, getUserRowHtml(getAnimationHeight(0), data), authorId));
row.animationStep = 0;
}
else
{
rowsFadingIn.push(row);
- tr = $(getRowHtml(domId, getEmptyRowHtml(getAnimationHeight(ANIMATION_START))));
+ tr = $(getRowHtml(domId, getEmptyRowHtml(getAnimationHeight(ANIMATION_START)), authorId));
}
handleRowNode(tr, data);
if (position == 0)