Files: 82418e8c0eab5c0b94532a1f8612097db1fc1bb4 / modules / identify.js
1460 bytesRaw
1 | var h = require('hyperscript') |
2 | var u = require('../util') |
3 | var pull = require('pull-stream') |
4 | var Scroller = require('pull-scroll') |
5 | var id = require('../keys').id |
6 | |
7 | exports.needs = { |
8 | publish: 'first', |
9 | avatar_edit: 'first' |
10 | } |
11 | |
12 | exports.gives = { |
13 | screen_view: true |
14 | } |
15 | |
16 | exports.create = function (api) { |
17 | return { |
18 | screen_view: function (path, sbot) { |
19 | if(path === 'Identify') { |
20 | if(process.title === 'browser') { |
21 | var identify = h('input.identify', {placeholder: 'Your Name', name: 'namespace'}) |
22 | var div = h('div.column.scroller', {style: 'overflow: auto;'}, |
23 | h('div.scroller__wrapper', |
24 | h('div.column.scroller__content', |
25 | h('h1', 'You\'re in! Now, you need a name'), |
26 | h('p', {innerHTML: '<p>You\'ve just generated a new public/private keypair: <pre><code>' + localStorage['browser/.ssb/secret'] + '</code></pre> You\'re the only person with access to the private key. If you want to hang onto this identity, save this key somewhere safe.<hr />'}), |
27 | h('p', {innerHTML: 'Right now, you\'re only identified by your public key: <code>' + id + '</code></p><p>Start by giving yourself a name:'}, |
28 | api.avatar_edit(id), |
29 | h('p', {innerHTML: 'Once you\'re done, navigate to <a href="./index.html">your feed</a>.'}) |
30 | ) |
31 | ) |
32 | ) |
33 | ) |
34 | return div |
35 | } |
36 | } |
37 | } |
38 | } |
39 | } |
40 | |
41 |
Built with git-ssb-web