diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-02-18 21:01:53 -0500 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-02-18 21:01:53 -0500 |
commit | dba6b897c1d2a7f45b594f74ee428671fc238476 (patch) | |
tree | d7cac6c23a07e6568b0777007a4836aabb63f982 | |
parent | 28640bc30ba97693a6b955999e942e2d2b2aed83 (diff) | |
download | patchfoo-dba6b897c1d2a7f45b594f74ee428671fc238476.tar.gz patchfoo-dba6b897c1d2a7f45b594f74ee428671fc238476.zip |
Make channel editable
-rw-r--r-- | lib/serve.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/serve.js b/lib/serve.js index e1770a3..5836965 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -659,7 +659,9 @@ Serve.prototype.wrapUserFeed = function (id) { Serve.prototype.wrapPublic = function (opts) { var self = this return u.hyperwrap(function (thread, cb) { - self.composer(null, function (err, composer) { + self.composer({ + channel: '', + }, function (err, composer) { if (err) return cb(err) cb(null, [ composer, @@ -694,7 +696,7 @@ Serve.prototype.wrapThread = function (opts) { placeholder: recps ? 'private reply' : 'reply', id: 'reply', root: opts.root, - channel: opts.channel, + channel: opts.channel || '', branches: opts.branches, recps: recps, }, function (err, composer) { @@ -770,7 +772,11 @@ Serve.prototype.composer = function (opts, cb) { done()(null, h('section.composer', h('form', {method: 'post', action: opts.id ? '#' + opts.id : ''}, opts.recps ? self.app.render.privateLine(opts.recps, done()) : - opts.private ? h('div', h('input.recps-input', {name: 'recps', value: data.recps || '', placeholder: 'recipient ids'})) : '', + opts.private ? h('div', h('input.recps-input', {name: 'recps', + value: data.recps || '', placeholder: 'recipient ids'})) : '', + data.channel || opts.channel != null ? + h('div', '#', h('input', {name: 'channel', placeholder: 'channel', + value: data.channel || opts.channel || ''})) : '', h('textarea', { id: opts.id, name: 'text', @@ -812,7 +818,7 @@ Serve.prototype.composer = function (opts, cb) { } if (opts.root) content.root = opts.root if (opts.branches) content.branch = u.fromArray(opts.branches) - if (opts.channel) content.channel = opts.channel + if (data.channel) content.channel = data.channel } var msg = { value: { |