bmarini / jchess

A jQuery-based javascript library for parsing and displaying chess games.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add some key features

bendathierrycom opened this issue · comments

Hello,

Maybe it could be great if your plugin will have some standard features of other pgn players:

  • variants support
  • button binding to start of the game
  • button binding to end of the game

For variant support, you could do as you want.
For start/end buttons binding, maybe adding some logic when you parse the pgn data to extract fen end chessboard position and store it.

Going through something like below works but is not really efficient:
[code]
$('.end', container).click(function() {
while(chess.game.halfmove_number < chess.game.transitions.length) {
chess.transitionForward();
}
$('.annot', container).text( chess.annotation() );
return false;
});
[/code]