Commit ff26c80cfeeef42ea28f8dcf591948899991614e
stabbing in the dark
Henry committed on 7/22/2016, 7:24:23 AMParent: 79737575585dc62349a1a2dc95a1ca4f2558e6c5
Files changed
.gitignore | changed |
modules/index.js | changed |
modules/audio-mp3.js | added |
modules/meta-image.js | added |
modules/music-release-cc.js | added |
modules/music-release.js | added |
package.json | changed |
music-release.json | added |
music-tracks.json | added |
modules/index.js | ||
---|---|---|
@@ -1,7 +1,8 @@ | ||
1 | 1 | module.exports = { |
2 | 2 | "_screen_view.js": require('./_screen_view.js'), |
3 | 3 | "about.js": require('./about.js'), |
4 | + "audio-mp3.js": require('./audio-mp3.js'), | |
4 | 5 | "avatar-image.js": require('./avatar-image.js'), |
5 | 6 | "avatar-profile.js": require('./avatar-profile.js'), |
6 | 7 | "avatar.js": require('./avatar.js'), |
7 | 8 | "blob-url.js": require('./blob-url.js'), |
@@ -17,8 +18,11 @@ | ||
17 | 18 | "message-confirm.js": require('./message-confirm.js'), |
18 | 19 | "message-link.js": require('./message-link.js'), |
19 | 20 | "message-name.js": require('./message-name.js'), |
20 | 21 | "message.js": require('./message.js'), |
22 | + "meta-image.js": require('./meta-image.js'), | |
23 | + "music-release-cc.js": require('./music-release-cc.js'), | |
24 | + "music-release.js": require('./music-release.js'), | |
21 | 25 | "names.js": require('./names.js'), |
22 | 26 | "notifications.js": require('./notifications.js'), |
23 | 27 | "post.js": require('./post.js'), |
24 | 28 | "private.js": require('./private.js'), |
modules/audio-mp3.js | ||
---|---|---|
@@ -1,0 +1,49 @@ | ||
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 | + | |
13 | +exports.message_content = function(msg, sbot) { | |
14 | + if (msg.value.content.type !== 'audio-mp3') | |
15 | + return; | |
16 | + | |
17 | + var v = msg.value.content; | |
18 | + return h('div', | |
19 | + h('h2', "(" + v.Track + ") " + v.Title), | |
20 | + // h('img', { "src" : "http://localhost:7777/" + encodeURIComponent(v.cover) }), | |
21 | + h('audio', { | |
22 | + "controls" : true, | |
23 | + "src" : "http://localhost:7777/" + encodeURIComponent(v.link) | |
24 | + })) | |
25 | + // h('dl', | |
26 | + // Object.keys(v).map(function(k) { | |
27 | + // return [ | |
28 | + // h("dt", k), | |
29 | + // h("dd", v[k]), | |
30 | + // ] | |
31 | + // }))) | |
32 | + | |
33 | + // "Album": "the fall of", | |
34 | + // "Crc32": "038becab", | |
35 | + // "Creator": "bleupulp", | |
36 | + // "Format": "VBR MP3", | |
37 | + // "Height": "0", | |
38 | + // "Length": "375.23", | |
39 | + // "Md5": "2c517c8e813da5f940c8c7e77d4b7f3f", | |
40 | + // "Mtime": "1399498698", | |
41 | + // "Name": "2_bleupulp_-_clouds.mp3", | |
42 | + // "Sha1": "9f6a96a3d5571ed1ec2a7da38ffebdcd5f181482", | |
43 | + // "Size": "15009000", | |
44 | + | |
45 | + // "Title": "clouds", | |
46 | + // "Track": "2", | |
47 | + // "Width": "0", | |
48 | + | |
49 | +} |
modules/meta-image.js | ||
---|---|---|
@@ -1,0 +1,46 @@ | ||
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 | + | |
13 | +exports.message_content = function(msg, sbot) { | |
14 | + if (msg.value.content.type !== 'meta-image') | |
15 | + return; | |
16 | + | |
17 | + var v = msg.value.content; | |
18 | + return h('div', | |
19 | + // h('h2', "(" + v.Track + ") " + v.Title), | |
20 | + h('img', { "src" : "http://localhost:7777/" + encodeURIComponent(v.link) })) | |
21 | + | |
22 | + // h('dl', | |
23 | + // Object.keys(v).map(function(k) { | |
24 | + // return [ | |
25 | + // h("dt", k), | |
26 | + // h("dd", v[k]), | |
27 | + // ] | |
28 | + // }))) | |
29 | + | |
30 | + // "Album": "the fall of", | |
31 | + // "Crc32": "038becab", | |
32 | + // "Creator": "bleupulp", | |
33 | + // "Format": "VBR MP3", | |
34 | + // "Height": "0", | |
35 | + // "Length": "375.23", | |
36 | + // "Md5": "2c517c8e813da5f940c8c7e77d4b7f3f", | |
37 | + // "Mtime": "1399498698", | |
38 | + // "Name": "2_bleupulp_-_clouds.mp3", | |
39 | + // "Sha1": "9f6a96a3d5571ed1ec2a7da38ffebdcd5f181482", | |
40 | + // "Size": "15009000", | |
41 | + | |
42 | + // "Title": "clouds", | |
43 | + // "Track": "2", | |
44 | + // "Width": "0", | |
45 | + | |
46 | +} |
modules/music-release-cc.js | ||
---|---|---|
@@ -1,0 +1,78 @@ | ||
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 | + | |
13 | +exports.message_content = function(msg, sbot) { | |
14 | + if (msg.value.content.type !== 'music-release-cc') | |
15 | + return; | |
16 | + | |
17 | + var tracks = msg.value.content.tracks; | |
18 | + return h('div', | |
19 | + h('img', { "src" : "http://localhost:7777/" + encodeURIComponent(msg.value.content.cover) }), | |
20 | + h('h1', msg.value.content.title), | |
21 | + h('ol', | |
22 | + Object.keys(tracks).map(function(k) { | |
23 | + var t = tracks[k]; | |
24 | + return h('li', t.fname, | |
25 | + h("br"), | |
26 | + h('audio', { | |
27 | + "controls" : true, | |
28 | + "src" : "http://localhost:7777/" + encodeURIComponent(t.link) | |
29 | + })) | |
30 | + })), | |
31 | + h('p', | |
32 | + "More info:", h('a', { href : msg.value.content.archivedotorg }, "archive.org"), | |
33 | + h("br"), | |
34 | + "License:", h('a', { href : msg.value.content.license }, "Link"))) | |
35 | +} | |
36 | + | |
37 | +// copied from like.js | |
38 | + | |
39 | +// inspiration for waveform range selection | |
40 | + | |
41 | +// idea: handout invite codes for upload of tracks to be cached by the pub | |
42 | + | |
43 | +// exports.message_meta = function (msg, sbot) { | |
44 | + | |
45 | +// var yupps = h('a') | |
46 | + | |
47 | +// pull( | |
48 | +// sbot_links({dest: msg.key, rel: 'vote'}), | |
49 | +// pull.collect(function (err, votes) { | |
50 | +// if(votes.length === 1) | |
51 | +// yupps.textContent = ' 1 yup' | |
52 | +// if(votes.length) | |
53 | +// yupps.textContent = ' ' + votes.length + ' yupps' | |
54 | +// }) | |
55 | +// ) | |
56 | + | |
57 | +// return yupps | |
58 | +// } | |
59 | + | |
60 | +// exports.message_action = function (msg, sbot) { | |
61 | +// if(msg.value.content.type !== 'vote') | |
62 | +// return h('a', {href: '#', onclick: function () { | |
63 | +// var yup = { | |
64 | +// type: 'vote', | |
65 | +// vote: { link: msg.key, value: 1, expression: 'yup' } | |
66 | +// } | |
67 | +// if(msg.value.content.recps) { | |
68 | +// yup.recps = msg.value.content.recps.map(function (e) { | |
69 | +// return e && typeof e !== 'string' ? e.link : e | |
70 | +// }) | |
71 | +// yup.private = true | |
72 | +// } | |
73 | +// //TODO: actually publish... | |
74 | + | |
75 | +// message_confirm(yup) | |
76 | +// }}, 'yup') | |
77 | + | |
78 | +// } |
modules/music-release.js | ||
---|---|---|
@@ -1,0 +1,41 @@ | ||
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 | + | |
13 | +exports.message_content = function(msg, sbot) { | |
14 | + if (msg.value.content.type !== 'music-release') | |
15 | + return; | |
16 | + | |
17 | + var v = msg.value.content; | |
18 | + return h('div', | |
19 | + // h('img', { "src" : "http://localhost:7777/" + encodeURIComponent(v.cover) }), | |
20 | + h('h1', v.Title), | |
21 | + h("p", v.Description), | |
22 | + h("dl", | |
23 | + | |
24 | + h("dt", "Creator"), | |
25 | + h("dd", v.Creator), | |
26 | + | |
27 | + h("dt", "Identifier"), | |
28 | + h("dd", v.Identifier), | |
29 | + | |
30 | + h("dt", "Published"), | |
31 | + h("dd", v.Publicdate), | |
32 | + | |
33 | + h("dt", "Runtime"), | |
34 | + h("dd", v.Runtime), | |
35 | + | |
36 | + h("dt", "Source"), | |
37 | + h("dd", v.Source), | |
38 | + | |
39 | + h("dt", "License"), | |
40 | + h("dd", h('a', { href : v.Licenseurl }, "Link")))) | |
41 | +} |
package.json | ||
---|---|---|
@@ -15,8 +15,9 @@ | ||
15 | 15 | "hypertabs": "^1.2.0", |
16 | 16 | "mime-types": "^2.1.11", |
17 | 17 | "moment": "^2.13.0", |
18 | 18 | "open-external": "^0.1.1", |
19 | + "peaks.js": "^0.4.7", | |
19 | 20 | "pull-cat": "^1.1.9", |
20 | 21 | "pull-next": "0.0.0", |
21 | 22 | "pull-paramap": "^1.1.6", |
22 | 23 | "pull-reconnect": "^0.0.3", |
music-release.json | ||
---|---|---|
@@ -1,0 +1,8 @@ | ||
1 | +{ | |
2 | + "type": "music-release", | |
3 | + "title": "(miniatura070) bleupulp - the fall of", | |
4 | + "archivedotorg": "https://archive.org/details/Miniatura070Bleupulp-theFallOf", | |
5 | + "license":"https://creativecommons.org/licenses/by-nc-nd/3.0/", | |
6 | + "cover": "&2JGx5HkFts0PS84K3xwKGZZgqQ5zAf2LSuLAahBhm6I=.sha256", | |
7 | + "ipfs": "/ipfs/QmSuUXxGsF7yQNPDQEjUsAmWZZoNNmdMmZK59MsQroX3ch" | |
8 | +} |
music-tracks.json | ||
---|---|---|
@@ -1,0 +1,36 @@ | ||
1 | +{ | |
2 | + "tracks": [ | |
3 | + { | |
4 | + "root": "%FD6hYornRa2ZuaPtoTHMf5t8Vp9PHM6IYmyJfBUjIXs=.sha256", | |
5 | + "branch": "%FD6hYornRa2ZuaPtoTHMf5t8Vp9PHM6IYmyJfBUjIXs=.sha256", | |
6 | + "size": 2157326, | |
7 | + "text": "1_bleupulp_-_clouds_intro.ogg", | |
8 | + "type": "audio/ogg", | |
9 | + "link": "&A70FAlwssY77iSfqcg/NVj9LCcsoITASHwM/r+wbNU0=.sha256" | |
10 | + }, | |
11 | + { | |
12 | + "root": "%FD6hYornRa2ZuaPtoTHMf5t8Vp9PHM6IYmyJfBUjIXs=.sha256", | |
13 | + "branch": "%FD6hYornRa2ZuaPtoTHMf5t8Vp9PHM6IYmyJfBUjIXs=.sha256", | |
14 | + "size": 4646474, | |
15 | + "text": "2_bleupulp_-_clouds.ogg", | |
16 | + "type": "audio/ogg", | |
17 | + "link": "&xjkBIJa6kHFkaeCUl9P1koJEjJa7L5AZKHs6uYEmlOI=.sha256" | |
18 | + }, | |
19 | + { | |
20 | + "root": "%FD6hYornRa2ZuaPtoTHMf5t8Vp9PHM6IYmyJfBUjIXs=.sha256", | |
21 | + "branch": "%FD6hYornRa2ZuaPtoTHMf5t8Vp9PHM6IYmyJfBUjIXs=.sha256", | |
22 | + "size": 5163650, | |
23 | + "text": "3_bleupulp_-_after_the.ogg", | |
24 | + "type": "audio/ogg", | |
25 | + "link": "&4F/x0KQejrjU1ymPHq/WHtcAxh2tWVprsxAvGOPwh0Q=.sha256" | |
26 | + }, | |
27 | + { | |
28 | + "root": "%FD6hYornRa2ZuaPtoTHMf5t8Vp9PHM6IYmyJfBUjIXs=.sha256", | |
29 | + "branch": "%FD6hYornRa2ZuaPtoTHMf5t8Vp9PHM6IYmyJfBUjIXs=.sha256", | |
30 | + "size": 5105666, | |
31 | + "text": "4_bleupulp_-_hi0low.ogg", | |
32 | + "type": "audio/ogg", | |
33 | + "link": "&gCRNeGQk/V42cbn6NRmWZSmdDDWOQ5DHymVRqXCk8q8=.sha256" | |
34 | + } | |
35 | + ] | |
36 | +} |
Built with git-ssb-web