Commit cc9a7d40d27d6abfd9be99ee32cc20b8df57accf
Add blob screen view
cel committed on 12/2/2016, 6:15:07 AMParent: 86745d2ae3eb9733681d16c4e9cfabeeef30b588
Files changed
modules_extra/index.js | changed |
modules_extra/blob.js | added |
modules_extra/index.js | ||
---|---|---|
@@ -1,6 +1,7 @@ | ||
1 | 1 … | module.exports = { |
2 | 2 … | "audio-mp3.js": require('./audio-mp3.js'), |
3 … | + "blob.js": require('./blob.js'), | |
3 | 4 … | "channel.js": require('./channel.js'), |
4 | 5 … | "emoji.js": require('./emoji.js'), |
5 | 6 … | "suggest-emoji.js": require('./suggest-emoji.js'), |
6 | 7 … | "dns.js": require('./dns.js'), |
modules_extra/blob.js | ||
---|---|---|
@@ -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