// ECMAScript 5 strict mode /* jshint globalstrict: true*/ /* jslint newcap: true */ /* global THREE, $, document, window, console */ /* global LOADING_BAR_SCALE,ROWS,COLS,PIECE_SIZE, BOARD_SIZE, FLOOR_SIZE, WIREFRAME, DEBUG, Cell, WHITE, BLACK, FEEDBACK, SHADOW */ /* global SearchAndRedraw, UIPlayMove, camera, levels, g_allMoves:true, promotion:true, g_backgroundEngine:true, validMoves, InitializeBackgroundEngine, EnsureAnalysisStopped, newGame, redrawBoard, parsePGN, g_playerWhite:true */ /*global Search,FormatSquare,GenerateMove,MakeMove,GetMoveSAN,MakeSquare,UnmakeMove, FormatMove, ResetGame, GetFen, GetMoveFromString, alert, InitializeFromFen, GenerateValidMoves */ /*global g_inCheck,g_board,g_pieceList, g_toMove, g_timeout:true,g_maxply:true */ /*global moveflagCastleKing, moveflagCastleQueen, moveflagEPC, moveflagPromotion, colorWhite*/ /*global moveflagPromoteQueen,moveflagPromoteRook,moveflagPromoteBishop,moveflagPromoteKnight*/ /*global piecePawn, pieceKnight, pieceBishop, pieceRook, pieceQueen, pieceKing */ "use strict"; (function () { // jQuery pgn textarea var $pgn; // list of moves in pgn format var g_pgn = []; // jQuery check feedback var $info; function initInfo() { // create the DOM element // to display Chc $info = $("
") .css("position","absolute") .position({ of:$("body"), my:"right top", at:"right top" }) .attr("id","info") .appendTo($("body")) .css("left","auto") .css("right","0"); } function initGUI() { var $gui = $("
") .css("position","absolute") .position({ of:$("body"), my:"left top", at:"left top" }) .width(150) .attr("id","gui"); $("

") .text("menu") .appendTo($gui); var $menudiv = $("

").appendTo($gui); var $menu = $("
    ").appendTo($menudiv); makeButton("NewGame",newGameDialog,$menu); makeButton("Undo",undo,$menu); makeButton("Load",loadDialog,$menu); makeButton("Save",save,$menu); $("