jablonka.czprosek.czf

mapstats

Subversion Repositories:
[/] [mapstats.js] - Blame information for rev 9

 

Line No. Rev Author Line
11unreal// --------------------------------------------------------
29unreal// This script made by JKLIR as. Unreal][ [http://jklir.net]
34unreal// Map engine originally from Emcee Lam [http://sjsutech.com]
41unreal// Licence: GNU/GPL
59unreal// (c) 2011 All rights reserved
61unreal// --------------------------------------------------------
7 
89unrealvar mainMap;
9var magnifier;
101unreal 
119unrealvar node = new Array();
12var nodecount;
13var file_nodes = new Array();
14var file_noping = new Array();
15var file_links = new Array();
16var file_infopoints = new Array();
17var file_state = new Array();
18var ann;
19var m1;
20var m2;
21var m3;
22var m4;
23var m5;
24var m6;
25var m7;
26var m8;
27var m9;
28var m1_a;
29var m2_a;
30var m3_a;
31var m4_a;
32var m5_a;
33var m6_a;
34var m7_a;
35var m8_a;
36var m9_a;
37var cntm;
38var div_paint;
39var div_points;
40var div_wave;
41var div_infopoint;
42var div_name;
43var div_ip;
44var div_status;
45var numoflinks = 0;
46var maxnumoflinks = 17;
47var is_ie = false;
48if(typeof(G_vmlCanvasManager)!='undefined') { is_ie = true; }
49actual_links = "";
50var drawing_timer;
51var is_adding = true;
521unreal 
539unrealArray.prototype.max = function() {
54 var max = this[0];
55 var len = this.length;
56 for(var i=1; i<len; i++) if (this[i] > max) max = this[i];
57 return max;
58}
59Array.prototype.min = function() {
60 var min = this[0];
61 var len = this.length;
62 for(var i=1; i<len; i++) if (this[i] < min) min = this[i];
63 return min;
64}
658unreal 
669unrealfunction mapInit (startzoom) {
67 magnifier = new Magnifier();
68 mainMap = new MainMap(startzoom);
691unreal 
709unreal var miniMapDiv = document.getElementById("miniMapInner");
71 miniMapDiv.onmousedown = function (event) { return magnifier.startMove(event) };
72 miniMapDiv.onmousemove = function (event) { return magnifier.processMove(event) };
73 miniMapDiv.onmouseup = function (event) { return magnifier.stopMove(event) };
74 miniMapDiv.ondragstart = function() { return false; } // for IE
75}
761unreal 
779unrealfunction Magnifier () {
78 var this1 = this;
79 this.f_dragging = false;
80 this.div = document.getElementById("magnifier");
81 this.div.ondragstart = function() { return false; } // for IE
82 this.div.onmousedown = function (event) { return this1.startMove(event) };
83 this.div.onmousemove = function (event) { return this1.processMove(event) };
84 this.div.onmouseup = function (event) { return this1.stopMove(event) };
85}
861unreal 
879unrealMagnifier.prototype.startMove = function (event) {
88 // for IE
89 if (!event) event = window.event;
901unreal 
919unreal var magnifierDiv = document.getElementById("magnifier");
92 //var magnifierDiv = this.div;
93 this.dragStartLeft = event.clientX;
94 this.dragStartTop = event.clientY;
951unreal 
969unreal this.top = magnifierDiv.offsetTop;
97 this.left = magnifierDiv.offsetLeft;
981unreal 
999unreal this.f_dragging = true;
100 return false;
101}
1021unreal 
1039unreal/* As you drag the mouse in the mini map, the magnifier responds by
104 moving. Likewise, the main map will show the current area
105 enclosed by the magnifier. */
106Magnifier.prototype.processMove = function (event) {
107 var magnifierDiv = this.div;
108 
109 if (!event) event = window.event; // for IE
110 if (this.f_dragging) {
111 
112 var minX = 0;
113 var maxX = magres_x - magnifierDiv.offsetWidth;
114 var minY = 0;
115 var maxY = magres_y - magnifierDiv.offsetHeight;
116 
117 var shiftedLeft = this.left + (event.clientX - this.dragStartLeft);
118 if (shiftedLeft < minX) shiftedLeft = minX; // map is not infinite
119 if (shiftedLeft > maxX) shiftedLeft = maxX;
120 magnifierDiv.style.left = shiftedLeft + "px";
1211unreal 
1229unreal var shiftedTop = this.top + (event.clientY - this.dragStartTop);
123 if (shiftedTop < minY) shiftedTop = minY; // map is not infinite
124 if (shiftedTop > maxY) shiftedTop = maxY;
125 magnifierDiv.style.top = shiftedTop + "px";
1261unreal 
1279unreal mainMap.setViewPort();
128 }
129}
1301unreal 
1319unrealMagnifier.prototype.stopMove = function (event) {
132 this.f_dragging = false;
133 is_adding = true;
134 checkLinks();
135}
1361unreal 
1379unrealMagnifier.prototype.setSize = function (innerDivWidth, innerDivHeight) {
138 var magnifierWidth = Math.round((magres_x * inres_x) / innerDivWidth) - 2; // 200 * 700px
139 /* We subtract 2 because the borders are 1 pixel each */
140 var magnifierHeight = Math.round((magres_y * inres_y) / innerDivHeight) - 2; // 141 * 500px
141 /* We subtract 2 because the borders are 1 pixel each */
142 var magnifierDiv = document.getElementById("magnifier");
143 magnifierDiv.style.width = magnifierWidth + "px";
144 magnifierDiv.style.height = magnifierHeight + "px";
145 
146 document.getElementById("wrapper").style.width = inres_x + document.getElementById("menuset").clientWidth + 18 + "px";
147}
1481unreal 
1499unrealMagnifier.prototype.setPosition = function () {
150 var innerDiv = document.getElementById("innerDiv");
151 var innerDivWidth = innerDiv.clientWidth;
152 var innerDivHeight = innerDiv.clientHeight;
153 var innerDivLeft = innerDiv.offsetLeft;
154 var innerDivTop = innerDiv.offsetTop;
155 this.left = Math.round(Math.abs(innerDivLeft) * magres_x / innerDivWidth);
156 this.top = Math.round(Math.abs(innerDivTop) * magres_y / innerDivHeight);
1571unreal 
1589unreal // alter magnifier
159 var magnifierDiv = this.div;
160 magnifierDiv.style.left = this.left + "px";
161 magnifierDiv.style.top = this.top + "px";
162}
1631unreal 
1649unrealfunction MainMap (zoomfirst) {
165 var this1 = this;
1661unreal 
1679unreal // view port is the visible portion of the main map
168 this.viewPortWidth = inres_x; //500
169 this.viewPortHeight = inres_y; //400
1701unreal 
1719unreal this.tileSize = 256;
172 this.f_dragging = false;
173 this.innerDiv = document.getElementById("innerDiv");
174 this.innerDiv.style.cursor = "url('grab.cur'), default";
175 
176 var outerDiv = document.getElementById("outerDiv");
177 this.outerDiv = outerDiv;
1781unreal outerDiv.style.width = inres_x + "px";
179 outerDiv.style.height = inres_y + "px";
1809unreal var underMap = document.getElementById("underMap");
1811unreal underMap.style.width = (inres_x - 4) + "px";
182 
1839unreal outerDiv.onmousedown = function(event) { return this1.startMove(event) };
184 outerDiv.onmousemove = function(event) { return this1.processMove(event) };
185 outerDiv.onmouseup = function(event) { return this1.stopMove(event) };
186 outerDiv.ondblclick = function(event) { return this1.doubleClick() };
187 outerDiv.ondragstart = function() { return false; } // for IE
1881unreal 
189 if(zoomfirst==eq_mini) { zf = 0; }
1909unreal else if(zoomfirst==eq_medi) { zf = 1; }
191 else if(zoomfirst==eq_high) { zf = 2; }
192 else if(zoomfirst==eq_orig) { zf = 3; }
193 else { zf = 0; }
1941unreal 
1959unreal this.zoom = zf;
196 this.zoomDim = [
197 {
198 width:parseInt(full_x * eq_mini),
199 height:parseInt(full_y * eq_mini),
200 size:1,
201 nasobek:eq_mini,
202 numoflinks:17
203 },
204 {
205 width:parseInt(full_x * eq_medi),
206 height:parseInt(full_y * eq_medi),
207 size:2,
208 nasobek:eq_medi,
209 numoflinks:12
210 },
211 {
212 width:parseInt(full_x * eq_high),
213 height:parseInt(full_y * eq_high),
214 size:3,
215 nasobek:eq_high,
216 numoflinks:10
217 },
218 {
219 width:parseInt(full_x * eq_orig),
220 height:parseInt(full_y * eq_orig),
221 size:4,
222 nasobek:eq_orig,
223 numoflinks:7
224 },
225 ]
2261unreal 
2279unreal var zoomElt = this.zoomDim[this.zoom];
228 this.setInnerDivSize (zoomElt.width, zoomElt.height, zoomElt.size, (parseInt(zoomfirst*1000)/10));
229 document.getElementById("zoom"+this.zoom).className = "active";
2301unreal 
2319unreal var innerDiv = document.getElementById("innerDiv");
232 innerDiv.style.left = -(start_left * start_mul) + "px";
233 innerDiv.style.top = -(start_top * start_mul) + "px";
2341unreal 
2359unreal magnifier.setPosition();
236 this.checkTiles();
237}
2381unreal 
2399unrealMainMap.prototype.startMove = function (event) {
240 // for IE
241 if (!event) event = window.event;
2421unreal 
2439unreal this.dragStartLeft = event.clientX;
244 this.dragStartTop = event.clientY;
245 var innerDiv = this.innerDiv;
246 innerDiv.style.cursor = "url('grabbing.cur'), default";
2471unreal 
2489unreal this.top = innerDiv.offsetTop;
249 this.left = innerDiv.offsetLeft;
2501unreal 
2519unreal this.f_dragging = true;
252 is_adding = true;
253 window.clearInterval(drawing_timer);
254 drawing_timer = window.setInterval(checkLinks, 1100);
255 return false;
256}
2571unreal 
2589unrealMainMap.prototype.processMove = function (event) {
259 var zoomElt = this.zoomDim[this.zoom];
260 var maxY = 0;
261 var minY = -(zoomElt.height - this.viewPortHeight);
262 var maxX = 0;
263 var minX = -(zoomElt.width - this.viewPortWidth);
2641unreal 
2659unreal if (!event) event = window.event; // for IE
266 var innerDiv = this.innerDiv;
267 if (this.f_dragging) {
268 var shiftedTop = this.top + (event.clientY - this.dragStartTop);
269 if (shiftedTop > maxY) shiftedTop = maxY; // map is not infinite
270 if (shiftedTop < minY) shiftedTop = minY;
271 innerDiv.style.top = shiftedTop + "px";
272 
273 var shiftedLeft = this.left + (event.clientX - this.dragStartLeft);
274 if (shiftedLeft > maxX) shiftedLeft = maxX; // map is not infinite
275 if (shiftedLeft < minX) shiftedLeft = minX;
276 innerDiv.style.left = shiftedLeft + "px";
2771unreal 
2789unreal this.checkTiles();
279 magnifier.setPosition();
280 }
2811unreal 
2829unreal var konst = 0;
283 var nasobek = this.zoomDim[this.zoom].nasobek;
284 if (is_ie) { konst = -2; }
285 var outerDiv = this.outerDiv;
286 var infoDiv = document.getElementById("infoDiv");
287 if(this.f_dragging) {
288 infoDiv.innerHTML = parseInt((Math.abs(shiftedLeft) + event.clientX - outerDiv.offsetLeft + konst)/nasobek) + " x " + parseInt((Math.abs(shiftedTop) + event.clientY - outerDiv.offsetTop + konst)/nasobek);
289 } else {
290 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);
291 }
292}
2931unreal 
2949unrealMainMap.prototype.checkZoom = function () {
295 window.clearInterval(drawing_timer);
296 var zoomElt = this.zoomDim[this.zoom];
297 var maxY = 0;
298 var minY = -(zoomElt.height - this.viewPortHeight);
299 var maxX = 0;
300 var minX = -(zoomElt.width - this.viewPortWidth);
301 var chcky = 0;
302 var chckx = 0;
3031unreal 
3049unreal var innerDiv = this.innerDiv;
305 var shiftedTop = innerDiv.offsetTop;
306 if (shiftedTop > maxY) { shiftedTop = maxY; chcky = 1; } // map is not infinite
307 if (shiftedTop < minY) { shiftedTop = minY; chcky = 1; }
308 if (chcky == 1) innerDiv.style.top = shiftedTop + "px";
3091unreal 
3109unreal var shiftedLeft = innerDiv.offsetLeft;
311 if (shiftedLeft > maxX) { shiftedLeft = maxX; chckx = 1; }// map is not infinite
312 if (shiftedLeft < minX) { shiftedLeft = minX; chckx = 1; }
313 if (chckx == 1) innerDiv.style.left = shiftedLeft + "px";
3141unreal 
3159unreal magnifier.setPosition();
316 document.getElementById("zoom0").className = "";
317 document.getElementById("zoom1").className = "";
318 document.getElementById("zoom2").className = "";
319 document.getElementById("zoom3").className = "";
320 document.getElementById("zoom"+this.zoom).className = "active";
321}
322 
323MainMap.prototype.checkTiles = function () {
324 var innerDiv = this.innerDiv;
325 var tileSize = this.tileSize;
326 var visibleTiles = this.getVisibleTiles();
327 var visibleTilesMap = {};
328 var i;
3291unreal 
3309unreal var size = this.zoomDim[this.zoom].size;
331 for(i=0;i<visibleTiles.length; i++) {
332 var tile = visibleTiles[i];
333 var xy = "x" + tile.x + "y" + tile.y;
334 var tileName = xy + "z" + this.zoom;
335 visibleTilesMap[tileName] = true;
336 var img = document.getElementById(tileName);
337 if (!img) {
338 img = document.createElement("img");
339 img.src = "size" + size + "/" + xy + ".jpg";
340 img.style.position = "absolute";
341 img.style.left = (tile.x * tileSize) + "px";
342 img.style.top = (tile.y * tileSize) + "px";
343 img.setAttribute("id", tileName);
344 innerDiv.appendChild(img);
345 }
346 }
3471unreal 
3489unreal var imgs = innerDiv.getElementsByTagName("img");
349 for(i=0; i<imgs.length; i++) {
350 var id = imgs[i].getAttribute("id");
351 if (!visibleTilesMap[id]) {
352 innerDiv.removeChild(imgs[i]);
353 i--;
354 }
355 }
356}
3571unreal 
3589unrealMainMap.prototype.getVisibleTiles = function () {
359 var innerDiv = this.innerDiv;
360 var mapX = innerDiv.offsetLeft;
361 var mapY = innerDiv.offsetTop;
362 var tileSize = this.tileSize;
3631unreal 
3649unreal var startX = Math.abs(Math.floor(mapX / tileSize)) - 1;
365 if (startX < 0) startX = 0;
366 var startY = Math.abs(Math.floor(mapY / tileSize)) - 1;
367 if (startY < 0) startY = 0;
368 var tilesX = Math.ceil(this.viewPortWidth / tileSize) + 1;
369 var tilesY = Math.ceil(this.viewPortHeight / tileSize) + 1;
3701unreal 
3719unreal var visibleTiles = [];
372 var counter = 0;
373 for (x = startX; x < (tilesX + startX); x++) {
374 for (y = startY; y < (tilesY + startY); y++) {
375 var tile = {};
376 tile.x = x;
377 tile.y = y;
378 visibleTiles[counter++] = tile;
379 }
380 }
381 return visibleTiles;
382}
3831unreal 
3849unrealMainMap.prototype.stopMove = function (event) {
385 window.clearInterval(drawing_timer);
386 checkLinks();
387 is_adding = false;
388 checkLinks();
389 this.innerDiv.style.cursor = "url('grab.cur'), default";
390 this.f_dragging = false;
391}
3921unreal 
3939unreal// movement in the magnifier moves main map's view port
394MainMap.prototype.setViewPort = function () {
395 var magDiv = document.getElementById("magnifier");
396 var innerDiv = this.innerDiv;
397 var magLeft = magDiv.offsetLeft;
398 var magTop = magDiv.offsetTop;
399 var innerDivWidth = innerDiv.clientWidth;
400 var innerDivHeight = innerDiv.clientHeight;
4011unreal 
4029unreal /* set innerDivLeft */
403 var innerDivLeftMin = inres_x - innerDivWidth; //500
404 var innerDivLeft = Math.round((-magLeft) * innerDivWidth / magres_x);
405 if (innerDivLeft < innerDivLeftMin) innerDivLeft = innerDivLeftMin;
406 innerDiv.style.left = innerDivLeft + "px";
4071unreal 
4089unreal /* set innerDivTop */
409 var innerDivTopMin = inres_y - innerDivHeight; //400
410 var innerDivTop = Math.round((-magTop) * innerDivHeight / magres_y);
411 if (innerDivTop < innerDivTopMin) innerDivTop = innerDivTopMin;
412 innerDiv.style.top = innerDivTop + "px";
4131unreal 
4149unreal this.checkTiles();
415}
4161unreal 
4179unrealMainMap.prototype.setInnerDivSize = function (width, height, size, percent) {
418 var innerDiv = this.innerDiv;
419 innerDiv.style.width = width + "px";
420 innerDiv.style.height = height + "px";
421 magnifier.setPosition();
422 magnifier.setSize(width, height);
4231unreal 
4249unreal var resolutionInfo = document.getElementById("resolutionInfo");
425 resolutionInfo.innerHTML = percent + "%, " + width + " x " + height + "px";
426}
4271unreal 
4289unrealMainMap.prototype.setZoom = function (newZoom) {
429 is_adding = true;
430 if (this.zoom == newZoom) return;
431 window.clearInterval(drawing_timer);
432 actual_links = "";
433 numoflinks = 0;
434 var oldZ = this.zoomDim[this.zoom];
435 var newZ = this.zoomDim[newZoom];
436 var innerDiv = this.innerDiv;
437 var imgs = innerDiv.getElementsByTagName("img");
438 while (imgs.length > 0) {
439 innerDiv.removeChild(imgs[0]);
440 }
4411unreal 
4429unreal var oldLeft = innerDiv.offsetLeft;
443 var oldTop = innerDiv.offsetTop;
444 var wdth = Math.round(((magres_x * inres_x) / newZ.width) - 2); // 200 * 700px
445 var hght = Math.round(((magres_y * inres_y) / newZ.height) - 2); // 141 * 500px
446 var wdth2 = Math.round(((magres_x * inres_x) / oldZ.width) - 2); // 200 * 700px
447 var hght2 = Math.round(((magres_y * inres_y) / oldZ.height) - 2); // 141 * 500px
4485unreal 
4499unreal innerDiv.style.left = Math.round(Math.round(newZ.width * oldLeft / oldZ.width) + ((wdth-wdth2)*4)) + "px";
450 innerDiv.style.top = Math.round(Math.round(newZ.height * oldTop / oldZ.height) + ((hght-hght2)*4)) + "px";
451 this.zoom = newZoom; // set the global zoom
452 this.setInnerDivSize(newZ.width, newZ.height, newZ.size, (newZ.nasobek*1000)/10);
453 maxnumoflinks = newZ.numoflinks;
4541unreal 
4559unreal this.checkZoom();
456 this.checkTiles();
4571unreal 
4589unreal deleteNames();
459 canvasInit(newZ.nasobek);
4601unreal 
4619unreal}
4621unreal 
4639unrealMainMap.prototype.doubleClick = function () {
464 if (this.zoom == 3) return;
465 this.setZoom(this.zoom + 1);
466}
4671unreal 
4689unrealMainMap.prototype.addNewLinks = function (minx, maxx, miny, maxy, linkname) {
469 var innerDiv = this.innerDiv;
470 var frameLeft = -innerDiv.offsetLeft;
471 var frameTop = -innerDiv.offsetTop;
472 var frameRight = frameLeft + inres_x;
473 var frameBottom = frameTop + inres_y;
474 var regexp = new RegExp(linkname + ' ', 'gi');
475 if(!regexp.test(actual_links)) {
476 return (minx <= frameRight && frameLeft <= maxx && miny <= frameBottom && frameTop <= maxy);
4771unreal }
4789unreal}
4791unreal 
4809unrealMainMap.prototype.removeOldLinks = function (minx, maxx, miny, maxy, linkname) {
481 var innerDiv = this.innerDiv;
482 var frameLeft = -innerDiv.offsetLeft;
483 var frameTop = -innerDiv.offsetTop;
484 var frameRight = frameLeft + inres_x;
485 var frameBottom = frameTop + inres_y;
486 var regexp = new RegExp(linkname + ' ', 'gi');
487 if(regexp.test(actual_links) && numoflinks>=maxnumoflinks) {
488 if(!(minx <= frameRight && frameLeft <= maxx && miny <= frameBottom && frameTop <= maxy)) {
489 actual_links = actual_links.replace(regexp, "");
490 var linkDOM = document.getElementById(linkname);
491 if(is_ie) {
492 linkDOM.parentNode.parentNode.removeChild(linkDOM.parentNode);
493 } else {
494 linkDOM.parentNode.removeChild(linkDOM);
495 }
496 numoflinks--;
497 return;
498 }
499 }
500}
5011unreal 
502 
5039unrealfunction canvasInit(nasobek) {
504 is_adding = true;
505 actual_links = "";
506 numoflinks = 0;
507 
508 div_paint = document.getElementById("paint");
509 div_points = document.getElementById("mapstats_points");
510 div_wave = document.getElementById("mapstats_wave");
511 div_infopoint = document.getElementById("mapstats_infopoint");
512 div_name = document.getElementById("mapstats_name");
513 div_ip = document.getElementById("mapstats_ip");
514 div_status = document.getElementById("mapstats_status");
515 
516 div_paint.style.width = parseInt(full_x*nasobek) + "px";
517 div_paint.style.height = parseInt(full_y*nasobek) + "px";
518 
519 var mapstats_over = document.getElementById("mapstats_over");
520 mapstats_over.style.width = parseInt(full_x*nasobek) + "px";
521 mapstats_over.style.height = parseInt(full_y*nasobek) + "px";
5221unreal 
5239unreal ann = nasobek;
524 var pozdrav2 = new Array();
525 var pozdr = new Array();
526 var pozdrav = file_nodes.split('\n');
527 var pozdrav1 = file_noping.split('\n');
528 var a_cnt = 0;
529 var p0count = pozdrav.length;
530 var p1count = pozdrav1.length;
5311unreal 
5329unreal for(a=0;a<p0count;a++){
533 if(pozdrav[a]!=false) {
534 node[a] = new Array();
535 pozdrav2 = pozdrav[a].split(';');
536 for(b=0;b<pozdrav2.length;b++){
537 node[a][b] = pozdrav2[b];
538 }
539 a_cnt++;
540 }
541 }
542 for(e=0;e<p1count;e++) {
543 if(pozdrav1[e]!=false) {
544 node[(e+a_cnt)] = new Array();
545 pozdr = pozdrav1[e].split(';');
546 for(f=0;f<pozdr.length;f++){
547 node[(e+a_cnt)][f] = pozdr[f];
548 }
549 }
550 }
5511unreal 
5529unreal nodecount = node.length;
553 var pozdrav3 = new Array();
554 var pozdrav4 = new Array();
555 var size;
556 var clrlnk;
557 m1 = 0; m1_a = 0;
558 m2 = 0; m2_a = 0;
559 m3 = 0; m3_a = 0;
560 m4 = 0; m4_a = 0;
561 m5 = 0; m5_a = 0;
562 m6 = 0; m6_a = 0;
563 m7 = 0; m7_a = 0;
564 m8 = 0; m8_a = 0;
565 m9 = 0; m9_a = 0;
566 cntm = 0;
567 
568 checkLinks();
5691unreal 
5709unreal cntm = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m1_a + m2_a + m3_a + m4_a + m5_a + m6_a + m7_a + m8_a + m9_a;
5711unreal 
5729unreal var pozdrav5 = new Array();
573 var pozdrav6 = new Array();
574 if(ch_infopoint) {
575 if(file_infopoints.length>0) {
576 pozdrav5 = file_infopoints.split('\n');
577 for(d=0;d<pozdrav5.length;d++) {
578 if(pozdrav5[d]!=false) {
579 pozdrav6 = pozdrav5[d].split(';');
580 // Vykreslime si infopointy
581 if(ch_name) {
582 drawInfo(pozdrav6[0],pozdrav6[1],pozdrav6[2],nasobek);
5831unreal }
5849unreal drawInfoPoint(pozdrav6[1],pozdrav6[2],nasobek);
585 }
586 }
587 }
588 }
5891unreal 
5909unreal for(e=0;e<p1count;e++) {
591 if(pozdrav1[e]!="") {
592 if(ch_noping) {
593 if(node[(a_cnt+e)][3]==1) {
594 drawClient(node[(a_cnt+e)][1],node[(a_cnt+e)][2],nasobek);
595 if(ch_name) {
596 drawName(node[(a_cnt+e)][0],(node[(a_cnt+e)][1])-1,(node[(a_cnt+e)][2])-1,nasobek)
5971unreal }
5989unreal }
599 if(node[(a_cnt+e)][3]==2) {
600 drawSwitch(node[(a_cnt+e)][1],node[(a_cnt+e)][2],nasobek);
601 }
602 }
603 }
604 }
6051unreal 
6069unreal var pozdrav7 = file_state.split('\n');
607 var pozdrav8 = new Array();
608 var clrpnt;
609 var x_pos;
610 var y_pos;
611 var name_pos;
612 var title_pos;
613 var p7count = pozdrav7.length;
6141unreal 
6159unreal for(c=0;c<p7count;c++){
616 if(pozdrav7[c]!=false) {
617 pozdrav8 = pozdrav7[c].split(';');
618 if(pozdrav8[1]==1) { clrpnt = "on"; pozdrav8[2] = pozdrav8[2] + ' ms'; } else { clrpnt = "off"; pozdrav8[2] = "offline"; }
619 if(pozdrav8[0]!=node[c][4]) { x_pos = ip2sour(pozdrav8[0],1); y_pos = ip2sour(pozdrav8[0],2); name_pos = ip2sour(pozdrav8[0],0); title_pos = ip2sour(pozdrav8[0],3); } else { x_pos = node[c][1]; y_pos = node[c][2]; name_pos = node[c][0]; title_pos = node[c][3]; } // check if the result doesnt replaced
6201unreal 
6219unreal if(title_pos.toLowerCase()=="ap") {
622 if(ch_ap) {
623 drawAP(x_pos,y_pos,nasobek);
624 drawNode(x_pos,y_pos,nasobek,clrpnt);
625 if(ch_name) {
626 drawName(name_pos,x_pos,y_pos,nasobek);
627 }
628 if((ch_ip) && (ch_status)) {
629 drawStatus(pozdrav8[2],x_pos,y_pos,nasobek);
630 drawIP(pozdrav8[0],x_pos,y_pos,nasobek);
631 } else if((!ch_ip) && (ch_status)) {
632 drawStatus(pozdrav8[2],x_pos,y_pos-parseInt(12/nasobek),nasobek);
633 } else if((ch_ip) && (!ch_status)) {
634 drawIP(pozdrav8[0],x_pos,y_pos,nasobek);
635 }
636 }
637 } else if(title_pos.toLowerCase()=="router") {
638 if(ch_router) {
639 drawNode(x_pos,y_pos,nasobek,clrpnt);
640 if(ch_name) {
641 drawName(name_pos,x_pos,y_pos,nasobek);
6421unreal }
6439unreal if(ch_status) {
644 drawStatus(pozdrav8[2],x_pos,y_pos-parseInt(12/nasobek),nasobek);
6451unreal }
6469unreal }
647 } else {
648 if(ch_node) {
649 drawNode(x_pos,y_pos,nasobek,clrpnt);
650 if(ch_name) {
651 drawName(name_pos,x_pos,y_pos,nasobek);
652 }
653 }
654 }
655 }
656 }
6571unreal 
6589unreal var legend = document.getElementById('legend');
659 if((ch_legend) && (cntm>0)) {
660 drawLegend();
661 legend.style.display = "block";
662 } else {
663 legend.style.display = "none";
6641unreal }
6659unreal}
6661unreal 
6679unrealfunction drawLink(pos, size, nas, color) {
668 var linkname = "canvas" + pos.replace(/(#|&|_|\.|\:)/gi, "");
669 var points = new Array();
670 var posxy = new Array();
671 var coordinates = new Array();
672 var cor_x = new Array();
673 var cor_y = new Array();
674 points = pos.split('#');
675 var reg=/(\d+)&(\d+)/;
676 for(i=0;i<points.length;i++){
677 if (reg.test(points[i])) {
678 posxy = points[i].split('&');
679 coordinates[i*2] = parseInt(posxy[0]*nas);
680 coordinates[i*2+1] = parseInt(posxy[1]*nas);
681 cor_x.push(coordinates[i*2]);
682 cor_y.push(coordinates[i*2+1]);
683 } else {
684 coordinates[i*2] = parseInt(node2sour(points[i],1)*nas);
685 coordinates[i*2+1] = parseInt(node2sour(points[i],2)*nas);
686 cor_x.push(coordinates[i*2]);
687 cor_y.push(coordinates[i*2+1]);
688 }
6891unreal }
6909unreal 
691 var maxX = cor_x.max();
692 var minX = cor_x.min();
693 var maxY = cor_y.max();
694 var minY = cor_y.min();
695 if(is_adding) {
696 if(!mainMap.addNewLinks(minX, maxX, minY, maxY, linkname)) return;
697 } else {
698 if(!mainMap.removeOldLinks(minX, maxX, minY, maxY, linkname)) return;
699 }
700 numoflinks++;
701 actual_links = actual_links + linkname + " ";
702 var canvas = document.createElement("canvas");
703 canvas.width = maxX - minX + 10;
704 canvas.height = maxY - minY + 10;
705 canvas.id = linkname;
706 
707 if(is_ie) {
708 // for IE's VML absolute positioning
709 var div = document.createElement("div");
710 div.style.width = maxX - minX + 10 + "px";
711 div.style.height = maxY - minY + 10 + "px";
712 div.style.position = "absolute";
713 div.style.left = (minX - 5) + "px";
714 div.style.top = (minY - 5) + "px";
715 div.appendChild(canvas);
716 div_paint.appendChild(div);
717 G_vmlCanvasManager.initElement(canvas);
718 } else {
719 canvas.setAttribute("style", "position:absolute;left:" + (minX - 5) + "px;top:" + (minY - 5) + "px;");
720 div_paint.appendChild(canvas);
721 }
722 var ctx = document.getElementById(linkname).getContext('2d');
723 
724 minX -= 5;
725 minY -= 5;
7261unreal 
7279unreal ctx.lineJoin = "round";
728 ctx.strokeStyle = "rgb(20, 20, 20)";
729 ctx.lineWidth = size+1;
730 ctx.beginPath();
731 ctx.moveTo(coordinates[0]-minX,coordinates[1]-minY);
732 for(i=2;i<coordinates.length;i+=2){
733 ctx.lineTo(coordinates[i]-minX,coordinates[i+1]-minY);
7341unreal }
7359unreal ctx.stroke();
7361unreal 
7379unreal ctx.lineJoin = "round";
738 ctx.strokeStyle = "rgb(0, 0, 0)";
739 ctx.lineWidth = size+1;
740 ctx.beginPath();
741 ctx.moveTo(coordinates[0]-minX,coordinates[1]-minY);
742 for(i=2;i<coordinates.length;i+=2){
743 ctx.lineTo(coordinates[i]-minX,coordinates[i+1]-minY);
7441unreal }
7459unreal ctx.stroke();
7461unreal 
7479unreal ctx.lineJoin = "round";
748 ctx.strokeStyle = color;
749 ctx.lineWidth = size-1;
750 ctx.beginPath();
751 ctx.moveTo(coordinates[0]-minX,coordinates[1]-minY);
752 for(i=2;i<coordinates.length;i+=2){
753 ctx.lineTo(coordinates[i]-minX,coordinates[i+1]-minY);
7541unreal }
7559unreal ctx.stroke();
756}
7571unreal 
7589unrealfunction drawINPLink(pos, size, nas, color) {
759 var linkname = "canvas" + pos.replace(/(#|&|_|\.|\:)/gi, "");
760 var points = new Array();
761 var posxy = new Array();
762 var coordinates = new Array();
763 var cor_x = new Array();
764 var cor_y = new Array();
765 points = pos.split('#');
766 var reg=/(\d+)&(\d+)/;
767 for(i=0;i<points.length;i++){
768 if (reg.test(points[i])) {
769 posxy = points[i].split('&');
770 coordinates[i*2] = parseInt(posxy[0]*nas);
771 coordinates[i*2+1] = parseInt(posxy[1]*nas);
772 cor_x.push(coordinates[i*2]);
773 cor_y.push(coordinates[i*2+1]);
774 } else {
775 coordinates[i*2] = parseInt(node2sour(points[i],1)*nas);
776 coordinates[i*2+1] = parseInt(node2sour(points[i],2)*nas);
777 cor_x.push(coordinates[i*2]);
778 cor_y.push(coordinates[i*2+1]);
779 }
7801unreal }
7819unreal 
782 var maxX = cor_x.max();
783 var minX = cor_x.min();
784 var maxY = cor_y.max();
785 var minY = cor_y.min();
786 if(is_adding) {
787 if(!mainMap.addNewLinks(minX, maxX, minY, maxY, linkname)) return;
788 } else {
789 if(!mainMap.removeOldLinks(minX, maxX, minY, maxY, linkname)) return;
790 }
791 numoflinks++;
792 actual_links = actual_links + linkname + " ";
793 var canvas = document.createElement("canvas");
794 canvas.width = maxX - minX + 10;
795 canvas.height = maxY - minY + 10;
796 canvas.id = linkname;
797 
798 if(is_ie) {
799 // for IE's VML absolute positioning
800 var div = document.createElement("div");
801 div.style.width = maxX - minX + 10 + "px";
802 div.style.height = maxY - minY + 10 + "px";
803 div.style.position = "absolute";
804 div.style.left = (minX - 5) + "px";
805 div.style.top = (minY - 5) + "px";
806 div.appendChild(canvas);
807 div_paint.appendChild(div);
808 G_vmlCanvasManager.initElement(canvas);
809 } else {
810 canvas.setAttribute("style", "position:absolute;left:" + (minX - 5) + "px;top:" + (minY - 5) + "px;");
811 div_paint.appendChild(canvas);
812 }
813 var ctx = document.getElementById(linkname).getContext('2d');
814 
815 minX -= 5;
816 minY -= 5;
8171unreal 
8189unreal ctx.lineJoin = "round";
819 ctx.strokeStyle = "rgba(0, 0, 0, 0.1)";
820 ctx.lineWidth = size+1.5;
821 ctx.beginPath();
822 ctx.moveTo(coordinates[0]-minX,coordinates[1]-minY);
823 for(i=2;i<coordinates.length;i+=2){
824 ctx.lineTo(coordinates[i]-minX,coordinates[i+1]-minY);
8251unreal }
8269unreal ctx.stroke();
8271unreal 
8289unreal ctx.lineJoin = "round";
829 ctx.strokeStyle = color;
830 ctx.lineWidth = size+0.5;
831 ctx.beginPath();
832 ctx.moveTo(coordinates[0]-minX,coordinates[1]-minY);
833 for(i=2;i<coordinates.length;i+=2){
834 ctx.lineTo(coordinates[i]-minX,coordinates[i+1]-minY);
8351unreal }
8369unreal ctx.stroke();
837}
8381unreal 
8399unrealfunction checkLinks() {
840 if(file_links.length>0) {
841 pozdrav3 = file_links.split('\n');
842 var p3count = pozdrav3.length;
843 for(a=0;a<p3count;a++){
844 if(pozdrav3[a]!=false) {
845 pozdrav4 = pozdrav3[a].split(';');
846 if(pozdrav4[1].toLowerCase()=="backbone") { size = 4.1; } else { size = 2.7; }
847 if(pozdrav4[2].toLowerCase()!="inp") {
848 if(pozdrav4[3]==1) { clrlnk = wifi_client; m1 = 1; }
849 else if(pozdrav4[3]==2) { clrlnk = wifi_backbone; m2 = 1; }
850 else if(pozdrav4[3]==3) { clrlnk = eth_100; m3 = 1; }
851 else if(pozdrav4[3]==4) { clrlnk = fso; m4 = 1; }
852 else if(pozdrav4[3]==5) { clrlnk = fso_backup; m5 = 1; }
853 else if(pozdrav4[3]==6) { clrlnk = ghz5; m6 = 1; }
854 else if(pozdrav4[3]==7) { clrlnk = ghz10; m7 = 1; }
855 else if(pozdrav4[3]==8) { clrlnk = fiber; m8 = 1; }
856 else { clrlnk = other; m9 = 1; }
857 } else {
858 if(pozdrav4[3]==1) { clrlnk = wifi_client_a; m1_a = 1; }
859 else if(pozdrav4[3]==2) { clrlnk = wifi_backbone_a; m2_a = 1; }
860 else if(pozdrav4[3]==3) { clrlnk = eth_100_a; m3_a = 1; }
861 else if(pozdrav4[3]==4) { clrlnk = fso_a; m4_a = 1; }
862 else if(pozdrav4[3]==5) { clrlnk = fso_backup_a; m5_a = 1; }
863 else if(pozdrav4[3]==6) { clrlnk = ghz5_a; m6_a = 1; }
864 else if(pozdrav4[3]==7) { clrlnk = ghz10_a; m7_a = 1; }
865 else if(pozdrav4[3]==8) { clrlnk = fiber_a; m8_a = 1; }
866 else { clrlnk = other_a; m9_a = 1; }
867 }
868 
869 if(pozdrav4[2].toLowerCase()!="inp") {
870 if((ch_backbone && size==4.1) || (ch_client && size==2.7)) {
871 drawLink(pozdrav4[0], size, ann, clrlnk);
872 }
873 } else {
874 if(ch_inp) {
875 drawINPLink(pozdrav4[0], size-1, ann, clrlnk);
876 }
877 }
878 }
879 }
8801unreal }
8819unreal}
8821unreal 
8839unrealfunction drawNode(xo, yo, nas, img) {
884 xo = parseInt((xo*nas)-7);
885 yo = parseInt((yo*nas)-7);
886 var text = '<div class="node" style="position:absolute;left:' + xo + 'px;top:' + yo + 'px;background:url(\'' + img + '.png\');" unselectable = "on"></div>';
887 div_points.innerHTML += text;
888}
8891unreal 
8909unrealfunction drawAP(xn, yn, nas) {
891 xn = parseInt((xn*nas)-31);
892 yn = parseInt((yn*nas)-17);
893 var text = '<div class="ap" style="position:absolute;left:' + xn + 'px;top:' + yn + 'px;" unselectable = "on"></div>';
894 div_wave.innerHTML += text;
895}
8961unreal 
8979unrealfunction drawClient(xc, yc, nas) {
898 xc = parseInt((xc*nas)-7);
899 yc = parseInt((yc*nas)-7);
900 var text = '<div class="client" style="position:absolute;left:' + xc + 'px;top:' + yc + 'px;" unselectable = "on"></div>';
901 div_wave.innerHTML += text;
902}
9031unreal 
9049unrealfunction drawSwitch(xs, ys, nas) {
905 xs = parseInt((xs*nas)-6);
906 ys = parseInt((ys*nas)-6);
907 var text = '<div class="switch" style="position:absolute;left:' + xs + 'px;top:' + ys + 'px;" unselectable = "on"></div>';
908 div_wave.innerHTML += text;
909}
9101unreal 
9119unrealfunction drawInfoPoint(xl, yl, nas) {
912 xl = parseInt((xl*nas)-7);
913 yl = parseInt((yl*nas)-7);
914 var text = '<div class="infopoint" style="position:absolute;left:' + xl + 'px;top:' + yl + 'px;" unselectable = "on"></div>';
915 div_wave.innerHTML += text;
916}
9174unreal 
9189unrealfunction drawInfo(txt, xa, ya, nas) {
919 xa = parseInt((xa*nas)+6);
920 ya = parseInt((ya*nas)-13);
921 var text = '<div class="stitek" style="position:absolute;left:' + xa + 'px;top:' + ya + 'px;" unselectable = "on">' + txt + '</div>';
922 div_infopoint.innerHTML += text;
923}
9241unreal 
9259unrealfunction drawName(txt, xa, ya, nas) {
926 xa = parseInt((xa*nas)+6);
927 ya = parseInt((ya*nas)-13);
928 var text = '<div class="stitek" style="position:absolute;left:' + xa + 'px;top:' + ya + 'px;" unselectable = "on">' + txt + '</div>';
929 div_name.innerHTML += text;
930}
9311unreal 
9329unrealfunction drawIP(txt, xb, yb, nas) {
933 xb = parseInt((xb*nas)+6);
934 yb = parseInt((yb*nas)-1);
935 var text = '<div class="stitek" style="position:absolute;left:' + xb + 'px;top:' + yb + 'px;" unselectable = "on">' + txt + '</div>';
936 div_ip.innerHTML += text;
937}
9381unreal 
9399unrealfunction drawStatus(txt, xc, yc, nas) {
940 xc = parseInt((xc*nas)+6);
941 yc = parseInt((yc*nas)+11);
942 var text = '<div class="stitek" style="position:absolute;left:' + xc + 'px;top:' + yc + 'px;" unselectable = "on">' + txt + '</div>';
943 div_status.innerHTML += text;
944}
9451unreal 
9469unrealfunction drawLegendText(txt) {
947 document.getElementById("mapstats_legend").innerHTML = '<div class="legend" unselectable = "on">' + txt + '</div>';
948}
9491unreal 
9509unrealfunction drawLegend() {
951 var epsilon;
952 var cislo = 0;
953 var name = "";
954 var paintlegend = document.getElementById('paintlegend');
955 paintlegend.height = (((cntm-1) * 12)+13);
956 paintlegend.width = "25";
957 var ctx = paintlegend.getContext('2d');
958 ctx.clearRect(0,0,25,((cntm-1) * 12)+13);
959 if(m1==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,wifi_client,2.7); name = name + name1 + "<br/>"; cislo++; }
960 if(m2==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,wifi_backbone,4.1); name = name + name2 + "<br/>"; cislo++; }
961 if(m3==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,eth_100,4.1); name = name + name3 + "<br/>"; cislo++; }
962 if(m4==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,fso,4.1); name = name + name4 + "<br/>"; cislo++; }
963 if(m5==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,fso_backup,4.1); name = name + name5 + "<br/>"; cislo++; }
964 if(m6==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,ghz5,4.1); name = name + name6 + "<br/>"; cislo++; }
965 if(m7==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,ghz10,4.1); name = name + name7 + "<br/>"; cislo++; }
966 if(m8==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,fiber,4.1); name = name + name8 + "<br/>"; cislo++; }
967 if(m9==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,other,4.1); name = name + name9 + "<br/>"; cislo++; }
968 if(m1_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,wifi_client_a,2.7); name = name + name1 + " " + inp + "<br/>"; cislo++; }
969 if(m2_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,wifi_backbone_a,4.1); name = name + name2 + " " + inp + "<br/>"; cislo++; }
970 if(m3_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,eth_100_a,4.1); name = name + name3 + " " + inp + "<br/>"; cislo++; }
971 if(m4_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,fso_a,4.1); name = name + name4 + " " + inp + "<br/>"; cislo++; }
972 if(m5_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,fso_backup_a,4.1); name = name + name5 + " " + inp + "<br/>"; cislo++; }
973 if(m6_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,ghz5_a,4.1); name = name + name6 + " " + inp + "<br/>"; cislo++; }
974 if(m7_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,ghz10_a,4.1); name = name + name7 + " " + inp + "<br/>"; cislo++; }
975 if(m8_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,fiber_a,4.1); name = name + name8 + " " + inp + "<br/>"; cislo++; }
976 if(m9_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,other_a,4.1); name = name + name9 + " " + inp + "<br/>"; }
977 drawLegendText(name);
978}
9791unreal 
9809unrealfunction drawLegendLink(yg,color,size) {
981 var ctx = document.getElementById('paintlegend').getContext('2d');
982 ctx.strokeStyle = "rgb(20, 20, 20)";
983 ctx.lineWidth = size+1;
984 ctx.beginPath();
985 ctx.moveTo(1,yg);
986 ctx.lineTo(24,yg);
987 ctx.stroke();
9881unreal 
9899unreal ctx.strokeStyle = "rgb(0, 0, 0)";
990 ctx.lineWidth = size;
991 ctx.beginPath();
992 ctx.moveTo(1,yg);
993 ctx.lineTo(24,yg);
994 ctx.stroke();
9951unreal 
9969unreal ctx.strokeStyle = color;
997 ctx.lineWidth = size-1;
998 ctx.beginPath();
999 ctx.moveTo(1,yg);
1000 ctx.lineTo(24,yg);
1001 ctx.stroke();
1002}
10031unreal 
10049unrealfunction drawLegendINPLink(yg,color,size) {
1005 var ctx = document.getElementById('paintlegend').getContext('2d');
1006 ctx.strokeStyle = "rgba(255, 255, 255, 0.5)";
1007 ctx.lineWidth = size;
1008 ctx.beginPath();
1009 ctx.moveTo(1,yg);
1010 ctx.lineTo(24,yg);
1011 ctx.stroke();
10121unreal 
10139unreal ctx.strokeStyle = "rgba(0, 0, 0, 0.1)";
1014 ctx.lineWidth = size;
1015 ctx.beginPath();
1016 ctx.moveTo(1,yg);
1017 ctx.lineTo(24,yg);
1018 ctx.stroke();
10195unreal 
10209unreal ctx.strokeStyle = color;
1021 ctx.lineWidth = size-0.5;
1022 ctx.beginPath();
1023 ctx.moveTo(1,yg);
1024 ctx.lineTo(24,yg);
1025 ctx.stroke();
1026}
10271unreal 
10289unrealfunction clearMap() {
1029 div_paint.innerHTML = "";
1030}
10311unreal 
10329unrealfunction node2sour(name, pos) {
1033 var ok = 0;
1034 for(k=0;k<nodecount;k++){
1035 if(node[k][0]==name) {
1036 ok = node[k][pos];
1037 }
1038 if(ok!=0) { return ok; }
10391unreal }
10409unreal return ok;
1041}
10421unreal 
10439unrealfunction ip2sour(ip, pos) {
1044 var ok = 0;
1045 for(k=0;k<nodecount;k++){
1046 if(node[k][4]==ip) {
1047 ok = node[k][pos];
1048 }
1049 if(ok!=0) { return ok; }
10501unreal }
10519unreal return ok;
1052}
10531unreal 
10549unrealfunction loadFiles() {
1055 var d = new Date();
1056 var tm = d.getTime();
1057 file_nodes = getFile(nodes + "?" + tm);
1058 file_noping = getFile(noping + "?" + tm);
1059 file_links = getFile(links + "?" + tm);
1060 file_infopoints = getFile(infopoints + "?" + tm);
1061 file_state = getFile(state + "?" + tm);
1062 redrawUpdate();
1063}
10641unreal 
10659unrealfunction getFile(url) {
1066 AJAX = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : false));
1067 if (AJAX) {
1068 AJAX.open("GET", url, false);
1069 AJAX.setRequestHeader("Cache-Control", "no-store");
1070 AJAX.setRequestHeader("Cache-Control", "no-cache");
1071 AJAX.setRequestHeader("Cache-Control", "must-revalidate");
1072 AJAX.setRequestHeader("Pragma", "no-cache");
1073 AJAX.send(null);
1074 return AJAX.responseText;
1075 } else {
1076 return false;
1077 }
1078}
10791unreal 
10809unrealfunction setAutoLoader() {
1081 // auto-downloading source files every 2 minutes
1082 setInterval("loadFiles()", 2 * 60 * 1000);
1083}
10841unreal 
10859unrealfunction setCheckboxes() {
1086 document.form_map.ch_ap.checked = ch_ap;
1087 document.form_map.ch_router.checked = ch_router;
1088 document.form_map.ch_node.checked = ch_node;
1089 document.form_map.ch_infopoint.checked = ch_infopoint;
1090 document.form_map.ch_noping.checked = ch_noping;
1091 document.form_map.ch_legend.checked = ch_legend;
1092 document.form_map.ch_name.checked = ch_name;
1093 document.form_map.ch_ip.checked = ch_ip;
1094 document.form_map.ch_status.checked = ch_status;
1095 document.form_map.ch_backbone.checked = ch_backbone;
1096 document.form_map.ch_client.checked = ch_client;
1097 document.form_map.ch_inp.checked = ch_inp;
1098}
1099 
1100function deleteNames() {
1101 div_paint.innerHTML = "";
1102 div_points.innerHTML = "";
1103 div_wave.innerHTML = "";
1104 div_infopoint.innerHTML = "";
1105 div_name.innerHTML = "";
1106 div_ip.innerHTML = "";
1107 div_status.innerHTML = "";
1108 document.getElementById("mapstats_legend").innerHTML = "";
1109}
11101unreal 
11119unrealfunction reDraw() {
1112 if(document.form_map.ch_ap.checked) { ch_ap = true; } else { ch_ap = false; }
1113 if(document.form_map.ch_router.checked) { ch_router = true; } else { ch_router = false; }
1114 if(document.form_map.ch_node.checked) { ch_node = true; } else { ch_node = false; }
1115 if(document.form_map.ch_infopoint.checked) { ch_infopoint = true; } else { ch_infopoint = false; }
1116 if(document.form_map.ch_noping.checked) { ch_noping = true; } else { ch_noping = false; }
1117 if(document.form_map.ch_legend.checked) { ch_legend = true; } else { ch_legend = false; }
1118 if(document.form_map.ch_name.checked) { ch_name = true; } else { ch_name = false; }
1119 if(document.form_map.ch_ip.checked) { ch_ip = true; } else { ch_ip = false; }
1120 if(document.form_map.ch_status.checked) { ch_status = true; } else { ch_status = false; }
1121 if(document.form_map.ch_backbone.checked) { ch_backbone = true; } else { ch_backbone = false; }
1122 if(document.form_map.ch_client.checked) { ch_client = true; } else { ch_client = false; }
1123 if(document.form_map.ch_inp.checked) { ch_inp = true; } else { ch_inp = false; }
1124 deleteNames();
1125 clearMap();
1126 canvasInit(ann);
1127}
11281unreal 
11299unrealfunction changeOpacity(opc) {
1130 var opcprc = opc / 100;
1131 var mapstats_update = document.getElementById("mapstats_update");
11321unreal 
11339unreal if (is_ie) {
1134 mapstats_update.style.filter = 'alpha(opacity=' + opc + ');';
1135 } else {
1136 mapstats_update.style.setProperty("-moz-opacity",opcprc,null);
1137 mapstats_update.style.setProperty("opacity",opcprc,null);
11381unreal }
11399unreal}
11401unreal 
11419unrealfunction changeUpdate() {
1142 var promenna = new Date();
1143 var rok = promenna.getFullYear();
1144 var mesic = "" + (promenna.getMonth() + 1);
1145 var den = "" + (promenna.getDate());
1146 var hodin = "" + (promenna.getHours());
1147 var minut = "" + (promenna.getMinutes());
1148 var sekund = "" + (promenna.getSeconds());
1149 if(mesic.length==1) { mesic = "0" + mesic; }
1150 if(den.length==1) { den = "0" + den; }
1151 if(hodin.length==1) { hodin = "0" + hodin; }
1152 if(minut.length==1) { minut = "0" + minut; }
1153 if(sekund.length==1) { sekund = "0" + sekund; }
1154 document.getElementById("mapstats_update").innerHTML = den + ". " + mesic + ". " + rok + " " + hodin + ":" + minut + ":" + sekund;
1155}
1156 
1157function redrawUpdate() {
1158 setTimeout("changeOpacity(90)",100);
1159 setTimeout("changeOpacity(80)",200);
1160 setTimeout("changeOpacity(70)",300);
1161 setTimeout("changeOpacity(60)",400);
1162 setTimeout("changeOpacity(50)",500);
1163 setTimeout("changeOpacity(40)",600);
1164 setTimeout("changeOpacity(30)",700);
1165 setTimeout("changeOpacity(20)",800);
1166 setTimeout("changeOpacity(10)",900);
1167 setTimeout("changeOpacity(0)",1000);
1168 setTimeout("changeUpdate()",1050);
1169 setTimeout("changeOpacity(10)",1100);
1170 setTimeout("changeOpacity(20)",1200);
1171 setTimeout("changeOpacity(30)",1300);
1172 setTimeout("changeOpacity(40)",1400);
1173 setTimeout("changeOpacity(50)",1500);
1174 setTimeout("changeOpacity(60)",1600);
1175 setTimeout("changeOpacity(70)",1700);
1176 setTimeout("changeOpacity(80)",1800);
1177 setTimeout("changeOpacity(90)",1900);
1178 setTimeout("changeOpacity(100)",2000);
1179}

Powered by WebSVN 2.2.1