pull/1220/head
Thibault Duplessis 2015-11-10 17:40:52 +07:00
parent 0a08c07277
commit c4fd6fb1d6
2 changed files with 19 additions and 2 deletions

View File

@ -13,7 +13,7 @@ final class DataForm {
val clockTimes: Seq[Double] = Seq(1 / 2d, 3 / 4d, 3 / 2d) ++ (0d to 7d by 1d)
val clockTimesPrivate: Seq[Double] = clockTimes ++ (10d to 30d by 5d) ++ (40d to 60d by 10d)
val clockTimeDefault = 2d
private def formatLimit(l: Double) =
private def formatLimit(l: Double) =
chess.Clock.showLimit(l * 60 toInt) + {
if (l <= 1) " minute" else " minutes"
}

View File

@ -5,6 +5,23 @@ var now;
var startTime;
var stopTime;
function displayClockLimit(limit) {
switch (limit) {
case 30:
return '½';
case 45:
return '¾';
case 90:
return '1.5';
default:
return limit / 60;
}
}
function displayClock(clock) {
return displayClockLimit(clock.limit) + "+" + clock.increment;
}
function leftPos(time) {
return scale * (time - startTime) / 1000 / 60;
}
@ -112,7 +129,7 @@ function renderTournament(ctrl, tour) {
title: tour.perf.name
} : null),
m('span.name', tour.fullName),
m('span.clock', tour.clock.limit / 60 + "+" + tour.clock.increment),
m('span.clock', displayClock(tour.clock)),
tour.variant.key === 'standard' ? null : m('span.variant', tour.variant.name),
tour.position ? m('span', 'Thematic') : null,
m('span', tour.rated ? ctrl.trans('rated') : ctrl.trans('casual')),