From be9a1da05281cc6c1c3569d2822ba8ff6e611c7b Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 4 Feb 2019 00:02:39 -1000 Subject: Show addresses more compactly Handle missing port --- lib/render-msg.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/render-msg.js') diff --git a/lib/render-msg.js b/lib/render-msg.js index 357edbe..09c9e13 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -757,6 +757,8 @@ RenderMsg.prototype.pub = function (cb) { RenderMsg.prototype.address = function (cb) { var availability = this.c.availability * 100 + var addr = u.extractHostPort(this.value.author, String(this.c.address)) + addr = this.app.removeDefaultPort(addr) this.wrapMini([ 'has address', !isNaN(availability) ? [ @@ -764,7 +766,7 @@ RenderMsg.prototype.address = function (cb) { h('code', availability + '%') ] : '', ': ', - h('input', {disabled: 'disabled', value: String(this.c.address), style: 'width:100%'}), + h('input', {disabled: 'disabled', value: addr, style: 'width:100%; font:monospace'}), ], cb) } @@ -779,12 +781,14 @@ RenderMsg.prototype.pubOwnerAnnounce = function (cb) { RenderMsg.prototype.pubOwnerConfirm = function (cb) { var self = this var announcement = this.c.announcement + var addr = u.extractHostPort(this.value.author, String(this.c.address)) + addr = this.app.removeDefaultPort(addr) this.wrap([ 'confirms pub ownership announcement ', h('a', {href: this.toUrl(announcement)}, u.truncate(announcement, 10)), this.c.address ? [ '. address: ', - h('input', {disabled: 'disabled', value: String(this.c.address), style: 'width:100%'}) + h('input', {disabled: 'disabled', value: addr, style: 'width:100%; font:monospace'}) ] : '' ], cb) } -- cgit v1.2.3