git ssb

1+

punkmonk.termux / mvd



forked from ev / mvd

Commit b4dcc5f5904a961ea312507708fc3358f9552dad

add chat buttons to scat messages on non-backchannel pages

Ev Bogue committed on 6/27/2018, 5:15:55 PM
Parent: d3edb71981df71ff6644088ad6b9a4fac8579848

Files changed

index.jschanged
render.jschanged
index.jsView
@@ -33,9 +33,8 @@
3333 h('li', h('a', {href: '#' }, 'All')),
3434 h('li', h('a', {href: '#private' }, 'Private')),
3535 h('li', h('a', {href: '#mentions' }, 'Mentions')),
3636 h('li', h('a', {href: '#key' }, 'Key')),
37- h('li', h('a', {href: '#backchannel' }, 'Chat')),
3837 h('li.right', h('a', {href: '#about'}, '?'))
3938 )
4039 )
4140
render.jsView
@@ -9,8 +9,12 @@
99 var config = require('./config')()
1010 var id = require('./keys').id
1111 var avatar = require('./avatar')
1212
13+function hash () {
14+ return window.location.hash.substring(1)
15+}
16+
1317 module.exports = function (msg) {
1418 var message = h('div.message#' + msg.key.substring(0, 44))
1519
1620 if (!localStorage[msg.value.author])
@@ -23,8 +27,12 @@
2327 message.appendChild(tools.mini(msg, muted))
2428 return message
2529 }
2630 else if (msg.value.content.type == 'scat_message') {
31+ var src = hash()
32+ if (src != 'backchannel') {
33+ message.appendChild(h('button.btn.right', h('a', {href: '#backchannel'}, 'Chat')))
34+ }
2735 message.appendChild(tools.mini(msg, ' ' + msg.value.content.text))
2836 return message
2937 }
3038 else if (msg.value.content.type == 'contact') {

Built with git-ssb-web