Commit be330fa3f2c5d90bbdcb9fd1ba45c550fac244a1
Render web-init and web-root messages
cel committed on 4/22/2018, 8:03:04 AMParent: 7e8e6b8627ad24b63c91aeb2917e5e08cf902305
Files changed
lib/render-msg.js | changed |
lib/render-msg.js | |||
---|---|---|---|
@@ -295,8 +295,10 @@ | |||
295 | 295 … | case 'talenet-idea-comment': | |
296 | 296 … | case 'talenet-idea-comment_reply': return this.ideaComment(cb) | |
297 | 297 … | case 'about-resource': return this.aboutResource(cb) | |
298 | 298 … | case 'line-comment': return this.lineComment(cb) | |
299 … | + case 'web-init': return this.webInit(cb) | ||
300 … | + case 'web-root': return this.webRoot(cb) | ||
299 | 301 … | default: return this.object(cb) | |
300 | 302 … | } | |
301 | 303 … | } | |
302 | 304 … | ||
@@ -1689,4 +1691,28 @@ | |||
1689 | 1691 … | self.c.text ? | |
1690 | 1692 … | h('div', {innerHTML: self.markdown()}) : ''), cb) | |
1691 | 1693 … | }) | |
1692 | 1694 … | } | |
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