jablonka.czprosek.czf

mapstats

Subversion Repositories:
[/] [mapstats.js] - Diff between revs 5 and 6

Show entire file Ignore whitespace

Rev 5 Rev 6
Line 272... Line 272...
   
this.checkTiles(); this.checkTiles();
magnifier.setPosition(); magnifier.setPosition();
} }
   
var nasobek; var nasbek;
var konst = 0; var konst = 0;
if(this.zoom==0) { nasobek = eq_mini; } if(this.zoom==0) { nasbek = eq_mini; }
if(this.zoom==1) { nasobek = eq_medi; } if(this.zoom==1) { nasbek = eq_medi; }
if(this.zoom==2) { nasobek = eq_high; } if(this.zoom==2) { nasbek = eq_high; }
if(this.zoom==3) { nasobek = eq_orig; } if(this.zoom==3) { nasbek = eq_orig; }
if (navigator.appName=="Microsoft Internet Explorer") { konst = -2; } if (navigator.appName=="Microsoft Internet Explorer") { konst = -2; }
var outerDiv = document.getElementById("outerDiv"); var outerDiv = document.getElementById("outerDiv");
var infoDiv = document.getElementById("infoDiv"); var infoDiv = document.getElementById("infoDiv");
infoDiv.innerHTML = parseInt((Math.abs(parseInt(innerDiv.style.left)) + event.clientX - outerDiv.offsetLeft + konst)/nasobek) + " x " + parseInt((Math.abs(parseInt(innerDiv.style.top)) + event.clientY - outerDiv.offsetTop + konst)/nasobek); if (this.f_dragging) {
  infoDiv.innerHTML = parseInt((Math.abs(shiftedLeft) + event.clientX - outerDiv.offsetLeft + konst)/nasbek) + " x " + parseInt((Math.abs(shiftedTop) + event.clientY - outerDiv.offsetTop + konst)/nasbek);
  } else {
  infoDiv.innerHTML = parseInt((Math.abs(parseInt(innerDiv.style.left)) + event.clientX - outerDiv.offsetLeft + konst)/nasbek) + " x " + parseInt((Math.abs(parseInt(innerDiv.style.top)) + event.clientY - outerDiv.offsetTop + konst)/nasbek);
  }
} }
   
MainMap.prototype.checkZoom = MainMap.prototype.checkZoom =
function () { function () {
var zoomElt = this.zoomDim[this.zoom]; var zoomElt = this.zoomDim[this.zoom];
Line 303... Line 307...
if (chcky == 1) innerDiv.style.top = shiftedTop + "px"; if (chcky == 1) innerDiv.style.top = shiftedTop + "px";
   
var shiftedLeft = innerDiv.offsetLeft; var shiftedLeft = innerDiv.offsetLeft;
if (shiftedLeft > maxX) { shiftedLeft = maxX; chckx = 1; }// map is not infinite if (shiftedLeft > maxX) { shiftedLeft = maxX; chckx = 1; }// map is not infinite
if (shiftedLeft < minX) { shiftedLeft = minX; chckx = 1; } if (shiftedLeft < minX) { shiftedLeft = minX; chckx = 1; }
if (chcky == 1) innerDiv.style.left = shiftedLeft + "px"; if (chckx == 1) innerDiv.style.left = shiftedLeft + "px";
   
magnifier.setPosition(); magnifier.setPosition();
} }
   
MainMap.prototype.checkTiles = MainMap.prototype.checkTiles =
Line 457... Line 461...
var nasobek; var nasobek;
if(this.zoom==0) { nasobek = eq_mini; } if(this.zoom==0) { nasobek = eq_mini; }
if(this.zoom==1) { nasobek = eq_medi; } if(this.zoom==1) { nasobek = eq_medi; }
if(this.zoom==2) { nasobek = eq_high; } if(this.zoom==2) { nasobek = eq_high; }
if(this.zoom==3) { nasobek = eq_orig; } if(this.zoom==3) { nasobek = eq_orig; }
this.setInnerDivSize(newZ.width, newZ.height, newZ.size, (parseInt(nasobek*1000)/10)); this.setInnerDivSize(newZ.width, newZ.height, newZ.size, (nasobek*1000)/10);
   
this.checkZoom(); this.checkZoom();
this.checkTiles(); this.checkTiles();
   
titulek1 = document.getElementById("mapstats_infopoint"); titulek1 = document.getElementById("mapstats_infopoint");
Line 498... Line 502...
   
var canvas_id1 = document.getElementById("paint"); var canvas_id1 = document.getElementById("paint");
canvas_id1.width = parseInt(full_x*nasobek); canvas_id1.width = parseInt(full_x*nasobek);
canvas_id1.height = parseInt(full_y*nasobek); canvas_id1.height = parseInt(full_y*nasobek);
   
var canvas_id2 = document.getElementById("paint2"); if (navigator.appName=="Microsoft Internet Explorer") {
canvas_id2.width = parseInt(full_x*nasobek); var canvas_id2 = document.getElementById("paint2");
canvas_id2.height = parseInt(full_y*nasobek); canvas_id2.width = parseInt(full_x*nasobek);
  canvas_id2.height = parseInt(full_y*nasobek);
  }
   
ann = nasobek; ann = nasobek;
var pozdrav = new Array(); var pozdrav = new Array();
var pozdrav1 = new Array(); var pozdrav1 = new Array();
var pozdrav2 = new Array(); var pozdrav2 = new Array();
Line 798... Line 804...
if (navigator.appName=="Microsoft Internet Explorer") { if (navigator.appName=="Microsoft Internet Explorer") {
if(img=="on") { img = imgon; } else { img = imgoff; } if(img=="on") { img = imgon; } else { img = imgoff; }
var ctx = document.getElementById('paint2').getContext('2d'); var ctx = document.getElementById('paint2').getContext('2d');
ctx.drawImage(img,xo,yo); ctx.drawImage(img,xo,yo);
} else { } else {
var text = '<div style="position:absolute;left:' + xo + 'px;top:' + yo + 'px;width: 14px;height: 14px;background-image: url(\'' + img + '.png\');font-size: 0px;cursor: default;" unselectable = "on"></div>'; var text = '<div style="position:absolute;left:' + xo + 'px;top:' + yo + 'px;width: 14px;height: 14px;background-image: url(\'' + img + '.png\');font-size: 0px;cursor: url(grab.cur) default;" unselectable = "on"></div>';
titulek = document.getElementById("mapstats_points"); titulek = document.getElementById("mapstats_points");
titulek.innerHTML = titulek.innerHTML + text; titulek.innerHTML = titulek.innerHTML + text;
} }
} }
   
Line 811... Line 817...
yn = parseInt((yn*nas)-17); yn = parseInt((yn*nas)-17);
if (navigator.appName=="Microsoft Internet Explorer") { if (navigator.appName=="Microsoft Internet Explorer") {
var ctx = document.getElementById('paint').getContext('2d'); var ctx = document.getElementById('paint').getContext('2d');
ctx.drawImage(imgap,xn,yn); ctx.drawImage(imgap,xn,yn);
} else { } else {
var text = '<div style="position:absolute;left:' + xn + 'px;top:' + yn + 'px;width: 62px;height: 34px;background-image: url(\'ap.png\');font-size: 0px;cursor: default;" unselectable = "on"></div>'; var text = '<div style="position:absolute;left:' + xn + 'px;top:' + yn + 'px;width: 62px;height: 34px;background-image: url(\'ap.png\');font-size: 0px;cursor: url(grab.cur) default;" unselectable = "on"></div>';
titulek = document.getElementById("mapstats_wave"); titulek = document.getElementById("mapstats_wave");
titulek.innerHTML = titulek.innerHTML + text; titulek.innerHTML = titulek.innerHTML + text;
} }
} }
   
Line 824... Line 830...
yc = parseInt((yc*nas)-7); yc = parseInt((yc*nas)-7);
if (navigator.appName=="Microsoft Internet Explorer") { if (navigator.appName=="Microsoft Internet Explorer") {
var ctx = document.getElementById('paint').getContext('2d'); var ctx = document.getElementById('paint').getContext('2d');
ctx.drawImage(imgcn,xc,yc); ctx.drawImage(imgcn,xc,yc);
} else { } else {
var text = '<div style="position:absolute;left:' + xc + 'px;top:' + yc + 'px;width: 14px;height: 14px;background-image: url(\'client.png\');font-size: 0px;cursor: default;" unselectable = "on"></div>'; var text = '<div style="position:absolute;left:' + xc + 'px;top:' + yc + 'px;width: 14px;height: 14px;background-image: url(\'client.png\');font-size: 0px;cursor: url(grab.cur) default;" unselectable = "on"></div>';
titulek = document.getElementById("mapstats_wave"); titulek = document.getElementById("mapstats_wave");
titulek.innerHTML = titulek.innerHTML + text; titulek.innerHTML = titulek.innerHTML + text;
} }
} }
   
Line 837... Line 843...
ys = parseInt((ys*nas)-6); ys = parseInt((ys*nas)-6);
if (navigator.appName=="Microsoft Internet Explorer") { if (navigator.appName=="Microsoft Internet Explorer") {
var ctx = document.getElementById('paint').getContext('2d'); var ctx = document.getElementById('paint').getContext('2d');
ctx.drawImage(imgsw,xs,ys); ctx.drawImage(imgsw,xs,ys);
} else { } else {
var text = '<div style="position:absolute;left:' + xs + 'px;top:' + ys + 'px;width: 12px;height: 12px;background-image: url(\'switch.png\');font-size: 0px;cursor: default;" unselectable = "on"></div>'; var text = '<div style="position:absolute;left:' + xs + 'px;top:' + ys + 'px;width: 12px;height: 12px;background-image: url(\'switch.png\');font-size: 0px;cursor: url(grab.cur) default;" unselectable = "on"></div>';
titulek = document.getElementById("mapstats_wave"); titulek = document.getElementById("mapstats_wave");
titulek.innerHTML = titulek.innerHTML + text; titulek.innerHTML = titulek.innerHTML + text;
} }
} }
   
Line 850... Line 856...
yl = parseInt((yl*nas)-7); yl = parseInt((yl*nas)-7);
if (navigator.appName=="Microsoft Internet Explorer") { if (navigator.appName=="Microsoft Internet Explorer") {
var ctx = document.getElementById('paint').getContext('2d'); var ctx = document.getElementById('paint').getContext('2d');
ctx.drawImage(imginfo,xl,yl); ctx.drawImage(imginfo,xl,yl);
} else { } else {
var text = '<div style="position:absolute;left:' + xl + 'px;top:' + yl + 'px;width: 14px;height: 14px;background-image: url(\'info.png\');font-size: 0px;cursor: default;" unselectable = "on"></div>'; var text = '<div style="position:absolute;left:' + xl + 'px;top:' + yl + 'px;width: 14px;height: 14px;background-image: url(\'info.png\');font-size: 0px;cursor: url(grab.cur) default;" unselectable = "on"></div>';
titulek = document.getElementById("mapstats_wave"); titulek = document.getElementById("mapstats_wave");
titulek.innerHTML = titulek.innerHTML + text; titulek.innerHTML = titulek.innerHTML + text;
} }
} }
   
Line 938... Line 944...
} }
   
function clearMap(ann) { function clearMap(ann) {
var ctx = document.getElementById('paint').getContext('2d'); var ctx = document.getElementById('paint').getContext('2d');
ctx.clearRect(0,0,parseInt(full_x * ann),parseInt(full_y * ann)); ctx.clearRect(0,0,parseInt(full_x * ann),parseInt(full_y * ann));
var ctx2 = document.getElementById('paint2').getContext('2d'); if (navigator.appName=="Microsoft Internet Explorer") {
ctx2.clearRect(0,0,parseInt(full_x * ann),parseInt(full_y * ann)); var ctx2 = document.getElementById('paint2').getContext('2d');
  ctx2.clearRect(0,0,parseInt(full_x * ann),parseInt(full_y * ann));
  }
} }
   
function node2sour(name, pos) { function node2sour(name, pos) {
var ok = 0; var ok = 0;
for(k=0;k<nodecount;k++){ for(k=0;k<nodecount;k++){
Line 1059... Line 1067...
} }
   
function drawInfo(txt, xa, ya, nas) { function drawInfo(txt, xa, ya, nas) {
xa = parseInt((xa*nas)+6); xa = parseInt((xa*nas)+6);
ya = parseInt((ya*nas)-13); ya = parseInt((ya*nas)-13);
var text = '<div style="position:absolute;white-space:nowrap;letter-spacing: 1px;left:' + xa + 'px;top:' + ya + 'px;font-family: arial;font-size: 9px;background-color: #000000;color: #ffffff;padding-left: 3px;padding-right: 2px;cursor: default;" unselectable = "on">' + txt + '</div>'; var text = '<div style="position:absolute;white-space:nowrap;letter-spacing: 1px;left:' + xa + 'px;top:' + ya + 'px;font-family: arial;font-size: 9px;background-color: #000000;color: #ffffff;padding-left: 3px;padding-right: 2px;cursor: url(grab.cur) default;" unselectable = "on">' + txt + '</div>';
   
titulek = document.getElementById("mapstats_infopoint"); titulek = document.getElementById("mapstats_infopoint");
titulek.innerHTML = titulek.innerHTML + text; titulek.innerHTML = titulek.innerHTML + text;
} }
   
function drawName(txt, xa, ya, nas) { function drawName(txt, xa, ya, nas) {
xa = parseInt((xa*nas)+6); xa = parseInt((xa*nas)+6);
ya = parseInt((ya*nas)-13); ya = parseInt((ya*nas)-13);
var text = '<div style="position:absolute;white-space:nowrap;letter-spacing: 1px;left:' + xa + 'px;top:' + ya + 'px;font-family: arial;font-size: 9px;background-color: #000000;color: #ffffff;padding-left: 3px;padding-right: 2px;cursor: default;" unselectable = "on">' + txt + '</div>'; var text = '<div style="position:absolute;white-space:nowrap;letter-spacing: 1px;left:' + xa + 'px;top:' + ya + 'px;font-family: arial;font-size: 9px;background-color: #000000;color: #ffffff;padding-left: 3px;padding-right: 2px;cursor: url(grab.cur) default;" unselectable = "on">' + txt + '</div>';
   
titulek = document.getElementById("mapstats_name"); titulek = document.getElementById("mapstats_name");
titulek.innerHTML = titulek.innerHTML + text; titulek.innerHTML = titulek.innerHTML + text;
} }
   
function drawIP(txt, xb, yb, nas) { function drawIP(txt, xb, yb, nas) {
xb = parseInt((xb*nas)+6); xb = parseInt((xb*nas)+6);
yb = parseInt((yb*nas)-1); yb = parseInt((yb*nas)-1);
var text = '<div style="position:absolute;white-space:nowrap;letter-spacing: 1px;left:' + xb + 'px;top:' + yb + 'px;font-family: arial;font-size: 9px;background-color: #000000;color: #ffffff;padding-left: 3px;padding-right: 2px;cursor: default;" unselectable = "on">' + txt + '</div>'; var text = '<div style="position:absolute;white-space:nowrap;letter-spacing: 1px;left:' + xb + 'px;top:' + yb + 'px;font-family: arial;font-size: 9px;background-color: #000000;color: #ffffff;padding-left: 3px;padding-right: 2px;cursor: url(grab.cur) default;" unselectable = "on">' + txt + '</div>';
   
titulek = document.getElementById("mapstats_ip"); titulek = document.getElementById("mapstats_ip");
titulek.innerHTML = titulek.innerHTML + text; titulek.innerHTML = titulek.innerHTML + text;
} }
   
function drawStatus(txt, xc, yc, nas) { function drawStatus(txt, xc, yc, nas) {
xc = parseInt((xc*nas)+6); xc = parseInt((xc*nas)+6);
yc = parseInt((yc*nas)+11); yc = parseInt((yc*nas)+11);
var text = '<div style="position:absolute;white-space:nowrap;letter-spacing: 1px;left:' + xc + 'px;top:' + yc + 'px;font-family: arial;font-size: 9px;background-color: #000000;color: #ffffff;padding-left: 3px;padding-right: 2px;cursor: default;" unselectable = "on">' + txt + '</div>'; var text = '<div style="position:absolute;white-space:nowrap;letter-spacing: 1px;left:' + xc + 'px;top:' + yc + 'px;font-family: arial;font-size: 9px;background-color: #000000;color: #ffffff;padding-left: 3px;padding-right: 2px;cursor: url(grab.cur) default;" unselectable = "on">' + txt + '</div>';
   
titulek = document.getElementById("mapstats_status"); titulek = document.getElementById("mapstats_status");
titulek.innerHTML = titulek.innerHTML + text; titulek.innerHTML = titulek.innerHTML + text;
} }
   

Powered by WebSVN 2.2.1