git ssb

16+

Dominic / patchbay



Tree: d9ba09fe7118718dfeddc73ddab338839d9e78c7

Files: d9ba09fe7118718dfeddc73ddab338839d9e78c7 / modules_extra / blob.js

509 bytesRaw
1const fs = require('fs')
2const h = require('../h')
3const ref = require('ssb-ref')
4
5exports.needs = {
6 blob_url: 'first'
7}
8
9exports.gives = {
10 'screen_view': true,
11 'mcss': true
12}
13
14exports.create = (api) => {
15 return {
16 screen_view,
17 mcss: () => fs.readFileSync(__filename.replace(/js$/, 'mcss'), 'utf8')
18 }
19
20 function screen_view (path) {
21 if(!ref.isBlob(path)) return
22
23 return h('Blob', [
24 h('iframe', {
25 src: api.blob_url(path),
26 sandbox: ''
27 })
28 ])
29 }
30}
31
32

Built with git-ssb-web