git ssb

16+

Dominic / patchbay



Commit 1462eddad93e346c412fe00dd5fb4468adf1ee04

Merge remote-tracking branch 'origin/master' into about_refactor

mix irving committed on 12/29/2016, 8:45:11 PM
Parent: 822d7aba3e5e907a98c48a9abe3223cc278c6c95
Parent: 978514244345bcdb7a80bd72d8faaa4af761e167

Files changed

README.mdchanged
modules_basic/invite.jschanged
package.jsonchanged
README.mdView
@@ -38,8 +38,27 @@
3838 npm run bundle
3939 npm start
4040 ```
4141
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 +
4261 ## how to add a feature
4362
4463 To add a new message type, add add a js to `./modules/` that
4564 exports a function named `message_content` (it should return an html element)
modules_basic/invite.jsView
@@ -34,9 +34,9 @@
3434 invite_accept: function (invite, onProgress, cb) {
3535 var data = self.invite_parse(invite)
3636 if(!data) return cb(new Error('not a valid invite code:' + invite))
3737
38- onProgress('connecting...')
38 + onProgress('Connecting...')
3939
4040 api.sbot_gossip_connect(data.remote, function (err) {
4141 if(err) console.log(err)
4242 })
@@ -45,21 +45,21 @@
4545 remote: data.invite,
4646 manifest: { invite: {use: 'async'}, getAddress: 'async' }
4747 }, function (err, sbot) {
4848 if(err) return cb(err)
49- onProgress('requesting follow...')
49 + onProgress('Requesting follow...')
5050 console.log(sbot)
5151 sbot.invite.use({feed: id}, function (err, msg) {
5252
5353 //if they already follow us, just check we actually follow them.
5454 if(err) api.follower_of(id, data.key, function (_err, follows) {
55- if(follows) cb(err)
55 + if(follows) { location.hash = '' }
5656 else next()
5757 })
5858 else next()
5959
6060 function next () {
61- onProgress('following...')
61 + onProgress('Following...')
6262
6363 //remove the seed from the shs address.
6464 //then it's correct address.
6565 //this should make the browser connect to this as remote.
@@ -87,15 +87,17 @@
8787 //connect to server
8888 //request follow
8989 //post pub announce
9090 //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))
9596 ),
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!'")
98100 )
99101
100102 function attempt () {
101103 self.invite_accept(invite, function (message) {
package.jsonView
@@ -1,8 +1,8 @@
11 {
22 "name": "patchbay",
33 "description": "a pluggable patchwork",
4- "version": "6.1.4",
4 + "version": "6.1.5",
55 "homepage": "https://github.com/dominictarr/patchbay",
66 "repository": {
77 "type": "git",
88 "url": "git://github.com/dominictarr/patchbay.git"
@@ -71,9 +71,9 @@
7171 "brfs"
7272 ]
7373 },
7474 "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",
7676 "start": "electro index.js",
7777 "bundle": "mkdir -p build && browselectrify index.js > build/bundle.js",
7878 "rebuild": "npm rebuild --runtime=electron --target=$(electron -v) --abi=$(electron --abi) --disturl=https://atom.io/download/atom-shell",
7979 "graph": "node index.js | dot -Tsvg > graph.svg",

Built with git-ssb-web