Commit 684d7b5c8a1e6ed250e3804311ec2afef64b6720
removed last mention (didn't work) and clean up
Ev Bogue committed on 9/20/2016, 5:54:36 PMParent: a096997010493803cf4bb08f12a5f112e9bd24d7
Files changed
index.js | changed |
style.css | changed |
index.js | |||
---|---|---|---|
@@ -9,28 +9,33 @@ | |||
9 | 9 … | var ref = require('ssb-ref') | |
10 | 10 … | ||
11 | 11 … | var title = 'sdash' | |
12 | 12 … | 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.' | ||
14 | 14 … | var bloburl = 'http://localhost:8989/blobs/get/' | |
15 | 15 … | ||
16 … | +var loc = 'The World' | ||
17 … | +var email = 'No email' | ||
18 … | + | ||
19 … | +var pin = 'No pinned message, yet' | ||
20 … | + | ||
16 | 21 … | client(function (err, sbot) { | |
17 | 22 … | pull( | |
18 | 23 … | sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'email'}}}}], limit: 1, reverse: true}), | |
19 | 24 … | pull.drain(function (data) { | |
20 | - email = data.value.content.email; | ||
25 … | + email = data.value.content.email | ||
21 | 26 … | }) | |
22 | 27 … | ) | |
23 | 28 … | pull( | |
24 | 29 … | sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'location'}}}}], limit: 1, reverse: true}), | |
25 | 30 … | pull.drain(function (data) { | |
26 | - loc = data.value.content.location; | ||
31 … | + loc = data.value.content.location | ||
27 | 32 … | }) | |
28 | 33 … | ) | |
29 | 34 … | pull( | |
30 | 35 … | sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'website'}}}}], limit: 1, reverse: true}), | |
31 | 36 … | pull.drain(function (data) { | |
32 | - website = data.value.content.website; | ||
37 … | + website = data.value.content.website | ||
33 | 38 … | }) | |
34 | 39 … | ) | |
35 | 40 … | }) | |
36 | 41 … | ||
@@ -38,10 +43,10 @@ | |||
38 | 43 … | if (req.url === '/') { | |
39 | 44 … | client(function (err, sbot) { | |
40 | 45 … | avatar(sbot, me, me, function (err, avatar){ | |
41 | 46 … | if (err) throw err | |
42 | - name = avatar.name; | ||
43 | - image = avatar.image; | ||
47 … | + name = avatar.name | ||
48 … | + image = avatar.image | ||
44 | 49 … | }) | |
45 | 50 … | pull( | |
46 | 51 … | sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'post'}}}}], limit: 1, reverse: true}), | |
47 | 52 … | pull.drain(function (data) { | |
@@ -50,32 +55,30 @@ | |||
50 | 55 … | ) | |
51 | 56 … | pull( | |
52 | 57 … | sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'pin'}}}}], limit: 1, reverse: true}), | |
53 | 58 … | pull.drain(function (data) { | |
54 | - getpin = data; | ||
59 … | + getpin = data | ||
55 | 60 … | pull( | |
56 | 61 … | sbot.query.read({query: [{$filter: { key: getpin.value.content.link}}]}), | |
57 | 62 … | pull.drain(function (data) { | |
58 | - pinned = data; | ||
63 … | + pinned = data | ||
59 | 64 … | }) | |
60 | 65 … | ) | |
61 | 66 … | }) | |
62 | 67 … | ) | |
63 | 68 … | pull( | |
64 | 69 … | sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'vote'}}}}], limit: 1, reverse: true}), | |
65 | 70 … | pull.drain(function (data) { | |
66 | - vote = data; | ||
71 … | + vote = data | ||
67 | 72 … | pull( | |
68 | 73 … | sbot.query.read({query: [{$filter: { key: data.value.content.vote.link}}]}), | |
69 | 74 … | pull.drain(function (data) { | |
70 | 75 … | 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 | ||
75 | 78 … | gotPost() | |
76 | 79 … | }) | |
77 | - redo = data; | ||
80 … | + redo = data | ||
78 | 81 … | }) | |
79 | 82 … | ) | |
80 | 83 … | }) | |
81 | 84 … | ) | |
@@ -144,18 +147,9 @@ | |||
144 | 147 … | h('span.date', mo(redo.value.timestamp).fromNow()) | |
145 | 148 … | ) | |
146 | 149 … | ) | |
147 | 150 … | ) | |
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 | - ) | ||
156 | 151 … | ) | |
157 | - | ||
158 | 152 … | ) | |
159 | 153 … | ).outerHTML) | |
160 | 154 … | } | |
161 | 155 … | } |
Built with git-ssb-web