Created
May 19, 2014 02:48
-
-
Save hsienwei/b232fa188603c7b928ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTMLActuator.prototype.message = function (won) { | |
var type = won ? "game-won" : "game-over"; | |
var message = won ? "You win!" : "Game over!"; | |
this.messageContainer.classList.add(type); | |
this.messageContainer.getElementsByTagName("p")[0].textContent = message; | |
window.messageBus.send(window.senderId, won ? "win" : "lose"); | |
}; | |
HTMLActuator.prototype.clearMessage = function () { | |
// IE only takes one value to remove at a time. | |
this.messageContainer.classList.remove("game-won"); | |
this.messageContainer.classList.remove("game-over"); | |
window.messageBus.send(window.senderId, "clear"); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment