Change line endings to unix

This commit is contained in:
Pedro de Oliveira 2016-10-17 18:38:35 +01:00
parent e9f18446d9
commit 41cfaaf791
3 changed files with 301 additions and 317 deletions

View File

@ -15,15 +15,8 @@ function reset() {
room();
}
/**
* @author cc
* Unified func for keydown and touch events
*/
function doAction(actionID) {
if(selected === 0) {
switch(actionID) {
case 70:
selected = 1;
@ -60,27 +53,18 @@ function prepareCanvas(canvasDiv, canvasWidth, canvasHeight)
// Note: The above code is a workaround for IE 8and lower. Otherwise we could have used:
// context = document.getElementById('canvas').getContext("2d");
/**
* @author: cc
* Do device validation, fix layout and assign their events
*/
//Check device
if( navigator.userAgent.match(/Android/i) ||
if (navigator.userAgent.match(/Android/i) ||
navigator.userAgent.match(/iPhone|iPad|iPod/i) ||
navigator.userAgent.match(/IEMobile/i) ) { //is mobile
navigator.userAgent.match(/IEMobile/i)) {
document.getElementById("infoDiv").style.display = "none";
var elems = document.getElementById("touch-elems").getElementsByTagName("li");
for(var i = 0; i < elems.length; i++) {
elems[i].addEventListener("click", function(e) {
doAction( parseInt(e.target.id) );
}, true);
}
} else { //is desktop
document.getElementById("infoTouchDiv").style.display = "none";
window.addEventListener('keydown', function(e) {
doAction(e.keyCode);