Merge branch 'master' into clarkeyUI

* master:
  fix puzzle 3D pieces
  restore mouse wheel on analysis
  fix game count
This commit is contained in:
Thibault Duplessis 2014-11-27 16:37:28 +01:00
commit 8a54cbdcf0
3 changed files with 17 additions and 6 deletions

View file

@ -214,7 +214,7 @@ object GameRepo {
def nbPerDay(days: Int): Fu[List[Int]] =
((days to 1 by -1).toList map { day =>
val from = DateTime.now.withTimeAtStartOfDay minusDays 1
val from = DateTime.now.withTimeAtStartOfDay minusDays day
val to = from plusDays 1
$count(Json.obj(F.createdAt -> ($gte($date(from)) ++ $lt($date(to)))))
}).sequenceFu

View file

@ -126,10 +126,6 @@
opacity: 0.5;
text-shadow: none !important;
}
#puzzle div.cg-board {
width: 512px;
height: 512px;
}
#puzzle div.upvote {
float: right;
text-align: center;

View file

@ -227,9 +227,24 @@ function renderAnalyse(ctrl) {
tree);
}
function wheel(ctrl, e) {
if (e.deltaY > 0) control.next(ctrl);
else if (e.deltaY < 0) control.prev(ctrl);
m.redraw();
e.preventDefault();
return false;
}
function visualBoard(ctrl) {
return m('div.lichess_board_wrap',
m('div.lichess_board.' + ctrl.data.game.variant.key, chessground.view(ctrl.chessground)));
m('div.lichess_board.' + ctrl.data.game.variant.key, {
config: function(el, isUpdate) {
if (!isUpdate) el.addEventListener('wheel', function(e) {
return wheel(ctrl, e);
});
}
},
chessground.view(ctrl.chessground)));
}
function blindBoard(ctrl) {