add email form to game over screen

This commit is contained in:
Gabriele Cirulli
2014-03-24 19:07:26 +01:00
parent 26e2e0d2a2
commit 1ca07d765e
5 changed files with 403 additions and 174 deletions
+13 -4
View File
@@ -55,6 +55,9 @@ KeyboardInputManager.prototype.listen = function () {
event.shiftKey;
var mapped = map[event.which];
// Ignore the event if it's happening in a text field
if (self.targetIsInput(event)) return;
if (!modifiers) {
if (mapped !== undefined) {
event.preventDefault();
@@ -79,8 +82,9 @@ KeyboardInputManager.prototype.listen = function () {
gameContainer.addEventListener(this.eventTouchstart, function (event) {
if ((!window.navigator.msPointerEnabled && event.touches.length > 1) ||
event.targetTouches > 1) {
return; // Ignore if touching with more than 1 finger
event.targetTouches > 1 ||
self.targetIsInput(event)) {
return; // Ignore if touching with more than 1 finger or touching input
}
if (window.navigator.msPointerEnabled) {
@@ -100,8 +104,9 @@ KeyboardInputManager.prototype.listen = function () {
gameContainer.addEventListener(this.eventTouchend, function (event) {
if ((!window.navigator.msPointerEnabled && event.touches.length > 0) ||
event.targetTouches > 0) {
return; // Ignore if still touching with one or more fingers
event.targetTouches > 0 ||
self.targetIsInput(event)) {
return; // Ignore if still touching with one or more fingers or input
}
var touchEndClientX, touchEndClientY;
@@ -142,3 +147,7 @@ KeyboardInputManager.prototype.bindButtonPress = function (selector, fn) {
button.addEventListener("click", fn.bind(this));
button.addEventListener(this.eventTouchend, fn.bind(this));
};
KeyboardInputManager.prototype.targetIsInput = function (event) {
return event.target.tagName.toLowerCase() === "input";
};