From e555c43e71c2d86ee86e40c3a756f6ac87c480b2 Mon Sep 17 00:00:00 2001 From: Ev Bogue Date: Sun, 17 Nov 2019 09:08:59 -0600 Subject: show profile photo on profile, misc style tweaks --- css/style.css | 1 + render.js | 14 +++++++------- views.js | 6 +++++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/css/style.css b/css/style.css index 4726e84..fad1090 100644 --- a/css/style.css +++ b/css/style.css @@ -202,6 +202,7 @@ form.search { text-decoration: none; } +.profileAvatar { width: 75px; vertical-align: top; border-radius: 5px; margin-right: .25em; margin-bottom: .25em;} .avatar { width: 25px; height: 25px; vertical-align: middle; border-radius: 5px; margin-right: .2em; } button { diff --git a/render.js b/render.js index f7031d0..8ed5cba 100644 --- a/render.js +++ b/render.js @@ -145,16 +145,16 @@ function render (msg, keys, preview) { } } } else if (msg.type == 'name') { - message.appendChild(getHeader(msg, keys)) - message.appendChild(h('span', ['identified ', h('a', {href: '#' + msg.named }, [msg.named.substring(0, 10) + '...']), ' as ' + msg.name])) + var mini = h('span', [' identified ', h('a', {href: '#' + msg.named }, [msg.named.substring(0, 10) + '...']), ' as ' + msg.name]) + message.appendChild(getHeader(msg, keys, mini)) } else if (msg.type == 'image') { - message.appendChild(getHeader(msg, keys)) - message.appendChild(h('span', [ - 'identified ', + var mini = h('span', [ + ' identified ', h('a', { href: '#' + msg.imaged }, [msg.imaged.substring(0, 10) + '...']), ' as ', - h('img', {src: msg.image}) - ])) + h('img', {src: msg.image, classList: 'avatar'}) + ]) + message.appendChild(getHeader(msg, keys, mini)) } messageDiv.appendChild(message) diff --git a/views.js b/views.js index 0d8a532..018802d 100644 --- a/views.js +++ b/views.js @@ -21,7 +21,11 @@ function profilePage (src, keys) { sync(subs, keys) - profile.appendChild(h('a', {href: '#' + src}, [getName(src, keys)])) + profile.appendChild(h('a', {href: '#' + src}, [ + getImage(src, keys, 'profileAvatar'), + getName(src, keys) + ])) + profile.appendChild(h('br')) var mentionsButton = h('button', { -- cgit v1.2.3-70-g09d2