fix puzzle-ui merge
This commit is contained in:
parent
1b78f74d4c
commit
4582b7efe6
|
@ -121,11 +121,7 @@ object Puzzle extends LilaController {
|
|||
case None =>
|
||||
lila.mon.puzzle.round.anon()
|
||||
env.finisher.incPuzzleAttempts(puzzle)
|
||||
Ok(JsData(puzzle, none, "view",
|
||||
win = data.isWin.some,
|
||||
voted = none,
|
||||
animationDuration = env.AnimationDuration))
|
||||
}
|
||||
renderJson(puzzle, none, "view", win = data.isWin.some, voted = none) map { Ok(_) }
|
||||
}
|
||||
) map (_ as JSON)
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ object JsonView {
|
|||
"coords" -> pref.coords,
|
||||
"rookCastle" -> pref.rookCastle
|
||||
),
|
||||
"chessground" -> Json.obj(
|
||||
"chessground" -> (!isMobileApi).option(Json.obj(
|
||||
"highlight" -> Json.obj(
|
||||
"lastMove" -> pref.highlight,
|
||||
"check" -> pref.highlight
|
||||
|
@ -54,7 +54,7 @@ object JsonView {
|
|||
"premovable" -> Json.obj(
|
||||
"showDests" -> pref.destination
|
||||
)
|
||||
),
|
||||
)),
|
||||
"animation" -> Json.obj(
|
||||
"duration" -> pref.animationFactor * animationDuration.toMillis
|
||||
),
|
||||
|
@ -65,6 +65,13 @@ object JsonView {
|
|||
"win" -> a.win
|
||||
)
|
||||
},
|
||||
"attempt" -> round.ifTrue(isMobileApi).map { r =>
|
||||
Json.obj(
|
||||
"userRatingDiff" -> r.ratingDiff,
|
||||
"win" -> r.win,
|
||||
"seconds" -> "a few" // lol we don't have the value anymore
|
||||
)
|
||||
},
|
||||
"win" -> win,
|
||||
"voted" -> voted,
|
||||
"user" -> userInfos.map { i =>
|
||||
|
|
|
@ -355,6 +355,7 @@ lichess.notifyApp = (function() {
|
|||
else if (lichess.analyse) startAnalyse(document.getElementById('lichess'), lichess.analyse);
|
||||
else if (lichess.user_analysis) startUserAnalysis(document.getElementById('lichess'), lichess.user_analysis);
|
||||
else if (lichess.study) startStudy(document.getElementById('lichess'), lichess.study);
|
||||
else if (lichess.puzzle) startPuzzle(lichess.puzzle);
|
||||
else if (lichess.tournament) startTournament(document.getElementById('tournament'), lichess.tournament);
|
||||
else if (lichess.simul) startSimul(document.getElementById('simul'), lichess.simul);
|
||||
|
||||
|
|
Loading…
Reference in a new issue