Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setTimeout(function () {
this.ground = Chessground(document.getElementById('puzzleBoard'), options)
var Width = document.getElementById('puzzleBoard').clientWidth
document.getElementById('puzzleBoard').style.height = Width + 'px'
document.getElementById('puzzleBoard').style.width = Width + 'px'
// getFromLocalStorage
console.log('cargando board')
this.loadPuzzle()
}.bind(this), 10)
},
setTimeout(function () {
this.ground = Chessground(document.getElementById('frontBoardVisor'), options)
var Width = document.getElementById('frontBoardVisor').clientWidth
document.getElementById('frontBoardVisor').style.height = Width + 'px'
document.getElementById('frontBoardVisor').style.width = Width + 'px'
// getFromLocalStorage
this.loadDataGame(this.board)
}.bind(this), 10)
}
setTimeout(function () {
this.orientation = this.user.username === this.board.u2 ? 'black' : 'white'
this.ground = Chessground(document.getElementById('tablerochess'), {
viewOnly: false,
turnColor: 'white',
animation: {
duration: 300
},
movable: {
free: false,
premove: true,
dests: this.chessToDests(this.chess),
events: {
after: this.onMove
}
},
drawable: {
enabled: true
},
setTimeout(function () {
groundInit = Chessground(document.getElementById('puzzleGenerateFenInit'), options)
if (this.puzzleType.position) {
var optionsF = {
fen: this.fenFinish,
orientation: 'white',
movable: {
events: {
after: this.updateFenFinish
}
}
}
groundFinish = Chessground(document.getElementById('puzzleGenerateFenFinish'), optionsF)
}
}.bind(this), 100)
},
setTimeout(function () {
groundInit = Chessground(document.getElementById('puzzleGenerateFenInit'), options)
if (this.puzzleType.position) {
var optionsF = {
fen: this.fenFinish,
orientation: 'white',
movable: {
events: {
after: this.updateFenFinish
}
}
}
groundFinish = Chessground(document.getElementById('puzzleGenerateFenFinish'), optionsF)
}
}.bind(this), 100)
},