X-Git-Url: https://git.sesse.net/?p=remoteglot;a=blobdiff_plain;f=www%2Fjs%2Fchessboard-0.3.0.js;h=4b24ec04d5fe3a29845da396f9a1e8c10bb79d57;hp=8f1ac2d4ab61e1d1f2f1b179e0e50e484c09cf02;hb=80b7eedfd414c122038def7ec9e229766219be92;hpb=cdb5cb80047a5a852bf9ba64fb14aa5bc5ef84d5 diff --git a/www/js/chessboard-0.3.0.js b/www/js/chessboard-0.3.0.js index 8f1ac2d..4b24ec0 100644 --- a/www/js/chessboard-0.3.0.js +++ b/www/js/chessboard-0.3.0.js @@ -185,7 +185,11 @@ function objToFen(obj) { return fen; } -window['ChessBoard'] = window['ChessBoard'] || function(containerElOrId, cfg) { +/** @struct */ +var cfg; + +/** @constructor */ +window.ChessBoard = function(containerElOrId, cfg) { 'use strict'; cfg = cfg || {}; @@ -202,7 +206,6 @@ var MINIMUM_JQUERY_VERSION = '1.7.0', // and simplify selectors var CSS = { alpha: 'alpha-d2270', - black: 'black-3c85d', board: 'board-b72b1', chessboard: 'chessboard-63f37', clearfix: 'clearfix-7da63', @@ -215,9 +218,11 @@ var CSS = { sparePieces: 'spare-pieces-7492f', sparePiecesBottom: 'spare-pieces-bottom-ae20f', sparePiecesTop: 'spare-pieces-top-4028b', - square: 'square-55d63', - white: 'white-1e1d7' + square: 'square-55d63' }; +var CSSColor = {}; +CSSColor['white'] = 'white-1e1d7'; +CSSColor['black'] = 'black-3c85d'; //------------------------------------------------------------------------------ // Module Scope Variables @@ -292,6 +297,11 @@ function compareSemVer(version, minimum) { // Validation / Errors //------------------------------------------------------------------------------ +/** + * @param {!number} code + * @param {!string} msg + * @param {Object=} obj + */ function error(code, msg, obj) { // do nothing if showErrors is not set if (cfg.hasOwnProperty('showErrors') !== true || @@ -562,7 +572,7 @@ function buildBoardContainer() { /* var buildSquare = function(color, size, id) { - var html = '
'; @@ -597,7 +607,7 @@ function buildBoard(orientation) { for (var j = 0; j < 8; j++) { var square = alpha[j] + row; - html += '