git ssb

16+

cel / patchfoo



Commit 964cb82322e65c807382c6a84eba0a8e21c1c70f

Don't show comment links when we don't have the context to generate one

cel committed on 1/11/2018, 7:27:09 AM
Parent: f34f08104b9613ba5f0ac43eb229ae992116224a

Files changed

lib/serve.jschanged
lib/serve.jsView
@@ -2692,17 +2692,23 @@
26922692 pull.map(function (line) {
26932693 var lineNum = i++
26942694 var id = hash + '-' + lineNum
26952695 var idEnc = encodeURIComponent(id)
2696 + var allowComment = self.query.commit && self.query.path
26962697 return [
26972698 ph('tr', [
2699 + ph('td',
2700 + allowComment ? ph('a', {
2701 + href: '?msg=' + encodeURIComponent(self.query.msg)
2702 + + '&commit=' + encodeURIComponent(self.query.commit)
2703 + + '&path=' + encodeURIComponent(self.query.path)
2704 + + '&comment=' + idEnc
2705 + + '#' + idEnc
2706 + }, '…') : ''
2707 + ),
26982708 ph('td', ph('a', {
26992709 name: id,
2700- href: '?msg=' + encodeURIComponent(self.query.msg)
2701- + '&commit=' + encodeURIComponent(self.query.commit)
2702- + '&path=' + encodeURIComponent(self.query.path)
2703- + '&comment=' + idEnc
2704- + '#' + idEnc
2710 + href: '#' + idEnc
27052711 }, String(lineNum))),
27062712 ph('td', ph('pre', self.app.render.highlight(line, ext)))
27072713 ]),
27082714 lineComments[lineNum] ? ph('tr',

Built with git-ssb-web