working on route allocation

This commit is contained in:
Stephan Richter
2020-09-19 13:51:43 +02:00
parent 917ac5dd07
commit 1d1876e1d3
26 changed files with 72114 additions and 39 deletions

View File

@@ -24,7 +24,7 @@ function addTile(x,y){
}
function bodyClick(ev){
console.log('bodyClick:',ev);
//console.log('bodyClick:',ev);
var x = Math.floor(ev.clientX/SQUARE);
var y = Math.floor(ev.clientY/SQUARE);
@@ -42,7 +42,7 @@ function bodyClick(ev){
function clickTile(x,y){
console.log("clickTile:",x,y);
if ($('#tile-'+x+'-'+y).length > 0) request({action:'openProps',x:x,y:y});
if ($('#tile-'+x+'-'+y).length > 0) request({action:'click',x:x,y:y});
return false;
}
@@ -129,8 +129,10 @@ function request(data){
data : data,
success: function(resp){
closeWindows();
if (resp.startsWith('<')){
$('body').append($(resp));
if (resp.startsWith('<svg')){
$('#plan').append($(resp));
} else if (resp.startsWith('<')) {
$(BODY).append($(resp));
} else {
addMessage(resp);
}