aboutsummaryrefslogtreecommitdiff
path: root/shardweb/assets/js/app.js
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-11-02 11:22:28 +0100
committerAlex Auvolat <alex@adnab.me>2018-11-02 11:22:28 +0100
commit3baa53f1da7f581619b066832b8303efbe9a46ba (patch)
treed6b49bd09fa915b93e13f3a03febc7fb1b38e9a4 /shardweb/assets/js/app.js
parent80200dc43f271938fb14ec4eb4712e8dd7375aeb (diff)
downloadshard-3baa53f1da7f581619b066832b8303efbe9a46ba.tar.gz
shard-3baa53f1da7f581619b066832b8303efbe9a46ba.zip
Remove friends list ; add some links
Diffstat (limited to 'shardweb/assets/js/app.js')
-rw-r--r--shardweb/assets/js/app.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/shardweb/assets/js/app.js b/shardweb/assets/js/app.js
index 3adae5a..1e5ea62 100644
--- a/shardweb/assets/js/app.js
+++ b/shardweb/assets/js/app.js
@@ -20,6 +20,8 @@ import "phoenix_html"
import socket from "./socket"
+import routes from './phoenix-jsroutes'
+
var chat_channel = window.Gon.getAsset('chat_channel');
if (chat_channel != undefined)
{
@@ -28,9 +30,9 @@ if (chat_channel != 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>&lt;' + name + '</b> <small>' + payload.pk16 + '</small><b>&gt;</b> ' + payload.message; // set li contents
+ li.innerHTML = '<b>&lt;' + name + '</b> <a href="' + routes.identityView(payload.fullpk) + '"><small>' + payload.pk16 + '</small></a><b>&gt;</b> ' + payload.message; // set li contents
- console.log(ul.scrollTop + ' ' + ul.scrollHeight + ' ' + ul.clientHeight);
+ // console.log(ul.scrollTop + ' ' + ul.scrollHeight + ' ' + ul.clientHeight);
var must_scroll = (ul.scrollTop >= ul.scrollHeight - ul.clientHeight - 10);
ul.appendChild(li); // append to list