From ebe6b4c381e0ff7ae283f5abeadb2c6b5c2685fc Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 9 Jan 2018 20:51:33 -1000 Subject: whitespace --- lib/serve.js | 172 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 86 insertions(+), 86 deletions(-) (limited to 'lib') diff --git a/lib/serve.js b/lib/serve.js index 7df2da9..2fa6c6d 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -81,7 +81,7 @@ Serve.prototype.go = function () { if (auth) { var a = auth.split(' ') if (a[0] == 'Basic') { - tok = Buffer.from(a[1],'base64').toString('ascii') + tok = Buffer.from(a[1],'base64').toString('ascii') } } if (tok != authtok) { @@ -542,7 +542,7 @@ Serve.prototype.advsearch = function (ext) { ph('td', ['#', ph('input', {name: 'channel', placeholder: 'channel', class: 'id-input', value: q.channel || ''}) - ]) + ]) ]), ph('tr', [ ph('td', {colspan: 2}, [ @@ -555,8 +555,8 @@ Serve.prototype.advsearch = function (ext) { hasQuery && pull( self.app.advancedSearch(q), self.renderThread({ - feed: q.source, - }), + feed: q.source, + }), self.wrapMessages() ) ]), @@ -582,7 +582,7 @@ Serve.prototype.live = function (ext) { self.app.sbot.createLogStream(opts), self.app.render.renderFeeds({ withGt: true, - filter: q.filter, + filter: q.filter, }), pull.map(u.toHTML) )), @@ -1028,7 +1028,7 @@ Serve.prototype.streamThreadWithComposer = function (opts) { key: id, value: {content: false}} if (err) return cb(new Error(err.stack)) if (!rootMsg) { - console.log('id', id, 'opts', opts) + console.log('id', id, 'opts', opts) } var rootContent = rootMsg && rootMsg.value && rootMsg.value.content var recps = rootContent && rootContent.recps @@ -1053,7 +1053,7 @@ Serve.prototype.streamThreadWithComposer = function (opts) { }) ) function gotLinks(err, links) { - if (err) return cb(new Error(err.stack)) + if (err) return cb(new Error(err.stack)) cb(null, pull( pull.values(sort(links)), self.renderThread({ @@ -1319,7 +1319,7 @@ Serve.prototype.renderThreadPaginated = function (opts, feedId, q) { function onFirst(msg, cb) { var num = feedId ? msg.value.sequence : opts.sortByTimestamp ? msg.value.timestamp : - msg.timestamp || msg.ts + msg.timestamp || msg.ts if (q.forwards) { cb(null, links({ lt: num, @@ -1347,7 +1347,7 @@ Serve.prototype.renderThreadPaginated = function (opts, feedId, q) { function onLast(msg, cb) { var num = feedId ? msg.value.sequence : opts.sortByTimestamp ? msg.value.timestamp : - msg.timestamp || msg.ts + msg.timestamp || msg.ts if (q.forwards) { cb(null, links({ lt: null, @@ -1590,8 +1590,8 @@ Serve.prototype.friendInfo = function (id, myId) { this.app.render.friendsList(), pull.map(function (html) { if (!first) { - first = true - return 'followed by your friends: ' + html + first = true + return 'followed by your friends: ' + html } return html }) @@ -1643,15 +1643,15 @@ Serve.prototype.wrapUserFeed = function (isScrolled, id) { ) ]), isScrolled || id === myId ? '' : [ - ph('tr', [ - ph('td'), - ph('td', {class: 'follow-info'}, self.followInfo(id, myId)) - ]), - ph('tr', [ - ph('td'), - ph('td', self.friendInfo(id, myId)) - ]) - ] + ph('tr', [ + ph('td'), + ph('td', {class: 'follow-info'}, self.followInfo(id, myId)) + ]), + ph('tr', [ + ph('td'), + ph('td', self.friendInfo(id, myId)) + ]) + ] ])), thread ]) @@ -1973,11 +1973,11 @@ Serve.prototype.gitTree = function (rev) { ), ]) }), - Catch(function (err) { - if (err && err.name === 'ObjectNotFoundError') return - if (err && err.name === 'BlobNotFoundError') return self.askWantBlobsForm(err.links) - return false - }) + Catch(function (err) { + if (err && err.name === 'ObjectNotFoundError') return + if (err && err.name === 'BlobNotFoundError') return self.askWantBlobsForm(err.links) + return false + }) ) ]), ]), @@ -2034,7 +2034,7 @@ Serve.prototype.gitBlob = function (rev) { missingBlobs ? self.askWantBlobsForm(missingBlobs) : pull( self.app.git.readObject(obj), self.wrapBinary({ - obj: obj, + obj: obj, rawUrl: self.app.render.toUrl('/git/raw/' + rev + '?msg=' + encodeURIComponent(msg.key)), ext: self.query.ext @@ -2671,57 +2671,57 @@ Serve.prototype.wrapBinary = function (opts) { var lineComments = opts.lineComments || {} return u.readNext(function (cb) { if (commitId && filePath) { - self.app.getLineComments({ - obj: opts.obj, - hash: hash, - }, gotLineComments) + self.app.getLineComments({ + obj: opts.obj, + hash: hash, + }, gotLineComments) } else { - gotLineComments(null, {}) + gotLineComments(null, {}) } function gotLineComments(err, lineComments) { - if (err) return cb(err) - cb(null, ph('table', - pull( - read, - utf8(), - split(), - pull.map(function (line) { - var lineNum = i++ - var id = hash + '-' + lineNum - var idEnc = encodeURIComponent(id) - return [ - ph('tr', [ - ph('td', ph('a', { - name: id, - href: '?msg=' + encodeURIComponent(self.query.msg) - + '&commit=' + encodeURIComponent(self.query.commit) - + '&path=' + encodeURIComponent(self.query.path) - + '&comment=' + idEnc - + '#' + idEnc - }, String(lineNum))), - ph('td', ph('pre', self.app.render.highlight(line, ext))) - ]), - lineComments[lineNum] ? ph('tr', - ph('td', {colspan: 4}, - self.renderLineCommentThread(lineComments[lineNum], id) - ) - ) : '', - self.query.comment === id ? ph('tr', - ph('td', {colspan: 4}, - self.renderLineCommentForm({ - id: id, - line: lineNum, - updateId: updateMsg.key, - repoId: updateMsg.value.content.repo, - commitId: commitId, - filePath: filePath, - }) - ) - ) : '' - ] - }) - ) - )) + if (err) return cb(err) + cb(null, ph('table', + pull( + read, + utf8(), + split(), + pull.map(function (line) { + var lineNum = i++ + var id = hash + '-' + lineNum + var idEnc = encodeURIComponent(id) + return [ + ph('tr', [ + ph('td', ph('a', { + name: id, + href: '?msg=' + encodeURIComponent(self.query.msg) + + '&commit=' + encodeURIComponent(self.query.commit) + + '&path=' + encodeURIComponent(self.query.path) + + '&comment=' + idEnc + + '#' + idEnc + }, String(lineNum))), + ph('td', ph('pre', self.app.render.highlight(line, ext))) + ]), + lineComments[lineNum] ? ph('tr', + ph('td', {colspan: 4}, + self.renderLineCommentThread(lineComments[lineNum], id) + ) + ) : '', + self.query.comment === id ? ph('tr', + ph('td', {colspan: 4}, + self.renderLineCommentForm({ + id: id, + line: lineNum, + updateId: updateMsg.key, + repoId: updateMsg.value.content.repo, + commitId: commitId, + filePath: filePath, + }) + ) + ) : '' + ] + }) + ) + )) } }) } @@ -3215,15 +3215,15 @@ Serve.prototype.composer = function (opts, cb) { }) var draftMsg = { - key: '%0000000000000000000000000000000000000000000=.sha256', - value: { - previous: '%0000000000000000000000000000000000000000000=.sha256', - author: '@0000000000000000000000000000000000000000000=.ed25519', - sequence: 1000, - timestamp: 1000000000000, - hash: 'sha256', - content: content - } + key: '%0000000000000000000000000000000000000000000=.sha256', + value: { + previous: '%0000000000000000000000000000000000000000000=.sha256', + author: '@0000000000000000000000000000000000000000000=.ed25519', + sequence: 1000, + timestamp: 1000000000000, + hash: 'sha256', + content: content + } } var estSize = JSON.stringify(draftMsg, null, 2).length sizeEl.innerHTML = self.app.render.formatSize(estSize) @@ -3238,9 +3238,9 @@ Serve.prototype.composer = function (opts, cb) { pull.once(msg), self.app.unboxMessages(), self.app.render.renderFeeds({ - raw: raw, - filter: self.query.filter, - }), + raw: raw, + filter: self.query.filter, + }), pull.drain(function (el) { msgContainer.appendChild(h('tbody', el)) }, cb) -- cgit v1.2.3