diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-05-02 09:51:44 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-05-02 10:50:32 -1000 |
commit | cd96cd050a4a7f6b65f684c05b3c56915254e069 (patch) | |
tree | daf8873dcb59c8bbff35052a2cfe52d0e48647bc | |
parent | 271a1375b5d1d41739547d0349003dea91b33593 (diff) | |
download | patchfoo-cd96cd050a4a7f6b65f684c05b3c56915254e069.tar.gz patchfoo-cd96cd050a4a7f6b65f684c05b3c56915254e069.zip |
Add standalone compose page
-rw-r--r-- | lib/serve.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/serve.js b/lib/serve.js index 31a07cf..41ff025 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -236,6 +236,7 @@ Serve.prototype.path = function (url) { case '/channels': return this.channels(m[2]) case '/friends': return this.friends(m[2]) case '/live': return this.live(m[2]) + case '/compose': return this.compose(m[2]) } m = /^(\/?[^\/]*)(\/.*)?$/.exec(url) switch (m[1]) { @@ -460,6 +461,22 @@ Serve.prototype.live = function (ext) { ) } +Serve.prototype.compose = function (ext) { + var self = this + self.composer({ + channel: '', + }, function (err, composer) { + if (err) return cb(err) + pull( + pull.once(u.toHTML(composer)), + self.wrapPage('compose'), + self.respondSink(200, { + 'Content-Type': ctype(ext) + }) + ) + }) +} + Serve.prototype.peers = function (ext) { var self = this if (self.data.action === 'connect') { @@ -969,6 +986,7 @@ Serve.prototype.wrapPage = function (title, searchQ) { h('a', {href: render.toUrl('/friends')}, 'friends'), ' ', h('a', {href: render.toUrl('/advsearch')}, 'search'), ' ', h('a', {href: render.toUrl('/live')}, 'live'), ' ', + h('a', {href: render.toUrl('/compose')}, 'compose'), ' ', render.idLink(self.app.sbot.id, done()), ' ', h('input.search-input', {name: 'q', value: searchQ, placeholder: 'search'}) |