Change line endings to unix
This commit is contained in:
parent
e9f18446d9
commit
41cfaaf791
18
paradise.js
18
paradise.js
|
@ -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) ||
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue