]> git.sesse.net Git - remoteglot-book/commitdiff
Add support for flipping the board.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 25 Dec 2014 00:55:10 +0000 (01:55 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 25 Dec 2014 00:55:10 +0000 (01:55 +0100)
www/book.html
www/js/book.js

index 50fd70ef6a85e104bd4d8105204a2941007d4995..baaa40d724718956fa4de138c1d1062bd8c95420 100644 (file)
@@ -26,6 +26,9 @@
     <label>
       <input type="checkbox" name="includetransp" checked="checked" onclick="javascript:set_includetransp(this.checked)" />Include transpositions
     </label>
+    <label>
+      <input type="checkbox" name="flipboard" onclick="javascript:set_flipboard(this.checked)" />Flip board
+    </label>
   </p>
   <table>
     <thead>
index 7a4d7ee5e6dd6d25c26e77282aab1fc537100349..8785a3454cbb385079b99ee7b0577ee2c50c5d3a 100644 (file)
@@ -281,6 +281,11 @@ var set_includetransp = function(value) {
 }
 window['set_includetransp'] = set_includetransp;
 
+var set_flipboard = function(value) {
+       board.orientation(value ? 'black' : 'white');
+}
+window['set_flipboard'] = set_flipboard;
+
 var make_move = function(move, do_update) {
        var history = game.history({ verbose: true });
        if (move_override < history.length && history[move_override].san == move) {