Files: a3d2c0a84691aab64838207f75583d4e86d564b5 / modules_extra / meta-image.js
1501 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.needs = { blob_url: 'first' } |
15 | exports.gives = 'message_content' |
16 | |
17 | exports.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