diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-04-21 22:03:04 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-04-21 22:03:04 -1000 |
commit | be330fa3f2c5d90bbdcb9fd1ba45c550fac244a1 (patch) | |
tree | 98901454e0816dd8ca482fea9563ca28401191dd /lib/render-msg.js | |
parent | 7e8e6b8627ad24b63c91aeb2917e5e08cf902305 (diff) | |
download | patchfoo-be330fa3f2c5d90bbdcb9fd1ba45c550fac244a1.tar.gz patchfoo-be330fa3f2c5d90bbdcb9fd1ba45c550fac244a1.zip |
Render web-init and web-root messages
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r-- | lib/render-msg.js | 26 |
1 files changed, 26 insertions, 0 deletions
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) +} |