diff options
author | Ev Bogue <ev@evbogue.com> | 2019-11-17 10:22:14 -0600 |
---|---|---|
committer | Ev Bogue <ev@evbogue.com> | 2019-11-17 10:22:14 -0600 |
commit | 8e4ebcffefb4c5b27020699418391572126c96a0 (patch) | |
tree | 7484d9db250b7f76707d8d576c5a77541d3f50df | |
parent | e555c43e71c2d86ee86e40c3a756f6ac87c480b2 (diff) |
add a reply button to profile pages
-rw-r--r-- | views.js | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -5,17 +5,14 @@ function threadPage (src, keys) { } function profilePage (src, keys) { + var gotName = getName(src, keys) + var msg = {} + msg.author = src var profile = h('div', {classList: 'profile'}) scroller.appendChild(profile) - if (src != keys.publicKey) { - reply = { author: src } - scroller.appendChild(composer(keys, reply)) - } else { - scroller.appendChild(composer(keys)) - } var subs = [src] @@ -34,9 +31,17 @@ function profilePage (src, keys) { } }, ['Mentions']) + var respond = h('button', { + onclick: function () { + scroller.insertBefore(composer(keys, msg, gotName), scroller.childNodes[1]) + } + }, ['Reply to ' + gotName.textContent]) + profile.appendChild(identify(src, profile, keys)) profile.appendChild(mentionsButton) + profile.appendChild(respond) + localforage.getItem('subscriptions').then(function (subs) { if (subs.includes(src)) { profile.appendChild(h('button', { |