Commit 31301646eb23b3edcc23cb3cb8980ed451b0c108
Render chess invite/accept messages more compactly
cel committed on 8/9/2018, 10:03:07 PMParent: e9c8e944c7d46091a5b7e1480deb8951137f629c
Files changed
lib/render-msg.js | changed |
lib/render-msg.js | ||
---|---|---|
@@ -1321,9 +1321,9 @@ | ||
1321 | 1321 … | var self = this |
1322 | 1322 … | var myColor = self.c.myColor |
1323 | 1323 … | self.link(self.c.inviting, function (err, link) { |
1324 | 1324 … | if (err) return cb(err) |
1325 | - self.wrap([ | |
1325 … | + self.wrapMini([ | |
1326 | 1326 … | 'invites ', link, ' to play chess', |
1327 | 1327 … | // myColor ? h('p', 'my color is ' + myColor) : '' |
1328 | 1328 … | ], cb) |
1329 | 1329 … | }) |
@@ -1343,14 +1343,18 @@ | ||
1343 | 1343 … | } |
1344 | 1344 … | |
1345 | 1345 … | RenderMsg.prototype.chessInviteAccept = function (cb) { |
1346 | 1346 … | var self = this |
1347 | - self.link(self.c.root, function (err, rootLink) { | |
1347 … | + self.getMsg(self.c.root, function (err, rootMsg) { | |
1348 | 1348 … | if (err) return cb(err) |
1349 | - self.wrap([ | |
1350 | - h('div', h('small', '> ', rootLink)), | |
1351 | - h('p', 'accepts invitation to play chess') | |
1352 | - ], cb) | |
1349 … | + self.link(rootMsg.value.author, function (err, rootAuthorLink) { | |
1350 … | + if (err) return cb(err) | |
1351 … | + self.wrapMini([ | |
1352 … | + 'accepts ', | |
1353 … | + h('a', {href: self.toUrl(rootMsg.key)}, 'invitation to play chess'), ' ', | |
1354 … | + 'with ', rootAuthorLink | |
1355 … | + ], cb) | |
1356 … | + }) | |
1353 | 1357 … | }) |
1354 | 1358 … | } |
1355 | 1359 … | |
1356 | 1360 … | RenderMsg.prototype.chessGameEnd = function (cb) { |
Built with git-ssb-web