User:קיפודנחש/pgnviewer demo

forward

edit

This page's purpose is to demonstrate javascript based PGN chess-game-viewer. in order to see the viewer, you should add the line

importScript('User:קיפודנחש/pgnviewer.js');

to the page Special:MyPage/common.js.

if you do not want to meddle with your common.js page and still want to see the viewer, you can watch it on hewiki (the script loads there for all users), as long as you have JS enabled on your browser. just go to he:אליפות העולם בשחמט 2013, and scroll down a bit to see the pgn viewer.

this demo contains the first 9 games of World Chess Championship 2013. use the selector above the board to switch from game to game. you can see any position in the game by clicking on the appropriate move on the right-hand-side pgn list, you can advance a step forward or backward, you can start "auto play" (surpisingly, by pressing the "Play" button), and you can rotate the board, to see the game from the black's point of view (and back again), by clicking the Yin and yang symbol.

single-move forward (either by clicking the "advance one step, aka > button, or by clicking on the next move in the PGN list on the right), and automatic game-play are animated, any other move just jumps to the corresponding position.

use the slider to change the dimensions of the board (unless you use IE - in this case, no slider for you).

it is possible to tell the viewer at which position to display each game initially. this is done by the pseudo-comment "first move". for instance, the first game is shown after move 11d. by default, the board will initially show in the final position of each game.

you can discuss the demo here.

no javascript

edit

this demo does not cover the "no javascript" case. it's possible to do so, but the straightforward way to do so requires use of pages in the "madidwiki" namespace.

to see what can be done, please visit the demo page on testwiki, where there is a use of template, with "noscript" parameter that lets the editor create different content to be viewed by readers with javascript disabled.

demo

edit

[Event "WCh 2013"] [Site "Chennai IND"] [Date "2013.11.09"] [Round "1"] [White "Carlsen, M."] [Black "Anand, V."] [Result "1/2-1/2"] [ECO "A07"] [WhiteElo "2870"] [BlackElo "2775"] [PlyCount "32"] [EventDate "2013.11.09"] [FirstMove "11d"]

1. Nf3 d5 2. g3 g6 3. Bg2 Bg7 4. d4 c6 5. O-O Nf6 6. b3 O-O 7. Bb2 Bf5 8. c4 Nbd7 9. Nc3 dxc4 10. bxc4 Nb6 11. c5 Nc4 12. Bc1 Nd5 13. Qb3 Na5 14. Qa3 Nc4 15. Qb3 Na5 16. Qa3 Nc4 1/2-1/2

[Event "WCh 2013"] [Site "Chennai IND"] [Date "2013.11.10"] [Round "2"] [White "Anand, V."] [Black "Carlsen, M."] [Result "1/2-1/2"] [ECO "B18"] [WhiteElo "2775"] [BlackElo "2870"] [PlyCount "50"] [EventDate "2013.11.09"]

1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Bf5 5. Ng3 Bg6 6. h4 h6 7. Nf3 e6 8. Ne5 Bh7 9. Bd3 Bxd3 10. Qxd3 Nd7 11. f4 Bb4+ 12. c3 Be7 13. Bd2 Ngf6 14. O-O-O O-O 15. Ne4 Nxe4 16. Qxe4 Nxe5 17. fxe5 Qd5 18. Qxd5 cxd5 19. h5 b5 20. Rh3 a5 21. Rf1 Rac8 22. Rg3 Kh7 23. Rgf3 Kg8 24. Rg3 Kh7 25. Rgf3 Kg8 1/2-1/2

[Event "WCh 2013"] [Site "Chennai IND"] [Date "2013.11.12"] [Round "3"] [White "Carlsen, M."] [Black "Anand, V."] [Result "1/2-1/2"] [ECO "A07"] [WhiteElo "2870"] [BlackElo "2775"] [PlyCount "102"] [EventDate "2013.11.09"]

1. Nf3 d5 2. g3 g6 3. c4 dxc4 4. Qa4+ Nc6 5. Bg2 Bg7 6. Nc3 e5 7. Qxc4 Nge7 8. O-O O-O 9. d3 h6 10. Bd2 Nd4 11. Nxd4 exd4 12. Ne4 c6 13. Bb4 Be6 14. Qc1 Bd5 15. a4 b6 16. Bxe7 Qxe7 17. a5 Rab8 18. Re1 Rfc8 19. axb6 axb6 20. Qf4 Rd8 21. h4 Kh7 22. Nd2 Be5 23. Qg4 h5 24. Qh3 Be6 25. Qh1 c5 26. Ne4 Kg7 27. Ng5 b5 28. e3 dxe3 29. Rxe3 Bd4 30. Re2 c4 31. Nxe6+ fxe6 32. Be4 cxd3 33. Rd2 Qb4 34. Rad1 Bxb2 35. Qf3 Bf6 36. Rxd3 Rxd3 37. Rxd3 Rd8 38. Rxd8 Bxd8 39. Bd3 Qd4 40. Bxb5 Qf6 41. Qb7+ Be7 42. Kg2 g5 43. hxg5 Qxg5 44. Bc4 h4 45. Qc7 hxg3 46. Qxg3 e5 47. Kf3 Qxg3+ 48. fxg3 Bc5 49. Ke4 Bd4 50. Kf5 Bf2 51. Kxe5 Bxg3+ 1/2-1/2

[Event "WCh 2013"] [Site "Chennai IND"] [Date "2013.11.13"] [Round "4"] [White "Anand, V."] [Black "Carlsen, M."] [Result "1/2-1/2"] [ECO "C67"] [WhiteElo "2775"] [BlackElo "2870"] [PlyCount "127"] [EventDate "2013.11.09"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Nd6 6. Bxc6 dxc6 7. dxe5 Nf5 8. Qxd8+ Kxd8 9. h3 Bd7 10. Rd1 Be7 11. Nc3 Kc8 12. Bg5 h6 13. Bxe7 Nxe7 14. Rd2 c5 15. Rad1 Be6 16. Ne1 Ng6 17. Nd3 b6 18. Ne2 Bxa2 19. b3 c4 20. Ndc1 cxb3 21. cxb3 Bb1 22. f4 Kb7 23. Nc3 Bf5 24. g4 Bc8 25. Nd3 h5 26. f5 Ne7 27. Nb5 hxg4 28. hxg4 Rh4 29. Nf2 Nc6 30. Rc2 a5 31. Rc4 g6 32. Rdc1 Bd7 33. e6 fxe6 34. fxe6 Be8 35. Ne4 Rxg4+ 36. Kf2 Rf4+ 37. Ke3 Rf8 38. Nd4 Nxd4 39. Rxc7+ Ka6 40. Kxd4 Rd8+ 41. Kc3 Rf3+ 42. Kb2 Re3 43. Rc8 Rdd3 44. Ra8+ Kb7 45. Rxe8 Rxe4 46. e7 Rg3 47. Rc3 Re2+ 48. Rc2 Ree3 49. Ka2 g5 50. Rd2 Re5 51. Rd7+ Kc6 52. Red8 Rge3 53. Rd6+ Kb7 54. R8d7+ Ka6 55. Rd5 Re2+ 56. Ka3 Re6 57. Rd8 g4 58. Rg5 Rxe7 59. Ra8+ Kb7 60. Rag8 a4 61. Rxg4 axb3 62. R8g7 Ka6 63. Rxe7 Rxe7 64. Kxb3 1/2-1/2

[Event "WCh 2013"] [Site "Chennai IND"] [Date "2013.11.15"] [Round "5"] [White "Carlsen, M."] [Black "Anand, V."] [Result "1-0"] [ECO "D31"] [WhiteElo "2870"] [BlackElo "2775"] [PlyCount "115"] [EventDate "2013.11.09"]

1. c4 e6 2. d4 d5 3. Nc3 c6 4. e4 dxe4 5. Nxe4 Bb4+ 6. Nc3 c5 7. a3 Ba5 8. Nf3 Nf6 9. Be3 Nc6 10. Qd3 cxd4 11. Nxd4 Ng4 12. O-O-O Nxe3 13. fxe3 Bc7 14. Nxc6 bxc6 15. Qxd8+ Bxd8 16. Be2 Ke7 17. Bf3 Bd7 18. Ne4 Bb6 19. c5 f5 20. cxb6 fxe4 21. b7 Rab8 22. Bxe4 Rxb7 23. Rhf1 Rb5 24. Rf4 g5 25. Rf3 h5 26. Rdf1 Be8 27. Bc2 Rc5 28. Rf6 h4 29. e4 a5 30. Kd2 Rb5 31. b3 Bh5 32. Kc3 Rc5+ 33. Kb2 Rd8 34. R1f2 Rd4 35. Rh6 Bd1 36. Bb1 Rb5 37. Kc3 c5 38. Rb2 e5 39. Rg6 a4 40. Rxg5 Rxb3+ 41. Rxb3 Bxb3 42. Rxe5+ Kd6 43. Rh5 Rd1 44. e5+ Kd5 45. Bh7 Rc1+ 46. Kb2 Rg1 47. Bg8+ Kc6 48. Rh6+ Kd7 49. Bxb3 axb3 50. Kxb3 Rxg2 51. Rxh4 Ke6 52. a4 Kxe5 53. a5 Kd6 54. Rh7 Kd5 55. a6 c4+ 56. Kc3 Ra2 57. a7 Kc5 58. h4 1-0

[Event "WCh 2013"] [Site "Chennai IND"] [Date "2013.11.16"] [Round "6"] [White "Anand, V."] [Black "Carlsen, M."] [Result "0-1"] [ECO "C65"] [WhiteElo "2775"] [BlackElo "2870"] [PlyCount "134"] [EventDate "2013.11.09"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. d3 Bc5 5. c3 O-O 6. O-O Re8 7. Re1 a6 8. Ba4 b5 9. Bb3 d6 10. Bg5 Be6 11. Nbd2 h6 12. Bh4 Bxb3 13. axb3 Nb8 14. h3 Nbd7 15. Nh2 Qe7 16. Ndf1 Bb6 17. Ne3 Qe6 18. b4 a5 19. bxa5 Bxa5 20. Nhg4 Bb6 21. Bxf6 Nxf6 22. Nxf6+ Qxf6 23. Qg4 Bxe3 24. fxe3 Qe7 25. Rf1 c5 26. Kh2 c4 27. d4 Rxa1 28. Rxa1 Qb7 29. Rd1 Qc6 30. Qf5 exd4 31. Rxd4 Re5 32. Qf3 Qc7 33. Kh1 Qe7 34. Qg4 Kh7 35. Qf4 g6 36. Kh2 Kg7 37. Qf3 Re6 38. Qg3 Rxe4 39. Qxd6 Rxe3 40. Qxe7 Rxe7 41. Rd5 Rb7 42. Rd6 f6 43. h4 Kf7 44. h5 gxh5 45. Rd5 Kg6 46. Kg3 Rb6 47. Rc5 f5 48. Kh4 Re6 49. Rxb5 Re4+ 50. Kh3 Kg5 51. Rb8 h4 52. Rg8+ Kh5 53. Rf8 Rf4 54. Rc8 Rg4 55. Rf8 Rg3+ 56. Kh2 Kg5 57. Rg8+ Kf4 58. Rc8 Ke3 59. Rxc4 f4 60. Ra4 h3 61. gxh3 Rg6 62. c4 f3 63. Ra3+ Ke2 64. b4 f2 65. Ra2+ Kf3 66. Ra3+ Kf4 67. Ra8 Rg1 0-1

[Event "WCh 2013"] [Site "Chennai IND"] [Date "2013.11.18"] [Round "7"] [White "Anand, V."] [Black "Carlsen, M."] [Result "1/2-1/2"] [ECO "C65"] [WhiteElo "2775"] [BlackElo "2870"] [PlyCount "64"] [EventDate "2013.11.09"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. d3 Bc5 5. Bxc6 dxc6 6. Nbd2 Bg4 7. h3 Bh5 8. Nf1 Nd7 9. Ng3 Bxf3 10. Qxf3 g6 11. Be3 Qe7 12. O-O-O O-O-O 13. Ne2 Rhe8 14. Kb1 b6 15. h4 Kb7 16. h5 Bxe3 17. Qxe3 Nc5 18. hxg6 hxg6 19. g3 a5 20. Rh7 Rh8 21. Rdh1 Rxh7 22. Rxh7 Qf6 23. f4 Rh8 24. Rxh8 Qxh8 25. fxe5 Qxe5 26. Qf3 f5 27. exf5 gxf5 28. c3 Ne6 29. Kc2 Ng5 30. Qf2 Ne6 31. Qf3 Ng5 32. Qf2 Ne6 1/2-1/2

[Event "WCh 2013"] [Site "Chennai IND"] [Date "2013.11.19"] [Round "8"] [White "Carlsen, M."] [Black "Anand, V."] [Result "1/2-1/2"] [ECO "C67"] [WhiteElo "2870"] [BlackElo "2775"] [PlyCount "66"] [EventDate "2013.11.09"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. Re1 Nd6 6. Nxe5 Be7 7. Bf1 Nxe5 8. Rxe5 O-O 9. d4 Bf6 10. Re1 Re8 11. c3 Rxe1 12. Qxe1 Ne8 13. Bf4 d5 14. Bd3 g6 15. Nd2 Ng7 16. Qe2 c6 17. Re1 Bf5 18. Bxf5 Nxf5 19. Nf3 Ng7 20. Be5 Ne6 21. Bxf6 Qxf6 22. Ne5 Re8 23. Ng4 Qd8 24. Qe5 Ng7 25. Qxe8+ Nxe8 26. Rxe8+ Qxe8 27. Nf6+ Kf8 28. Nxe8 Kxe8 29. f4 f5 30. Kf2 b5 31. b4 Kf7 32. h3 h6 33. h4 h5 1/2-1/2

[Event "WCh 2013"] [Site "Chennai IND"] [Date "2013.11.21"] [Round "9"] [White "Anand, V."] [Black "Carlsen, M."] [Result "0-1"] [ECO "E25"] [WhiteElo "2775"] [BlackElo "2870"] [PlyCount "56"] [EventDate "2013.11.09"]

1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. f3 d5 5. a3 Bxc3+ 6. bxc3 c5 7. cxd5 exd5 8. e3 c4 9. Ne2 Nc6 10. g4 O-O 11. Bg2 Na5 12. O-O Nb3 13. Ra2 b5 14. Ng3 a5 15. g5 Ne8 16. e4 Nxc1 17. Qxc1 Ra6 18. e5 Nc7 19. f4 b4 20. axb4 axb4 21. Rxa6 Nxa6 22. f5 b3 23. Qf4 Nc7 24. f6 g6 25. Qh4 Ne8 26. Qh6 b2 27. Rf4 b1=Q+ 28. Nf1 Qe1 0-1