From 5a44b2ec8e3c8c7c7c2d2e6a254d71feb7711ebb Mon Sep 17 00:00:00 2001 From: Ev Bogue Date: Fri, 12 Jul 2019 18:45:59 -0500 Subject: clean up welcome, and link to sr.ht instead of github --- app.js | 21 +++++++++------------ views.js | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/app.js b/app.js index b85ed5b..c4d2efd 100644 --- a/app.js +++ b/app.js @@ -15,9 +15,9 @@ function route (keys) { scroller.appendChild(identify) - identify.appendChild(h('span', {innerHTML: marked("Hey! Welcome to Bogbook. If you have any questions be sure to reach out to [@ev](/#@Q++V5BbvWIg8B+TqtC9ZKFhetruuw+nOgxEqfjlOZI0=).")})) + identify.appendChild(h('span', {innerHTML: marked("Hey [" + keys.publicKey.substring(0, 10) + "...](/#"+ keys.publicKey +")! Welcome to Bogbook. If you have any questions be sure to reach out to [@ev](/#@Q++V5BbvWIg8B+TqtC9ZKFhetruuw+nOgxEqfjlOZI0=).")})) - identify.appendChild(h('span', {innerHTML: marked("We noticed that your current public key doesn't have a name yet. Either import your existing id on the [key](/#key) page, or identify yourself using the box below. Identifying is optional, but you'll see this welcome message as long as you don't give yourself a name.")})) + identify.appendChild(h('span', {innerHTML: marked("Your current public key doesn't have a name yet. Either import your existing id on the [key](/#key) page, or identify yourself using the box below. Identifying is optional, but you'll see this welcome message as long as you don't give yourself a name.")})) var input = h('input', {placeholder: 'Give yourself a name'}) @@ -31,21 +31,18 @@ function route (keys) { name: input.value } - publish(content, keys).then(post => { - open(post).then(msg => { - input.value = '' - scroller.insertBefore(render(msg, keys), scroller.childNodes[1]) - identify.parentNode.removeChild(identify) - }) - }) + publish(content, keys) + setTimeout(function () { + location.reload() + }, 1000) } }, ['Identify']) ])) - identify.appendChild(h('span', {innerHTML: marked("Next, make sure to save your public/private keypair on the [key](/#key) page, so that you can continue to use the same identity. No one has access to your private key, so no one can restore your ability to publish under this identity if you lose your keypair.")})) + identify.appendChild(h('span', {innerHTML: marked("Next, make sure to save your public/private keypair on the [key](/#key) page, so that you can continue to use the same identity. No one but you access to your private key, so no one can restore your ability to publish under this identity if you lose your keypair.")})) - identify.appendChild(h('span', {innerHTML: marked("Finally, be sure to check out the code on [Github](http://github.com/bogbook/bog) or [SourceHut](http://git.sr.ht/~ev/bogbook)")})) + identify.appendChild(h('span', {innerHTML: marked("Finally, be sure to check out the code on [SourceHut](http://git.sr.ht/~ev/bogbook)")})) bog(keys.publicKey).then(log => { if (log) { @@ -97,7 +94,7 @@ keys().then(key => { h('li', [h('a', {href: '#' + key.publicKey}, [getName(key.publicKey, keys)])]), h('li', [h('a', {href: '#key'}, ['Key'])]), h('li', [h('a', {href: '#pubs'}, ['Pubs'])]), - h('li', {classList: 'right'}, [h('a', {href: 'http://github.com/bogbook/bog/'}, ['Git'])]) + h('li', {classList: 'right'}, [h('a', {href: 'http://git.sr.ht/~ev/bogbook'}, ['Git'])]) ]) ]) document.body.appendChild(navbar) diff --git a/views.js b/views.js index b3cd061..7727204 100644 --- a/views.js +++ b/views.js @@ -17,7 +17,9 @@ function profilePage (src, keys) { profile.appendChild(h('a', {href: '#' + src}, [getName(src, keys)])) - profile.appendChild(h('div', [ + profile.appendChild(h('br')) + + var identify = h('div', [ input, h('button', { onclick: function () { @@ -35,7 +37,16 @@ function profilePage (src, keys) { }) } }, ['Identify']) - ])) + ]) + + var identifyButton = h('button', { + onclick: function () { + profile.appendChild(identify) + identifyButton.parentNode.removeChild(identifyButton) + } + }, ['Identify ' + keys.publicKey.substring(0, 10) + '...']) + + profile.appendChild(identifyButton) localforage.getItem('subscriptions').then(function (subs) { if (subs.includes(src)) { -- cgit v1.2.3-70-g09d2