git ssb

16+

Dominic / patchbay



Tree: 9d629c55b19f5dc728643731fffb36dac23c0eca

Files: 9d629c55b19f5dc728643731fffb36dac23c0eca / modules / like.js

736 bytesRaw
1
2var h = require('hyperscript')
3var u = require('../util')
4
5exports.message_link = []
6
7exports.message_content = function (msg, sbot) {
8 if(msg.value.content.type !== 'vote') return
9 var link = msg.value.content.vote.link
10 return h('div', msg.value.content.vote.value > 0 ? 'yup' : 'nah',
11 u.decorate(exports.message_link, link, function (d, e, v) { return d(e, v, sbot) })
12 )
13}
14
15exports.message_action = function (msg, sbot) {
16 if(msg.value.content.type !== 'vote')
17 return h('a', {href: '#', onclick: function () {
18 var yup = {
19 type: 'vote',
20 vote: { link: msg.key, value: 1, expression: 'yup' }
21 }
22 //TODO: actually publish...
23
24 alert(JSON.stringify(yup, null, 2))
25 }}, 'yup')
26
27}
28

Built with git-ssb-web