git ssb

16+

cel / patchfoo



Commit be330fa3f2c5d90bbdcb9fd1ba45c550fac244a1

Render web-init and web-root messages

cel committed on 4/22/2018, 8:03:04 AM
Parent: 7e8e6b8627ad24b63c91aeb2917e5e08cf902305

Files changed

lib/render-msg.jschanged
lib/render-msg.jsView
@@ -295,8 +295,10 @@
295295 case 'talenet-idea-comment':
296296 case 'talenet-idea-comment_reply': return this.ideaComment(cb)
297297 case 'about-resource': return this.aboutResource(cb)
298298 case 'line-comment': return this.lineComment(cb)
299 + case 'web-init': return this.webInit(cb)
300 + case 'web-root': return this.webRoot(cb)
299301 default: return this.object(cb)
300302 }
301303 }
302304
@@ -1689,4 +1691,28 @@
16891691 self.c.text ?
16901692 h('div', {innerHTML: self.markdown()}) : ''), cb)
16911693 })
16921694 }
1695 +
1696 +RenderMsg.prototype.webInit = function (cb) {
1697 + var self = this
1698 + var url = '/web/' + encodeURIComponent(this.msg.key)
1699 + self.wrapMini(h('a',
1700 + {href: this.toUrl(url)},
1701 + 'website'
1702 + ), cb)
1703 +}
1704 +
1705 +RenderMsg.prototype.webRoot = function (cb) {
1706 + var self = this
1707 + var site = u.isRef(this.c.site) && this.c.site
1708 + var root = u.isRef(this.c.root) && this.c.root
1709 + self.wrapMini(h('span',
1710 + 'updated website ',
1711 + site ? [
1712 + h('a', {href: this.toUrl('/web/' + encodeURIComponent(site))}, site.substr(0, 8) + '…'), ' '
1713 + ] : '',
1714 + root ? [
1715 + 'to ', h('a', {href: this.toUrl(root)}, root.substr(0, 8) + '…')
1716 + ] : ''
1717 + ), cb)
1718 +}

Built with git-ssb-web