cm-chessboard 4.1.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -82,11 +82,9 @@ board.enableMoveInput(inputHandler, COLOR.white)
|
|
|
82
82
|
function inputHandler(event) {
|
|
83
83
|
console.log("event", event)
|
|
84
84
|
event.chessboard.removeMarkers(undefined, MARKER_TYPE.dot)
|
|
85
|
-
event.chessboard.removeMarkers(undefined, MARKER_TYPE.square)
|
|
86
85
|
if (event.type === INPUT_EVENT_TYPE.moveStart) {
|
|
87
86
|
const moves = chess.moves({square: event.square, verbose: true});
|
|
88
|
-
|
|
89
|
-
for (const move of moves) { // draw dots on possible moves
|
|
87
|
+
for (const move of moves) { // draw dots on possible squares
|
|
90
88
|
event.chessboard.addMarker(move.to, MARKER_TYPE.dot)
|
|
91
89
|
}
|
|
92
90
|
return moves.length > 0
|
|
@@ -115,7 +113,7 @@ board.enableMoveInput(inputHandler, COLOR.white)
|
|
|
115
113
|
const board = new Chessboard(document.getElementById("board"), {
|
|
116
114
|
position: chess.fen(),
|
|
117
115
|
sprite: {url: "../assets/images/chessboard-sprite-staunty.svg"},
|
|
118
|
-
style: {moveFromMarker:
|
|
116
|
+
style: {moveFromMarker: MARKER_TYPE.square, moveToMarker: MARKER_TYPE.square},
|
|
119
117
|
orientation: COLOR.white,
|
|
120
118
|
accessibility: {
|
|
121
119
|
brailleNotationInAlt: true, // show the braille notation of the game in the alt attribute of the svg
|