Files: e33a98abcc85d3a3b35c0b2db5b98200b0614954 / modules_extra / blob.js
479 bytesRaw
1 | var h = require('hyperscript') |
2 | var ref = require('ssb-ref') |
3 | |
4 | exports.gives = 'screen_view' |
5 | |
6 | exports.needs = { |
7 | blob_url: 'first' |
8 | } |
9 | |
10 | exports.create = function (api) { |
11 | return function (path) { |
12 | if(ref.isBlob(path)) return blob_view(path) |
13 | } |
14 | |
15 | function blob_view(id) { |
16 | return h('iframe', { |
17 | src: api.blob_url(id), |
18 | sandbox: '', |
19 | style: { |
20 | position: 'absolute', |
21 | width: '100%', |
22 | height: '100%', |
23 | border: 0, |
24 | } |
25 | }) |
26 | } |
27 | } |
28 |
Built with git-ssb-web