]> git.sesse.net Git - remoteglot/blobdiff - www/js/remoteglot.js
Yet more small docstring updates.
[remoteglot] / www / js / remoteglot.js
index 6819cb99eea1c64812ab258bbe9c97a1d5d48644..0cca9fa3dbc1e58ee15718dc87f5f4b80ac2ccf1 100644 (file)
@@ -123,7 +123,13 @@ var fen = null;
  * }} DisplayLine
  */
 
-/** @type {Array.<DisplayLine>}
+/** All PVs that we currently know of.
+ *
+ * Element 0 is history (or null if no history).
+ * Element 1 is current main PV.
+ * All remaining elements are refutation lines (multi-PV).
+ *
+ * @type {Array.<DisplayLine>}
  * @private
  */
 var display_lines = [];
@@ -649,11 +655,16 @@ var collapse_history = function(truncate_history) {
 }
 window['collapse_history'] = collapse_history;
 
+/** Update the HTML display of multi-PV from the global "refutation_lines".
+ *
+ * Also recreates the global "display_lines".
+ */
 var update_refutation_lines = function() {
        if (fen === null) {
                return;
        }
        if (display_lines.length > 2) {
+               // Truncate so that only the history and PV is left.
                display_lines = [ display_lines[0], display_lines[1] ];
        }
 
@@ -710,6 +721,9 @@ var update_refutation_lines = function() {
 }
 
 /**
+ * Create a Chess.js board object, containing the given position plus the given moves,
+ * up to the given limit.
+ *
  * @param {?string} fen
  * @param {Array.<string>} moves
  * @param {number} last_move