From 1a5e5c65752ff180a09fed5fe851556b5f3a3c46 Mon Sep 17 00:00:00 2001 From: Ev Bogue Date: Fri, 19 Apr 2019 09:51:27 -0500 Subject: identify users on their profile pages --- app.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/app.js b/app.js index 0ceb9af..f2a66f8 100644 --- a/app.js +++ b/app.js @@ -66,6 +66,35 @@ function keyPage (keys) { function profilePage (src, keys) { var scroller = document.getElementById('scroller') + var message = h('div', {classList: 'message'}) + + var identify = h('input', {placeholder: 'Identify ' + src.substring(0, 10) + '...'}) + + message.appendChild(h('div', [ + identify, + h('button', {onclick: function () { + if (identify.value) { + var content = { + author: keys.publicKey, + type: 'name', + naming: src, + name: identify.value, + timestamp: Date.now() + } + + identify.value = '' + publish(content, keys) + localforage.setItem('id', keys, function (err, published) { + if (published) { + location.reload() + } + }) + } + }}, ['Identify']) + ])) + + scroller.appendChild(message) + localforage.getItem(src, function (err, log) { if (log) { for (var i=0; i < log.length; i++) { -- cgit v1.2.3-70-g09d2