git ssb

16+

Dominic / patchbay



Tree: 038a737d7b268452a2d1ca1cd1e3ade9b5e966ff

Files: 038a737d7b268452a2d1ca1cd1e3ade9b5e966ff / modules_extra / meta-image.js

1501 bytesRaw
1var markdown = require('ssb-markdown');
2var h = require('hyperscript');
3var u = require('../util');
4var ref = require('ssb-ref');
5
6//render a message
7
8//var plugs = require('../plugs');
9//var message_link = plugs.first(exports.message_link = []);
10//var message_confirm = plugs.first(exports.message_confirm = []);
11//var sbot_links = plugs.first(exports.sbot_links = []);
12//var blob_url = plugs.first(exports.blob_url = []);
13//
14exports.needs = { blob_url: 'first' }
15exports.gives = 'message_content'
16
17exports.create = function (api) {
18 return function(msg, sbot) {
19 if (msg.value.content.type !== 'meta-image')
20 return;
21
22 var v = msg.value.content;
23 return h('div',
24 // h('h2', "(" + v.Track + ") " + v.Title),
25 h('img', { "src" : api.blob_url(v.link) }))
26
27 // h('dl',
28 // Object.keys(v).map(function(k) {
29 // return [
30 // h("dt", k),
31 // h("dd", v[k]),
32 // ]
33 // })))
34
35 // "Album": "the fall of",
36 // "Crc32": "038becab",
37 // "Creator": "bleupulp",
38 // "Format": "VBR MP3",
39 // "Height": "0",
40 // "Length": "375.23",
41 // "Md5": "2c517c8e813da5f940c8c7e77d4b7f3f",
42 // "Mtime": "1399498698",
43 // "Name": "2_bleupulp_-_clouds.mp3",
44 // "Sha1": "9f6a96a3d5571ed1ec2a7da38ffebdcd5f181482",
45 // "Size": "15009000",
46
47 // "Title": "clouds",
48 // "Track": "2",
49 // "Width": "0",
50
51 }
52}
53

Built with git-ssb-web