git ssb

16+

Dominic / patchbay



Commit 563a47e65cc3a33e94dbc286e9b78d81a1b2d623

add blob view to router

mix irving committed on 3/19/2017, 8:31:56 PM
Parent: c24aab4d406daa99a57712bf37fc9f5d7c2971ff

Files changed

router/html/page/blob.jsadded
router/html/page/blob.mcssadded
router/html/page/blob.jsView
@@ -1,0 +1,25 @@
1+const nest = require('depnest')
2+const ref = require('ssb-ref')
3+const Scroller = require('pull-scroll')
4+const pull = require('pull-stream')
5+const { h, watch } = require('mutant')
6+
7+exports.gives = nest('router.html.page')
8+
9+exports.needs = nest('blob.sync.url', 'first')
10+
11+exports.create = (api) => {
12+ return nest('router.html.page', blobView)
13+
14+ function blobView (path) {
15+ if (!ref.isBlob(path)) return
16+
17+ return h('Blob', { id: path, title: path.slice(0, 9) + '...' }, [
18+ h('iframe', {
19+ src: api.blob.sync.url(path),
20+ sandbox: ''
21+ })
22+ ])
23+ }
24+}
25+
router/html/page/blob.mcssView
@@ -1,0 +1,9 @@
1+Blob {
2+ iframe {
3+ position: absolute
4+ width: 100%
5+ height: 100%
6+ border: 0
7+ }
8+}
9+

Built with git-ssb-web