git ssb

16+

Dominic / patchbay



Commit cc9a7d40d27d6abfd9be99ee32cc20b8df57accf

Add blob screen view

cel committed on 12/2/2016, 6:15:07 AM
Parent: 86745d2ae3eb9733681d16c4e9cfabeeef30b588

Files changed

modules_extra/index.jschanged
modules_extra/blob.jsadded
modules_extra/index.jsView
@@ -1,6 +1,7 @@
11 module.exports = {
22 "audio-mp3.js": require('./audio-mp3.js'),
3 + "blob.js": require('./blob.js'),
34 "channel.js": require('./channel.js'),
45 "emoji.js": require('./emoji.js'),
56 "suggest-emoji.js": require('./suggest-emoji.js'),
67 "dns.js": require('./dns.js'),
modules_extra/blob.jsView
@@ -1,0 +1,23 @@
1 +var h = require('hyperscript')
2 +var ref = require('ssb-ref')
3 +
4 +var plugs = require('../plugs')
5 +var blob_url = plugs.first(exports.blob_url = [])
6 +
7 +exports.screen_view = function (path) {
8 + if(ref.isBlob(path)) return blob_view(path)
9 +}
10 +
11 +function blob_view(id) {
12 + return h('iframe', {
13 + src: blob_url(id),
14 + sandbox: '',
15 + style: {
16 + position: 'absolute',
17 + width: '100%',
18 + height: '100%',
19 + border: 0,
20 + }
21 + })
22 +}
23 +

Built with git-ssb-web