diff options
| author | Ev Bogue <ev@evbogue.com> | 2019-04-19 09:51:27 -0500 | 
|---|---|---|
| committer | Ev Bogue <ev@evbogue.com> | 2019-04-19 09:51:27 -0500 | 
| commit | 1a5e5c65752ff180a09fed5fe851556b5f3a3c46 (patch) | |
| tree | a0dc3f0e6285d63104ced9599029a01d9c4efa6d | |
| parent | 0d07708fe1ae9164ec1b361f60c5186af7ac7aed (diff) | |
identify users on their profile pages
| -rw-r--r-- | app.js | 29 | 
1 files changed, 29 insertions, 0 deletions
| @@ -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++) { | 
