From 762b7c9ca36aedb3e720b31c103be429446060d3 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Fri, 16 Nov 2018 19:41:52 +0100 Subject: [PATCH] Add initial FEN to PGN; shorten end of game window --- public/javascripts/base_rules.js | 5 +++-- public/javascripts/components/game.js | 32 ++++++++++++++------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/public/javascripts/base_rules.js b/public/javascripts/base_rules.js index 0a5c0e72..de1a0d0f 100644 --- a/public/javascripts/base_rules.js +++ b/public/javascripts/base_rules.js @@ -1012,7 +1012,7 @@ class ChessRules } // The score is already computed when calling this function - getPGN(mycolor, score) + getPGN(mycolor, score, fenStart) { let pgn = ""; pgn += '[Site "vchess.club"]
'; @@ -1020,7 +1020,8 @@ class ChessRules pgn += '[Date "' + d.getFullYear() + '-' + d.getMonth() + '-' + d.getDate() + '"]
'; pgn += '[White "' + (mycolor=='w'?'Myself':'Anonymous') + '"]
'; pgn += '[Black "' + (mycolor=='b'?'Myself':'Anonymous') + '"]
'; - pgn += '[Result "' + score + '"]
'; + pgn += '[Fen "' + fenStart + '"]
'; + pgn += '[Result "' + score + '"]

'; for (let i=0; i