X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=www%2Fjs%2Fremoteglot.js;h=f3c02c6ff9cacc60ee15239e1740d720ad635d07;hb=2ef4eb46d19d0b41f0be2f60ad78618c197cd487;hp=0a4366cbf801180b79ab5eef25a1c515bca784fd;hpb=fbc73d17f36578f7eb877322ea63a6b488868c69;p=remoteglot diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 0a4366c..f3c02c6 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -7,7 +7,7 @@ * @type {Number} * @const * @private */ -var SCRIPT_VERSION = 2016032200; +var SCRIPT_VERSION = 2016032201; /** * The current backend URL. @@ -48,7 +48,8 @@ var displayed_analysis_data = null; * name: string, * url: string, * id: string, - * score: Object + * score: =Object, + * result: =string, * }>} * @private */ @@ -897,7 +898,12 @@ var update_game_list = function(games) { game_span.appendChild(game_a); } - var score = " (" + format_short_score(game['score']) + ")"; + var score; + if (game['result']) { + score = " (" + game['result'] + ")"; + } else { + score = " (" + format_short_score(game['score']) + ")"; + } game_span.appendChild(document.createTextNode(score)); games_div.appendChild(game_span); @@ -1028,8 +1034,10 @@ var update_board = function() { // The contains a very brief headline. var title_elems = []; - if (data['score']) { - title_elems.push(format_short_score(data['score']).replace(/^ /, "")); + if (data['position'] && data['position']['result']) { + title_elems.push(data['position']['result']); + } else if (data['score']) { + title_elems.push(format_short_score(data['score'])); } if (last_move !== null) { title_elems.push(last_move);