aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEv Bogue <ev@evbogue.com>2019-04-06 12:38:35 -0500
committerEv Bogue <ev@evbogue.com>2019-04-06 12:38:35 -0500
commitd1350773720b709e549927a2bf23548aab8df14a (patch)
tree16e337d0f5601130f76f496a393ccf3717e9667e
parent618a88e33b0bc49e7b914a9bd24c8838a8cd8f57 (diff)
make it possible to import your existing keypair
-rw-r--r--app.js21
1 files changed, 17 insertions, 4 deletions
diff --git a/app.js b/app.js
index 02c7be1..66816c5 100644
--- a/app.js
+++ b/app.js
@@ -56,16 +56,29 @@ function route () {
if (src === 'key') {
var keyMessage = h('div', {classList: 'message'})
+ keyMessage.appendChild(h('p', {innerHTML: marked('This is your ed25519 public/private keypair. It was generated using [Tweetnacl.js](https://tweetnacl.js.org/#/). Your public key is your identiy when using [Bogbook](http://bogbook.com/), save your key in a safe place so that you can continue to use the same identity.')}))
+
+ // print stringified keypair
+ keyMessage.appendChild(h('pre', {style: 'width: 80%'}, [h('code', [JSON.stringify(keys)])]))
+
// delete key button
- keyMessage.appendChild(h('button', {classList: 'right',
+ keyMessage.appendChild(h('button', {
onclick: function () {
localStorage['id'] = ''
location.reload()
}
}, ['Delete Key']))
-
- // print stringified keypair
- keyMessage.appendChild(h('pre', {style: 'width: 80%'}, [h('code', [JSON.stringify(keys)])]))
+
+ var textarea = h('textarea', {placeholder: 'Import your existing ed25519 keypair'})
+ keyMessage.appendChild(textarea)
+ keyMessage.appendChild(h('button', {
+ onclick: function () {
+ if (textarea.value) {
+ localStorage['id'] = textarea.value
+ location.reload()
+ }
+ }
+ }, ['Import Key']))
scroller.appendChild(keyMessage)
}