git ssb

16+

Dominic / patchbay



Tree: f90124ba5ae5f6479370cba8fc7df6744422db23

Files: f90124ba5ae5f6479370cba8fc7df6744422db23 / 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