aboutsummaryrefslogtreecommitdiff
path: root/shardweb/assets/js
diff options
context:
space:
mode:
Diffstat (limited to 'shardweb/assets/js')
-rw-r--r--shardweb/assets/js/app.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/shardweb/assets/js/app.js b/shardweb/assets/js/app.js
index 59a0acd..c98ec1b 100644
--- a/shardweb/assets/js/app.js
+++ b/shardweb/assets/js/app.js
@@ -28,7 +28,7 @@ if (room_name != undefined)
channel.on('shout', function (payload) { // listen to the 'shout' event
var li = document.createElement("li"); // creaet new list item DOM element
var name = payload.name || 'guest'; // get name from payload or set default
- li.innerHTML = '<b>' + name + '</b>: ' + payload.message; // set li contents
+ li.innerHTML = '<b>' + name + '</b> <small>' + payload.pk16 + '</small>: ' + payload.message; // set li contents
console.log(ul.scrollTop + ' ' + ul.scrollHeight + ' ' + ul.clientHeight);
var must_scroll = (ul.scrollTop >= ul.scrollHeight - ul.clientHeight - 10);
@@ -49,7 +49,6 @@ if (room_name != undefined)
msg.addEventListener('keypress', function (event) {
if (event.keyCode == 13 && msg.value.length > 0) { // don't sent empty msg.
channel.push('shout', { // send the message to the server on "shout" channel
- name: name.value, // get value of "name" of person sending the message
message: msg.value // get message text (value) from msg input field.
});
msg.value = ''; // reset the message input field for next message.