Commit 1462eddad93e346c412fe00dd5fb4468adf1ee04
Merge remote-tracking branch 'origin/master' into about_refactor
mix irving committed on 12/29/2016, 8:45:11 PMParent: 822d7aba3e5e907a98c48a9abe3223cc278c6c95
Parent: 978514244345bcdb7a80bd72d8faaa4af761e167
Files changed
README.md | changed |
modules_basic/invite.js | changed |
package.json | changed |
README.md | ||
---|---|---|
@@ -38,8 +38,27 @@ | ||
38 | 38 … | npm run bundle |
39 | 39 … | npm start |
40 | 40 … | ``` |
41 | 41 … | |
42 … | +## Lite | |
43 … | + | |
44 … | +To run a lite client in the browser instead of using electron, use npm | |
45 … | +run lite from the prompt instead of run bundle. After that you need to | |
46 … | +generate a modern invite: | |
47 … | + | |
48 … | +``` | |
49 … | +sbot invite.create --modern | |
50 … | +``` | |
51 … | + | |
52 … | +Also set up sbot to allow these connections with: | |
53 … | + | |
54 … | +``` | |
55 … | +sbot server --allowPrivate | |
56 … | +``` | |
57 … | + | |
58 … | +Lastly open build/index.html in a browser and append the invite | |
59 … | +created above using: index.html#ws://localhost:8989.... | |
60 … | + | |
42 | 61 … | ## how to add a feature |
43 | 62 … | |
44 | 63 … | To add a new message type, add add a js to `./modules/` that |
45 | 64 … | exports a function named `message_content` (it should return an html element) |
modules_basic/invite.js | ||
---|---|---|
@@ -34,9 +34,9 @@ | ||
34 | 34 … | invite_accept: function (invite, onProgress, cb) { |
35 | 35 … | var data = self.invite_parse(invite) |
36 | 36 … | if(!data) return cb(new Error('not a valid invite code:' + invite)) |
37 | 37 … | |
38 | - onProgress('connecting...') | |
38 … | + onProgress('Connecting...') | |
39 | 39 … | |
40 | 40 … | api.sbot_gossip_connect(data.remote, function (err) { |
41 | 41 … | if(err) console.log(err) |
42 | 42 … | }) |
@@ -45,21 +45,21 @@ | ||
45 | 45 … | remote: data.invite, |
46 | 46 … | manifest: { invite: {use: 'async'}, getAddress: 'async' } |
47 | 47 … | }, function (err, sbot) { |
48 | 48 … | if(err) return cb(err) |
49 | - onProgress('requesting follow...') | |
49 … | + onProgress('Requesting follow...') | |
50 | 50 … | console.log(sbot) |
51 | 51 … | sbot.invite.use({feed: id}, function (err, msg) { |
52 | 52 … | |
53 | 53 … | //if they already follow us, just check we actually follow them. |
54 | 54 … | if(err) api.follower_of(id, data.key, function (_err, follows) { |
55 | - if(follows) cb(err) | |
55 … | + if(follows) { location.hash = '' } | |
56 | 56 … | else next() |
57 | 57 … | }) |
58 | 58 … | else next() |
59 | 59 … | |
60 | 60 … | function next () { |
61 | - onProgress('following...') | |
61 … | + onProgress('Following...') | |
62 | 62 … | |
63 | 63 … | //remove the seed from the shs address. |
64 | 64 … | //then it's correct address. |
65 | 65 … | //this should make the browser connect to this as remote. |
@@ -87,15 +87,17 @@ | ||
87 | 87 … | //connect to server |
88 | 88 … | //request follow |
89 | 89 … | //post pub announce |
90 | 90 … | //post follow pub |
91 | - var div = h('div.column', | |
92 | - h('div', | |
93 | - "you have been invited to join:", h('br'), | |
94 | - h('code', data.invite) | |
91 … | + var div = h('div.column.scroller__wrapper', | |
92 … | + h('div.column.scroller__content', {style: 'margin-top: 25%;'}, | |
93 … | + h('h1', {innerHTML: 'The <a href="https://scuttlebot.io">Secure Scuttlebutt</a> Lite Client'}), | |
94 … | + h('p', "You've been invited to join:"), | |
95 … | + h('p', h('code', data.invite)) | |
95 | 96 … | ), |
96 | - h('button', 'accept', {onclick: attempt}), | |
97 | - progress | |
97 … | + h('p', h('button', 'Accept', {onclick: attempt})), | |
98 … | + progress, | |
99 … | + h('p', "Once you're in, give yourself a name and photo. And don't forget to say 'Hello!'") | |
98 | 100 … | ) |
99 | 101 … | |
100 | 102 … | function attempt () { |
101 | 103 … | self.invite_accept(invite, function (message) { |
package.json | ||
---|---|---|
@@ -1,8 +1,8 @@ | ||
1 | 1 … | { |
2 | 2 … | "name": "patchbay", |
3 | 3 … | "description": "a pluggable patchwork", |
4 | - "version": "6.1.4", | |
4 … | + "version": "6.1.5", | |
5 | 5 … | "homepage": "https://github.com/dominictarr/patchbay", |
6 | 6 … | "repository": { |
7 | 7 … | "type": "git", |
8 | 8 … | "url": "git://github.com/dominictarr/patchbay.git" |
@@ -71,9 +71,9 @@ | ||
71 | 71 … | "brfs" |
72 | 72 … | ] |
73 | 73 … | }, |
74 | 74 … | "scripts": { |
75 | - "lite": "mkdir -p build && browserify index.js | indexhtmlify > build/index.html", | |
75 … | + "lite": "mkdir -p build && browserify index.js | indexhtmlify --title patchbay > build/index.html", | |
76 | 76 … | "start": "electro index.js", |
77 | 77 … | "bundle": "mkdir -p build && browselectrify index.js > build/bundle.js", |
78 | 78 … | "rebuild": "npm rebuild --runtime=electron --target=$(electron -v) --abi=$(electron --abi) --disturl=https://atom.io/download/atom-shell", |
79 | 79 … | "graph": "node index.js | dot -Tsvg > graph.svg", |
Built with git-ssb-web