tools.jsView |
---|
232 | 232 | var vote = { |
233 | 233 | type: 'vote', |
234 | 234 | vote: { link: msg.key, expression: 'Star' } |
235 | 235 | } |
| 236 | + console.log(msg) |
| 237 | + if (msg.value.content.recps) { |
| 238 | + vote.recps = msg.value.content.recps |
| 239 | + } |
236 | 240 | |
237 | 241 | var star = h('button.btn.right', 'Star ', |
238 | 242 | h('img.emoji', {src: config.emojiUrl + 'star.png'}), { |
239 | 243 | onclick: function () { |
240 | 244 | vote.vote.value = 1 |
| 245 | + if (vote.recps) { |
| 246 | + vote = exports.box(vote) |
| 247 | + } |
241 | 248 | sbot.publish(vote, function (err, voted) { |
242 | 249 | if(err) throw err |
243 | 250 | }) |
244 | 251 | } |
323 | 330 | } |
324 | 331 | |
325 | 332 | |
326 | 333 | module.exports.mini = function (msg, content) { |
327 | | - return h('div.mini', |
| 334 | + var mini = h('div.mini') |
| 335 | + |
| 336 | + mini.appendChild( |
328 | 337 | h('span.avatar', |
329 | 338 | h('a', {href: '#' + msg.value.author}, |
330 | 339 | h('span.avatar--small', avatar.image(msg.value.author)), |
331 | 340 | avatar.name(msg.value.author) |
332 | 341 | ) |
333 | | - ), |
334 | | - exports.timestamp(msg), |
335 | | - content |
| 342 | + ) |
336 | 343 | ) |
| 344 | + var lock = h('span.right', h('img.emoji', {src: config.emojiUrl + 'lock.png'})) |
| 345 | + |
| 346 | + |
| 347 | + mini.appendChild(content) |
| 348 | + mini.appendChild(exports.timestamp(msg)) |
| 349 | + |
| 350 | + if (msg.value.content.recps) { |
| 351 | + mini.appendChild(lock) |
| 352 | + } |
| 353 | + |
| 354 | + if (typeof msg.value.content === 'string') { |
| 355 | + mini.appendChild(lock) |
| 356 | + } |
| 357 | + |
| 358 | + return mini |
337 | 359 | } |
338 | 360 | |
339 | 361 | |
340 | 362 | module.exports.header = function (msg) { |