Files: 11fc4a4c131af561b454a3251544add67c283036 / modules / meta-image.js
1392 bytesRaw
1 | var markdown = require('ssb-markdown'); |
2 | var h = require('hyperscript'); |
3 | var u = require('../util'); |
4 | var 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 | |
14 | exports.message_content = function(msg, sbot) { |
15 | if (msg.value.content.type !== 'meta-image') |
16 | return; |
17 | |
18 | var v = msg.value.content; |
19 | return h('div', |
20 | // h('h2', "(" + v.Track + ") " + v.Title), |
21 | h('img', { "src" : blob_url(v.link) })) |
22 | |
23 | // h('dl', |
24 | // Object.keys(v).map(function(k) { |
25 | // return [ |
26 | // h("dt", k), |
27 | // h("dd", v[k]), |
28 | // ] |
29 | // }))) |
30 | |
31 | // "Album": "the fall of", |
32 | // "Crc32": "038becab", |
33 | // "Creator": "bleupulp", |
34 | // "Format": "VBR MP3", |
35 | // "Height": "0", |
36 | // "Length": "375.23", |
37 | // "Md5": "2c517c8e813da5f940c8c7e77d4b7f3f", |
38 | // "Mtime": "1399498698", |
39 | // "Name": "2_bleupulp_-_clouds.mp3", |
40 | // "Sha1": "9f6a96a3d5571ed1ec2a7da38ffebdcd5f181482", |
41 | // "Size": "15009000", |
42 | |
43 | // "Title": "clouds", |
44 | // "Track": "2", |
45 | // "Width": "0", |
46 | |
47 | } |
48 | |
49 |
Built with git-ssb-web