]> git.sesse.net Git - remoteglot-book/blobdiff - www/js/book.js
Mark moves that arise only due to transpositions in blue.
[remoteglot-book] / www / js / book.js
index 6017fd9d0d5eb6a91a1238089c080a7af460c819..36a9a26183b90c3797cd6ed982022653eb14a377 100644 (file)
@@ -66,13 +66,8 @@ var update = function() {
 var fetch_analysis = function() {
        var game = get_game();
        var fen = game.fen();
-       var prevfen = "";
-       if (move_override > 0) {
-               prevfen = get_game(true).fen();
-       }
        $.ajax({
                url: "/opening-stats.pl?fen=" + encodeURIComponent(fen) +
-                       ";prevfen=" + encodeURIComponent(prevfen) +
                        ";includetransp=" + (includetransp ? 1 : 0)
        }).done(function(data, textstatus, xhr) {
                show_lines(data, game);
@@ -162,6 +157,7 @@ var show_lines = function(data, game) {
        }
 
        var lines = [];
+       var transpose_only = [];
        for (var i = 0; i < moves.length; ++i) {
                var move = moves[i];
                var line = [];
@@ -171,6 +167,7 @@ var show_lines = function(data, game) {
                var black = parseInt(move['black']);
 
                line.push(move['move']);  // Move.
+               transpose_only.push(move['transpose_only']);
                var num = white + draw + black;
                line.push(num);  // N.
                line.push(num / total_num);  // %.
@@ -219,6 +216,8 @@ var show_lines = function(data, game) {
 
                if (line[0] === undefined) {
                        $(tr).addClass("totals");
+               } else if (transpose_only[i]) {
+                       $(tr).addClass("transponly");
                }
 
                for (var j = 0; j < line.length; ++j) {