git ssb

2+

mixmix / ticktack



Commit 6e3760338297dc69b6f60760d58b197927d44110

click through to full screen images

Dominic Tarr committed on 8/16/2017, 9:55:26 PM
Parent: 1253a399464b2bc0274bac6368670c17c3cca16d

Files changed

app/index.jschanged
app/page/image.jsadded
router/sync/routes.jschanged
app/index.jsView
@@ -10,8 +10,9 @@
1010 },
1111 page: {
1212 channel: require('./page/channel'),
1313 error: require('./page/error'),
14+ image: require('./page/image'),
1415 groupFind: require('./page/groupFind'),
1516 groupIndex: require('./page/groupIndex'),
1617 groupNew: require('./page/groupNew'),
1718 groupShow: require('./page/groupShow'),
@@ -28,4 +29,5 @@
2829
2930
3031
3132
33+
app/page/image.jsView
@@ -1,0 +1,34 @@
1+const nest = require('depnest')
2+const { h } = require('mutant')
3+
4+exports.gives = nest('app.page.image')
5+
6+exports.needs = nest({
7+ 'translations.sync.strings': 'first',
8+ 'about.html.image': 'first',
9+ 'about.obs.name': 'first',
10+ 'app.html.thread': 'first',
11+ 'blob.sync.url': 'first'
12+})
13+
14+exports.create = (api) => {
15+ var strings = api.translations.sync.strings()
16+
17+ return nest('app.page.image', function (location) {
18+ return h('img', {src: api.blob.sync.url(location.blob || location)})
19+ })
20+//
21+// function threadNew (location) {
22+// return h('Page -Im', {title: "Image"}, [
23+// blob.sync.url(location)
24+// ])
25+// }
26+}
27+
28+
29+
30+
31+
32+
33+
34+
router/sync/routes.jsView
@@ -1,6 +1,6 @@
11 const nest = require('depnest')
2-const { isMsg, isFeed } = require('ssb-ref')
2+const { isMsg, isFeed, isBlob } = require('ssb-ref')
33 exports.gives = nest('router.sync.routes')
44
55 exports.needs = nest({
66 'app.page.error': 'first',
@@ -14,16 +14,18 @@
1414 'app.page.userFind': 'first',
1515 'app.page.userShow': 'first',
1616 'app.page.threadNew': 'first',
1717 'app.page.threadShow': 'first',
18+ 'app.page.image': 'first',
1819 })
1920
2021 exports.create = (api) => {
2122 return nest('router.sync.routes', (sofar = []) => {
2223 const pages = api.app.page
2324 // route format: [ routeValidator, routeFunction ]
2425
2526 const routes = [
27+ [ location => isBlob(location.blob), pages.image ],
2628 [ location => location.page === 'home', pages.home ],
2729 [ location => location.channel , pages.channel ],
2830 [ location => location.page === 'settings', pages.settings ],
2931
@@ -51,12 +53,4 @@
5153 }
5254
5355
5456
55-
56-
57-
58-
59-
60-
61-
62-

Built with git-ssb-web