From be330fa3f2c5d90bbdcb9fd1ba45c550fac244a1 Mon Sep 17 00:00:00 2001 From: cel Date: Sat, 21 Apr 2018 22:03:04 -1000 Subject: Render web-init and web-root messages --- lib/render-msg.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/render-msg.js b/lib/render-msg.js index 684ea40..4db7429 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -296,6 +296,8 @@ RenderMsg.prototype.message = function (cb) { case 'talenet-idea-comment_reply': return this.ideaComment(cb) case 'about-resource': return this.aboutResource(cb) case 'line-comment': return this.lineComment(cb) + case 'web-init': return this.webInit(cb) + case 'web-root': return this.webRoot(cb) default: return this.object(cb) } } @@ -1690,3 +1692,27 @@ RenderMsg.prototype.lineComment = function (cb) { h('div', {innerHTML: self.markdown()}) : ''), cb) }) } + +RenderMsg.prototype.webInit = function (cb) { + var self = this + var url = '/web/' + encodeURIComponent(this.msg.key) + self.wrapMini(h('a', + {href: this.toUrl(url)}, + 'website' + ), cb) +} + +RenderMsg.prototype.webRoot = function (cb) { + var self = this + var site = u.isRef(this.c.site) && this.c.site + var root = u.isRef(this.c.root) && this.c.root + self.wrapMini(h('span', + 'updated website ', + site ? [ + h('a', {href: this.toUrl('/web/' + encodeURIComponent(site))}, site.substr(0, 8) + '…'), ' ' + ] : '', + root ? [ + 'to ', h('a', {href: this.toUrl(root)}, root.substr(0, 8) + '…') + ] : '' + ), cb) +} -- cgit v1.2.3