diff --git a/SRC/public/js/memory.js b/SRC/public/js/memory.js index 615f447..bcd6fdc 100755 --- a/SRC/public/js/memory.js +++ b/SRC/public/js/memory.js @@ -337,19 +337,39 @@ * You won the game! This function runs the "onGameEnd" callback, which by * default clears the game div entirely and shows a "play again" button. */ - +/* Memory.prototype._winGame = function() { var self = this; if (this.options.onGameEnd() === false) { this._clearGame(); - /* document.getElementById("win").addEventListener( "click", function(e) { + + alert("zoro 2"); + document.location.href="/memo"; self.resetGame(); - });*/ + } else { // run callback this.options.onGameEnd(); + //alert("coucou"); } } +*/ +Memory.prototype._winGame = function() { + var self = this; + if (this.options.onGameEnd() === false) { + this._clearGame(); + this.gameMessages.innerHTML = '

\ +

Vous avez gagné votre partie en ' + this.numMoves + ' coups !

\ + '; + this.game.appendChild(this.gameMessages); + document.getElementById("mg__onend--restart").addEventListener( "click", function(e) { + document.location.href="/memo"; + }); + } else { + // run callback + this.options.onGameEnd(); + } +} /** * Memory resetGame diff --git a/SRC/resources/views/frontend/memo.blade.php b/SRC/resources/views/frontend/memo.blade.php index dd0c76b..7539aa5 100755 --- a/SRC/resources/views/frontend/memo.blade.php +++ b/SRC/resources/views/frontend/memo.blade.php @@ -2,6 +2,7 @@ @section('page-css') +