git ssb

16+

Dominic / patchbay



Tree: 7478b5388306a177f85de2b6a0c3bcedf8635c87

Files: 7478b5388306a177f85de2b6a0c3bcedf8635c87 / modules_extra / meta-image.js

1225 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
8exports.needs = { blob_url: 'first' }
9exports.gives = 'message_content'
10
11exports.create = function (api) {
12 return function(msg, sbot) {
13 if (msg.value.content.type !== 'meta-image')
14 return;
15
16 var v = msg.value.content;
17 return h('div',
18 // h('h2', "(" + v.Track + ") " + v.Title),
19 h('img', { "src" : api.blob_url(v.link) }))
20
21 // h('dl',
22 // Object.keys(v).map(function(k) {
23 // return [
24 // h("dt", k),
25 // h("dd", v[k]),
26 // ]
27 // })))
28
29 // "Album": "the fall of",
30 // "Crc32": "038becab",
31 // "Creator": "bleupulp",
32 // "Format": "VBR MP3",
33 // "Height": "0",
34 // "Length": "375.23",
35 // "Md5": "2c517c8e813da5f940c8c7e77d4b7f3f",
36 // "Mtime": "1399498698",
37 // "Name": "2_bleupulp_-_clouds.mp3",
38 // "Sha1": "9f6a96a3d5571ed1ec2a7da38ffebdcd5f181482",
39 // "Size": "15009000",
40
41 // "Title": "clouds",
42 // "Track": "2",
43 // "Width": "0",
44
45 }
46}
47

Built with git-ssb-web