fix variant icons

This commit is contained in:
Thibault Duplessis 2015-01-19 15:33:07 +01:00
parent 8afe57d54a
commit 9590d81720
4 changed files with 16 additions and 6 deletions

View file

@ -14,11 +14,6 @@ data: @Html(play.api.libs.json.Json.stringify(data)),
routes: roundRoutes.controllers,
i18n: @jsI18n()
};
lichess.variantIcons = {
@lila.rating.PerfType.variants.map { variant =>
@variant.key: @Html(s""""${variant.iconChar.toString}""""),
}
};
}
}

View file

@ -1,6 +1,7 @@
module.exports = {
game: require('./game'),
status: require('./status'),
perf: require('./perf'),
view: {
status: require('./view/status'),
user: require('./view/user'),

13
ui/game/src/perf.js Normal file
View file

@ -0,0 +1,13 @@
module.exports = {
icons: {
bullet: "T",
blitz: ")",
classical: "+",
correspondence: ";",
chess960: "'",
kingOfTheHill: "(",
threeCheck: ".",
antichess: "@",
atomic: ">"
}
};

View file

@ -1,4 +1,5 @@
var game = require('game').game;
var perf = require('game').perf;
var chessground = require('chessground');
var renderTable = require('./table');
var renderPromotion = require('../promotion').view;
@ -36,7 +37,7 @@ function wheel(ctrl, e) {
function renderVariantReminder(ctrl) {
if (ctrl.data.game.speed !== 'correspondence') return;
var icon = lichess.variantIcons[ctrl.data.game.perf];
var icon = perf.icons[ctrl.data.game.perf];
if (!icon) return;
return m('div', {
class: 'variant_reminder is',