Input enabled on both sides, without move validation.
Additionally, the Markers extension is used with its autoMarkers ability.
const board = new Chessboard(document.getElementById("board"), {
position: FEN.start,
assetsUrl: "../assets/",
style: {pieces: {file: "pieces/staunty.svg"}},
extensions: [{class: Markers}]
})
board.enableMoveInput(inputHandler)
function inputHandler(event) {
console.log(event)
switch (event.type) {
case INPUT_EVENT_TYPE.moveInputStarted:
log(`moveInputStarted: ${event.squareFrom}`)
return true // false cancels move
case INPUT_EVENT_TYPE.validateMoveInput:
log(`validateMoveInput: ${event.squareFrom}-${event.squareTo}`)
return true // false cancels move
case INPUT_EVENT_TYPE.moveInputCanceled:
log(`moveInputCanceled`)
break
case INPUT_EVENT_TYPE.moveInputFinished:
log(`moveInputFinished`)
break
case INPUT_EVENT_TYPE.movingOverSquare:
log(`movingOverSquare: ${event.squareTo}`)
break
}
}