git ssb

3+

ev / sdash



Commit 684d7b5c8a1e6ed250e3804311ec2afef64b6720

removed last mention (didn't work) and clean up

Ev Bogue committed on 9/20/2016, 5:54:36 PM
Parent: a096997010493803cf4bb08f12a5f112e9bd24d7

Files changed

index.jschanged
style.csschanged
index.jsView
@@ -9,28 +9,33 @@
99 var ref = require('ssb-ref')
1010
1111 var title = 'sdash'
1212 var me = '@8Qee0I/DwI5DHSCi3p5fsl6FyLGArrnDz3ox9qZr5Qc=.ed25519'
13-var desc = 'This is <a href="https://gitmx.com/%25qrU04j9vfUJKfq1rGZrQ5ihtSfA4ilfY3wLy7xFv0xk%3D.sha256">sdash</a>, a work-in-progress personal gateway to the <a href="http://ssbc.github.io">scuttlebot</a> distributed social network'
13 +var desc = 'This is <a href="https://gitmx.com/%25qrU04j9vfUJKfq1rGZrQ5ihtSfA4ilfY3wLy7xFv0xk%3D.sha256">sdash</a>, a work-in-progress personal gateway to the <a href="http://ssbc.github.io">scuttlebot</a> distributed social network.'
1414 var bloburl = 'http://localhost:8989/blobs/get/'
1515
16 +var loc = 'The World'
17 +var email = 'No email'
18 +
19 +var pin = 'No pinned message, yet'
20 +
1621 client(function (err, sbot) {
1722 pull(
1823 sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'email'}}}}], limit: 1, reverse: true}),
1924 pull.drain(function (data) {
20- email = data.value.content.email;
25 + email = data.value.content.email
2126 })
2227 )
2328 pull(
2429 sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'location'}}}}], limit: 1, reverse: true}),
2530 pull.drain(function (data) {
26- loc = data.value.content.location;
31 + loc = data.value.content.location
2732 })
2833 )
2934 pull(
3035 sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'website'}}}}], limit: 1, reverse: true}),
3136 pull.drain(function (data) {
32- website = data.value.content.website;
37 + website = data.value.content.website
3338 })
3439 )
3540 })
3641
@@ -38,10 +43,10 @@
3843 if (req.url === '/') {
3944 client(function (err, sbot) {
4045 avatar(sbot, me, me, function (err, avatar){
4146 if (err) throw err
42- name = avatar.name;
43- image = avatar.image;
47 + name = avatar.name
48 + image = avatar.image
4449 })
4550 pull(
4651 sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'post'}}}}], limit: 1, reverse: true}),
4752 pull.drain(function (data) {
@@ -50,32 +55,30 @@
5055 )
5156 pull(
5257 sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'pin'}}}}], limit: 1, reverse: true}),
5358 pull.drain(function (data) {
54- getpin = data;
59 + getpin = data
5560 pull(
5661 sbot.query.read({query: [{$filter: { key: getpin.value.content.link}}]}),
5762 pull.drain(function (data) {
58- pinned = data;
63 + pinned = data
5964 })
6065 )
6166 })
6267 )
6368 pull(
6469 sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'vote'}}}}], limit: 1, reverse: true}),
6570 pull.drain(function (data) {
66- vote = data;
71 + vote = data
6772 pull(
6873 sbot.query.read({query: [{$filter: { key: data.value.content.vote.link}}]}),
6974 pull.drain(function (data) {
7075 avatar(sbot, me, data.value.author, function (err, avatar){
71- if (err) {
72- throw err;
73- }
74- reauthor = avatar;
76 + if (err) throw err
77 + reauthor = avatar
7578 gotPost()
7679 })
77- redo = data;
80 + redo = data
7881 })
7982 )
8083 })
8184 )
@@ -144,18 +147,9 @@
144147 h('span.date', mo(redo.value.timestamp).fromNow())
145148 )
146149 )
147150 )
148- ),
149- h('div.msg',
150- h('p.small.ri', 'last mention'),
151- h('img.avatar', {src: bloburl + mentionauthor.image}),
152- h('a', {href: me }, '@' + mentionauthor.name),
153- h('div', {innerHTML: md.block(mention.value.content.text)},
154- h('span.date', mo(mention.value.timestamp).fromNow())
155- )
156151 )
157-
158152 )
159153 ).outerHTML)
160154 }
161155 }
style.cssView
@@ -5,10 +5,12 @@
55 margin-right: auto;
66 margin-left: auto;
77 }
88
9-p {
9 +p, pre, code {
1010 margin-top: .35ex;
11 + word-wrap: break-word;
12 + white-space: pre-wrap;
1113 }
1214
1315 .msg {
1416 border-bottom: 1px solid #eee;

Built with git-ssb-web