jablonka.czprosek.czf

mapstats

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

 

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]
410unreal// Licence: GNU/GPL | Version 4.1
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();
1810unrealvar ann, m1, m2, m3, m4, m5, m6, m7, m8, m9;
19var m1_a, m2_a, m3_a, m4_a, m5_a, m6_a, m7_a, m8_a, m9_a;
209unrealvar cntm;
2110unrealvar div_paint, div_points, div_wave, div_infopoint, div_name, div_ip, div_status;
229unrealvar numoflinks = 0;
23var maxnumoflinks = 17;
24var is_ie = false;
25if(typeof(G_vmlCanvasManager)!='undefined') { is_ie = true; }
26actual_links = "";
27var drawing_timer;
28var is_adding = true;
2910unrealvar visibleTilesMap = new Array();
301unreal 
319unrealArray.prototype.max = function() {
32 var max = this[0];
33 var len = this.length;
34 for(var i=1; i<len; i++) if (this[i] > max) max = this[i];
35 return max;
36}
37Array.prototype.min = function() {
38 var min = this[0];
39 var len = this.length;
40 for(var i=1; i<len; i++) if (this[i] < min) min = this[i];
41 return min;
42}
438unreal 
449unrealfunction mapInit (startzoom) {
45 magnifier = new Magnifier();
46 mainMap = new MainMap(startzoom);
471unreal 
489unreal var miniMapDiv = document.getElementById("miniMapInner");
49 miniMapDiv.onmousedown = function (event) { return magnifier.startMove(event) };
50 miniMapDiv.onmousemove = function (event) { return magnifier.processMove(event) };
51 miniMapDiv.onmouseup = function (event) { return magnifier.stopMove(event) };
52 miniMapDiv.ondragstart = function() { return false; } // for IE
53}
541unreal 
559unrealfunction Magnifier () {
56 var this1 = this;
57 this.f_dragging = false;
58 this.div = document.getElementById("magnifier");
59 this.div.ondragstart = function() { return false; } // for IE
60 this.div.onmousedown = function (event) { return this1.startMove(event) };
61 this.div.onmousemove = function (event) { return this1.processMove(event) };
62 this.div.onmouseup = function (event) { return this1.stopMove(event) };
63}
641unreal 
659unrealMagnifier.prototype.startMove = function (event) {
66 // for IE
67 if (!event) event = window.event;
681unreal 
699unreal var magnifierDiv = document.getElementById("magnifier");
70 //var magnifierDiv = this.div;
71 this.dragStartLeft = event.clientX;
72 this.dragStartTop = event.clientY;
731unreal 
749unreal this.top = magnifierDiv.offsetTop;
75 this.left = magnifierDiv.offsetLeft;
761unreal 
779unreal this.f_dragging = true;
78 return false;
79}
801unreal 
819unreal/* As you drag the mouse in the mini map, the magnifier responds by
82 moving. Likewise, the main map will show the current area
83 enclosed by the magnifier. */
84Magnifier.prototype.processMove = function (event) {
85 var magnifierDiv = this.div;
86 
87 if (!event) event = window.event; // for IE
88 if (this.f_dragging) {
89 
90 var minX = 0;
91 var maxX = magres_x - magnifierDiv.offsetWidth;
92 var minY = 0;
93 var maxY = magres_y - magnifierDiv.offsetHeight;
94 
95 var shiftedLeft = this.left + (event.clientX - this.dragStartLeft);
96 if (shiftedLeft < minX) shiftedLeft = minX; // map is not infinite
97 if (shiftedLeft > maxX) shiftedLeft = maxX;
98 magnifierDiv.style.left = shiftedLeft + "px";
991unreal 
1009unreal var shiftedTop = this.top + (event.clientY - this.dragStartTop);
101 if (shiftedTop < minY) shiftedTop = minY; // map is not infinite
102 if (shiftedTop > maxY) shiftedTop = maxY;
103 magnifierDiv.style.top = shiftedTop + "px";
1041unreal 
1059unreal mainMap.setViewPort();
106 }
107}
1081unreal 
1099unrealMagnifier.prototype.stopMove = function (event) {
110 this.f_dragging = false;
111 is_adding = true;
112 checkLinks();
113}
1141unreal 
1159unrealMagnifier.prototype.setSize = function (innerDivWidth, innerDivHeight) {
116 var magnifierWidth = Math.round((magres_x * inres_x) / innerDivWidth) - 2; // 200 * 700px
117 /* We subtract 2 because the borders are 1 pixel each */
118 var magnifierHeight = Math.round((magres_y * inres_y) / innerDivHeight) - 2; // 141 * 500px
119 /* We subtract 2 because the borders are 1 pixel each */
120 var magnifierDiv = document.getElementById("magnifier");
121 magnifierDiv.style.width = magnifierWidth + "px";
122 magnifierDiv.style.height = magnifierHeight + "px";
123 
124 document.getElementById("wrapper").style.width = inres_x + document.getElementById("menuset").clientWidth + 18 + "px";
125}
1261unreal 
1279unrealMagnifier.prototype.setPosition = function () {
128 var innerDiv = document.getElementById("innerDiv");
129 var innerDivWidth = innerDiv.clientWidth;
130 var innerDivHeight = innerDiv.clientHeight;
131 var innerDivLeft = innerDiv.offsetLeft;
132 var innerDivTop = innerDiv.offsetTop;
133 this.left = Math.round(Math.abs(innerDivLeft) * magres_x / innerDivWidth);
134 this.top = Math.round(Math.abs(innerDivTop) * magres_y / innerDivHeight);
1351unreal 
1369unreal // alter magnifier
137 var magnifierDiv = this.div;
138 magnifierDiv.style.left = this.left + "px";
139 magnifierDiv.style.top = this.top + "px";
140}
1411unreal 
1429unrealfunction MainMap (zoomfirst) {
143 var this1 = this;
1441unreal 
1459unreal // view port is the visible portion of the main map
146 this.viewPortWidth = inres_x; //500
147 this.viewPortHeight = inres_y; //400
1481unreal 
1499unreal this.tileSize = 256;
150 this.f_dragging = false;
151 this.innerDiv = document.getElementById("innerDiv");
152 this.innerDiv.style.cursor = "url('grab.cur'), default";
15310unreal this.tilesX = Math.ceil(inres_x / this.tileSize) + 1;
154 this.tilesY = Math.ceil(inres_y / this.tileSize) + 1;
1559unreal 
156 var outerDiv = document.getElementById("outerDiv");
157 this.outerDiv = outerDiv;
1581unreal outerDiv.style.width = inres_x + "px";
159 outerDiv.style.height = inres_y + "px";
1609unreal var underMap = document.getElementById("underMap");
1611unreal underMap.style.width = (inres_x - 4) + "px";
162 
1639unreal outerDiv.onmousedown = function(event) { return this1.startMove(event) };
164 outerDiv.onmousemove = function(event) { return this1.processMove(event) };
165 outerDiv.onmouseup = function(event) { return this1.stopMove(event) };
166 outerDiv.ondblclick = function(event) { return this1.doubleClick() };
167 outerDiv.ondragstart = function() { return false; } // for IE
1681unreal 
169 if(zoomfirst==eq_mini) { zf = 0; }
1709unreal else if(zoomfirst==eq_medi) { zf = 1; }
171 else if(zoomfirst==eq_high) { zf = 2; }
172 else if(zoomfirst==eq_orig) { zf = 3; }
173 else { zf = 0; }
1741unreal 
1759unreal this.zoom = zf;
176 this.zoomDim = [
177 {
178 width:parseInt(full_x * eq_mini),
179 height:parseInt(full_y * eq_mini),
180 size:1,
181 nasobek:eq_mini,
182 numoflinks:17
183 },
184 {
185 width:parseInt(full_x * eq_medi),
186 height:parseInt(full_y * eq_medi),
187 size:2,
188 nasobek:eq_medi,
18910unreal numoflinks:13
1909unreal },
191 {
192 width:parseInt(full_x * eq_high),
193 height:parseInt(full_y * eq_high),
194 size:3,
195 nasobek:eq_high,
19610unreal numoflinks:11
1979unreal },
198 {
199 width:parseInt(full_x * eq_orig),
200 height:parseInt(full_y * eq_orig),
201 size:4,
202 nasobek:eq_orig,
20310unreal numoflinks:8
2049unreal },
205 ]
2061unreal 
2079unreal var zoomElt = this.zoomDim[this.zoom];
208 this.setInnerDivSize (zoomElt.width, zoomElt.height, zoomElt.size, (parseInt(zoomfirst*1000)/10));
209 document.getElementById("zoom"+this.zoom).className = "active";
2101unreal 
2119unreal var innerDiv = document.getElementById("innerDiv");
212 innerDiv.style.left = -(start_left * start_mul) + "px";
213 innerDiv.style.top = -(start_top * start_mul) + "px";
2141unreal 
2159unreal magnifier.setPosition();
216 this.checkTiles();
217}
2181unreal 
2199unrealMainMap.prototype.startMove = function (event) {
220 // for IE
221 if (!event) event = window.event;
2221unreal 
2239unreal this.dragStartLeft = event.clientX;
224 this.dragStartTop = event.clientY;
225 var innerDiv = this.innerDiv;
226 innerDiv.style.cursor = "url('grabbing.cur'), default";
2271unreal 
2289unreal this.top = innerDiv.offsetTop;
229 this.left = innerDiv.offsetLeft;
2301unreal 
2319unreal this.f_dragging = true;
232 is_adding = true;
233 window.clearInterval(drawing_timer);
234 drawing_timer = window.setInterval(checkLinks, 1100);
235 return false;
236}
2371unreal 
2389unrealMainMap.prototype.processMove = function (event) {
239 var zoomElt = this.zoomDim[this.zoom];
240 var maxY = 0;
241 var minY = -(zoomElt.height - this.viewPortHeight);
242 var maxX = 0;
243 var minX = -(zoomElt.width - this.viewPortWidth);
2441unreal 
2459unreal if (!event) event = window.event; // for IE
246 var innerDiv = this.innerDiv;
247 if (this.f_dragging) {
248 var shiftedTop = this.top + (event.clientY - this.dragStartTop);
249 if (shiftedTop > maxY) shiftedTop = maxY; // map is not infinite
250 if (shiftedTop < minY) shiftedTop = minY;
251 innerDiv.style.top = shiftedTop + "px";
252 
253 var shiftedLeft = this.left + (event.clientX - this.dragStartLeft);
254 if (shiftedLeft > maxX) shiftedLeft = maxX; // map is not infinite
255 if (shiftedLeft < minX) shiftedLeft = minX;
256 innerDiv.style.left = shiftedLeft + "px";
2571unreal 
2589unreal this.checkTiles();
259 magnifier.setPosition();
260 }
2611unreal 
2629unreal var konst = 0;
263 var nasobek = this.zoomDim[this.zoom].nasobek;
264 if (is_ie) { konst = -2; }
265 var outerDiv = this.outerDiv;
266 var infoDiv = document.getElementById("infoDiv");
267 if(this.f_dragging) {
268 infoDiv.innerHTML = parseInt((Math.abs(shiftedLeft) + event.clientX - outerDiv.offsetLeft + konst)/nasobek) + " x " + parseInt((Math.abs(shiftedTop) + event.clientY - outerDiv.offsetTop + konst)/nasobek);
269 } else {
270 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);
271 }
272}
2731unreal 
2749unrealMainMap.prototype.checkZoom = function () {
275 window.clearInterval(drawing_timer);
276 var zoomElt = this.zoomDim[this.zoom];
277 var maxY = 0;
278 var minY = -(zoomElt.height - this.viewPortHeight);
279 var maxX = 0;
280 var minX = -(zoomElt.width - this.viewPortWidth);
281 var chcky = 0;
282 var chckx = 0;
2831unreal 
2849unreal var innerDiv = this.innerDiv;
285 var shiftedTop = innerDiv.offsetTop;
286 if (shiftedTop > maxY) { shiftedTop = maxY; chcky = 1; } // map is not infinite
287 if (shiftedTop < minY) { shiftedTop = minY; chcky = 1; }
288 if (chcky == 1) innerDiv.style.top = shiftedTop + "px";
2891unreal 
2909unreal var shiftedLeft = innerDiv.offsetLeft;
291 if (shiftedLeft > maxX) { shiftedLeft = maxX; chckx = 1; }// map is not infinite
292 if (shiftedLeft < minX) { shiftedLeft = minX; chckx = 1; }
293 if (chckx == 1) innerDiv.style.left = shiftedLeft + "px";
2941unreal 
2959unreal magnifier.setPosition();
296 document.getElementById("zoom0").className = "";
297 document.getElementById("zoom1").className = "";
298 document.getElementById("zoom2").className = "";
299 document.getElementById("zoom3").className = "";
300 document.getElementById("zoom"+this.zoom).className = "active";
301}
302 
303MainMap.prototype.checkTiles = function () {
304 var innerDiv = this.innerDiv;
305 var tileSize = this.tileSize;
306 var visibleTiles = this.getVisibleTiles();
307 var i;
3081unreal 
3099unreal var size = this.zoomDim[this.zoom].size;
310 for(i=0;i<visibleTiles.length; i++) {
311 var tile = visibleTiles[i];
312 var xy = "x" + tile.x + "y" + tile.y;
313 var tileName = xy + "z" + this.zoom;
31410unreal if (!visibleTilesMap[tileName]) {
315 var img = document.createElement("img");
3169unreal img.src = "size" + size + "/" + xy + ".jpg";
317 img.style.position = "absolute";
318 img.style.left = (tile.x * tileSize) + "px";
319 img.style.top = (tile.y * tileSize) + "px";
320 img.setAttribute("id", tileName);
321 innerDiv.appendChild(img);
32210unreal visibleTilesMap[tileName] = true;
3239unreal }
324 }
3251unreal 
3269unreal var imgs = innerDiv.getElementsByTagName("img");
327 for(i=0; i<imgs.length; i++) {
328 var id = imgs[i].getAttribute("id");
329 if (!visibleTilesMap[id]) {
330 innerDiv.removeChild(imgs[i]);
331 }
332 }
333}
3341unreal 
3359unrealMainMap.prototype.getVisibleTiles = function () {
336 var innerDiv = this.innerDiv;
337 var mapX = innerDiv.offsetLeft;
338 var mapY = innerDiv.offsetTop;
339 var tileSize = this.tileSize;
3401unreal 
3419unreal var startX = Math.abs(Math.floor(mapX / tileSize)) - 1;
342 if (startX < 0) startX = 0;
343 var startY = Math.abs(Math.floor(mapY / tileSize)) - 1;
344 if (startY < 0) startY = 0;
3451unreal 
3469unreal var visibleTiles = [];
347 var counter = 0;
34810unreal for (x = startX; x < (this.tilesX + startX); x++) {
349 for (y = startY; y < (this.tilesY + startY); y++) {
3509unreal var tile = {};
351 tile.x = x;
352 tile.y = y;
353 visibleTiles[counter++] = tile;
354 }
355 }
356 return visibleTiles;
357}
3581unreal 
3599unrealMainMap.prototype.stopMove = function (event) {
360 window.clearInterval(drawing_timer);
361 checkLinks();
362 is_adding = false;
363 checkLinks();
364 this.innerDiv.style.cursor = "url('grab.cur'), default";
365 this.f_dragging = false;
366}
3671unreal 
3689unreal// movement in the magnifier moves main map's view port
369MainMap.prototype.setViewPort = function () {
370 var magDiv = document.getElementById("magnifier");
371 var innerDiv = this.innerDiv;
372 var magLeft = magDiv.offsetLeft;
373 var magTop = magDiv.offsetTop;
374 var innerDivWidth = innerDiv.clientWidth;
375 var innerDivHeight = innerDiv.clientHeight;
3761unreal 
3779unreal /* set innerDivLeft */
378 var innerDivLeftMin = inres_x - innerDivWidth; //500
379 var innerDivLeft = Math.round((-magLeft) * innerDivWidth / magres_x);
380 if (innerDivLeft < innerDivLeftMin) innerDivLeft = innerDivLeftMin;
381 innerDiv.style.left = innerDivLeft + "px";
3821unreal 
3839unreal /* set innerDivTop */
384 var innerDivTopMin = inres_y - innerDivHeight; //400
385 var innerDivTop = Math.round((-magTop) * innerDivHeight / magres_y);
386 if (innerDivTop < innerDivTopMin) innerDivTop = innerDivTopMin;
387 innerDiv.style.top = innerDivTop + "px";
3881unreal 
3899unreal this.checkTiles();
390}
3911unreal 
3929unrealMainMap.prototype.setInnerDivSize = function (width, height, size, percent) {
393 var innerDiv = this.innerDiv;
394 innerDiv.style.width = width + "px";
395 innerDiv.style.height = height + "px";
396 magnifier.setPosition();
397 magnifier.setSize(width, height);
3981unreal 
3999unreal var resolutionInfo = document.getElementById("resolutionInfo");
400 resolutionInfo.innerHTML = percent + "%, " + width + " x " + height + "px";
401}
4021unreal 
4039unrealMainMap.prototype.setZoom = function (newZoom) {
404 is_adding = true;
405 if (this.zoom == newZoom) return;
406 window.clearInterval(drawing_timer);
407 actual_links = "";
408 numoflinks = 0;
409 var oldZ = this.zoomDim[this.zoom];
410 var newZ = this.zoomDim[newZoom];
411 var innerDiv = this.innerDiv;
412 var imgs = innerDiv.getElementsByTagName("img");
413 while (imgs.length > 0) {
414 innerDiv.removeChild(imgs[0]);
415 }
41610unreal visibleTilesMap = new Array();
4171unreal 
4189unreal var oldLeft = innerDiv.offsetLeft;
419 var oldTop = innerDiv.offsetTop;
420 var wdth = Math.round(((magres_x * inres_x) / newZ.width) - 2); // 200 * 700px
421 var hght = Math.round(((magres_y * inres_y) / newZ.height) - 2); // 141 * 500px
422 var wdth2 = Math.round(((magres_x * inres_x) / oldZ.width) - 2); // 200 * 700px
423 var hght2 = Math.round(((magres_y * inres_y) / oldZ.height) - 2); // 141 * 500px
4245unreal 
4259unreal innerDiv.style.left = Math.round(Math.round(newZ.width * oldLeft / oldZ.width) + ((wdth-wdth2)*4)) + "px";
426 innerDiv.style.top = Math.round(Math.round(newZ.height * oldTop / oldZ.height) + ((hght-hght2)*4)) + "px";
427 this.zoom = newZoom; // set the global zoom
428 this.setInnerDivSize(newZ.width, newZ.height, newZ.size, (newZ.nasobek*1000)/10);
429 maxnumoflinks = newZ.numoflinks;
4301unreal 
4319unreal this.checkZoom();
432 this.checkTiles();
4331unreal 
4349unreal deleteNames();
435 canvasInit(newZ.nasobek);
4361unreal 
4379unreal}
4381unreal 
4399unrealMainMap.prototype.doubleClick = function () {
440 if (this.zoom == 3) return;
441 this.setZoom(this.zoom + 1);
442}
4431unreal 
4449unrealMainMap.prototype.addNewLinks = function (minx, maxx, miny, maxy, linkname) {
445 var innerDiv = this.innerDiv;
446 var frameLeft = -innerDiv.offsetLeft;
447 var frameTop = -innerDiv.offsetTop;
448 var frameRight = frameLeft + inres_x;
449 var frameBottom = frameTop + inres_y;
450 var regexp = new RegExp(linkname + ' ', 'gi');
451 if(!regexp.test(actual_links)) {
452 return (minx <= frameRight && frameLeft <= maxx && miny <= frameBottom && frameTop <= maxy);
4531unreal }
4549unreal}
4551unreal 
4569unrealMainMap.prototype.removeOldLinks = function (minx, maxx, miny, maxy, linkname) {
457 var innerDiv = this.innerDiv;
458 var frameLeft = -innerDiv.offsetLeft;
459 var frameTop = -innerDiv.offsetTop;
460 var frameRight = frameLeft + inres_x;
461 var frameBottom = frameTop + inres_y;
462 var regexp = new RegExp(linkname + ' ', 'gi');
463 if(regexp.test(actual_links) && numoflinks>=maxnumoflinks) {
464 if(!(minx <= frameRight && frameLeft <= maxx && miny <= frameBottom && frameTop <= maxy)) {
465 actual_links = actual_links.replace(regexp, "");
466 var linkDOM = document.getElementById(linkname);
467 if(is_ie) {
468 linkDOM.parentNode.parentNode.removeChild(linkDOM.parentNode);
469 } else {
470 linkDOM.parentNode.removeChild(linkDOM);
471 }
472 numoflinks--;
473 return;
474 }
475 }
476}
4771unreal 
478 
4799unrealfunction canvasInit(nasobek) {
480 is_adding = true;
481 actual_links = "";
482 numoflinks = 0;
483 
484 div_paint = document.getElementById("paint");
485 div_points = document.getElementById("mapstats_points");
486 div_wave = document.getElementById("mapstats_wave");
487 div_infopoint = document.getElementById("mapstats_infopoint");
488 div_name = document.getElementById("mapstats_name");
489 div_ip = document.getElementById("mapstats_ip");
490 div_status = document.getElementById("mapstats_status");
491 
492 div_paint.style.width = parseInt(full_x*nasobek) + "px";
493 div_paint.style.height = parseInt(full_y*nasobek) + "px";
494 
495 var mapstats_over = document.getElementById("mapstats_over");
496 mapstats_over.style.width = parseInt(full_x*nasobek) + "px";
497 mapstats_over.style.height = parseInt(full_y*nasobek) + "px";
4981unreal 
4999unreal ann = nasobek;
500 var pozdrav2 = new Array();
501 var pozdr = new Array();
502 var pozdrav = file_nodes.split('\n');
503 var pozdrav1 = file_noping.split('\n');
504 var a_cnt = 0;
505 var p0count = pozdrav.length;
506 var p1count = pozdrav1.length;
5071unreal 
5089unreal for(a=0;a<p0count;a++){
509 if(pozdrav[a]!=false) {
510 node[a] = new Array();
511 pozdrav2 = pozdrav[a].split(';');
512 for(b=0;b<pozdrav2.length;b++){
513 node[a][b] = pozdrav2[b];
514 }
515 a_cnt++;
516 }
517 }
518 for(e=0;e<p1count;e++) {
519 if(pozdrav1[e]!=false) {
520 node[(e+a_cnt)] = new Array();
521 pozdr = pozdrav1[e].split(';');
522 for(f=0;f<pozdr.length;f++){
523 node[(e+a_cnt)][f] = pozdr[f];
524 }
525 }
526 }
5271unreal 
5289unreal nodecount = node.length;
529 var pozdrav3 = new Array();
530 var pozdrav4 = new Array();
531 var size;
532 var clrlnk;
533 m1 = 0; m1_a = 0;
534 m2 = 0; m2_a = 0;
535 m3 = 0; m3_a = 0;
536 m4 = 0; m4_a = 0;
537 m5 = 0; m5_a = 0;
538 m6 = 0; m6_a = 0;
539 m7 = 0; m7_a = 0;
540 m8 = 0; m8_a = 0;
541 m9 = 0; m9_a = 0;
542 cntm = 0;
543 
544 checkLinks();
5451unreal 
5469unreal 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;
5471unreal 
5489unreal var pozdrav5 = new Array();
549 var pozdrav6 = new Array();
550 if(ch_infopoint) {
551 if(file_infopoints.length>0) {
552 pozdrav5 = file_infopoints.split('\n');
553 for(d=0;d<pozdrav5.length;d++) {
554 if(pozdrav5[d]!=false) {
555 pozdrav6 = pozdrav5[d].split(';');
556 // Vykreslime si infopointy
557 if(ch_name) {
558 drawInfo(pozdrav6[0],pozdrav6[1],pozdrav6[2],nasobek);
5591unreal }
5609unreal drawInfoPoint(pozdrav6[1],pozdrav6[2],nasobek);
561 }
562 }
563 }
564 }
5651unreal 
5669unreal for(e=0;e<p1count;e++) {
567 if(pozdrav1[e]!="") {
568 if(ch_noping) {
569 if(node[(a_cnt+e)][3]==1) {
570 drawClient(node[(a_cnt+e)][1],node[(a_cnt+e)][2],nasobek);
571 if(ch_name) {
572 drawName(node[(a_cnt+e)][0],(node[(a_cnt+e)][1])-1,(node[(a_cnt+e)][2])-1,nasobek)
5731unreal }
5749unreal }
575 if(node[(a_cnt+e)][3]==2) {
576 drawSwitch(node[(a_cnt+e)][1],node[(a_cnt+e)][2],nasobek);
577 }
578 }
579 }
580 }
5811unreal 
5829unreal var pozdrav7 = file_state.split('\n');
583 var pozdrav8 = new Array();
584 var clrpnt;
585 var x_pos;
586 var y_pos;
587 var name_pos;
588 var title_pos;
589 var p7count = pozdrav7.length;
5901unreal 
5919unreal for(c=0;c<p7count;c++){
592 if(pozdrav7[c]!=false) {
593 pozdrav8 = pozdrav7[c].split(';');
594 if(pozdrav8[1]==1) { clrpnt = "on"; pozdrav8[2] = pozdrav8[2] + ' ms'; } else { clrpnt = "off"; pozdrav8[2] = "offline"; }
595 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
5961unreal 
5979unreal if(title_pos.toLowerCase()=="ap") {
598 if(ch_ap) {
599 drawAP(x_pos,y_pos,nasobek);
600 drawNode(x_pos,y_pos,nasobek,clrpnt);
601 if(ch_name) {
602 drawName(name_pos,x_pos,y_pos,nasobek);
603 }
604 if((ch_ip) && (ch_status)) {
605 drawStatus(pozdrav8[2],x_pos,y_pos,nasobek);
606 drawIP(pozdrav8[0],x_pos,y_pos,nasobek);
607 } else if((!ch_ip) && (ch_status)) {
608 drawStatus(pozdrav8[2],x_pos,y_pos-parseInt(12/nasobek),nasobek);
609 } else if((ch_ip) && (!ch_status)) {
610 drawIP(pozdrav8[0],x_pos,y_pos,nasobek);
611 }
612 }
613 } else if(title_pos.toLowerCase()=="router") {
614 if(ch_router) {
615 drawNode(x_pos,y_pos,nasobek,clrpnt);
616 if(ch_name) {
617 drawName(name_pos,x_pos,y_pos,nasobek);
6181unreal }
6199unreal if(ch_status) {
620 drawStatus(pozdrav8[2],x_pos,y_pos-parseInt(12/nasobek),nasobek);
6211unreal }
6229unreal }
623 } else {
624 if(ch_node) {
625 drawNode(x_pos,y_pos,nasobek,clrpnt);
626 if(ch_name) {
627 drawName(name_pos,x_pos,y_pos,nasobek);
628 }
629 }
630 }
631 }
632 }
6331unreal 
6349unreal var legend = document.getElementById('legend');
635 if((ch_legend) && (cntm>0)) {
636 drawLegend();
637 legend.style.display = "block";
638 } else {
639 legend.style.display = "none";
6401unreal }
6419unreal}
6421unreal 
6439unrealfunction drawLink(pos, size, nas, color) {
644 var linkname = "canvas" + pos.replace(/(#|&|_|\.|\:)/gi, "");
645 var points = new Array();
646 var posxy = new Array();
647 var coordinates = new Array();
648 var cor_x = new Array();
649 var cor_y = new Array();
650 points = pos.split('#');
651 var reg=/(\d+)&(\d+)/;
652 for(i=0;i<points.length;i++){
653 if (reg.test(points[i])) {
654 posxy = points[i].split('&');
655 coordinates[i*2] = parseInt(posxy[0]*nas);
656 coordinates[i*2+1] = parseInt(posxy[1]*nas);
657 cor_x.push(coordinates[i*2]);
658 cor_y.push(coordinates[i*2+1]);
659 } else {
660 coordinates[i*2] = parseInt(node2sour(points[i],1)*nas);
661 coordinates[i*2+1] = parseInt(node2sour(points[i],2)*nas);
662 cor_x.push(coordinates[i*2]);
663 cor_y.push(coordinates[i*2+1]);
664 }
6651unreal }
6669unreal 
667 var maxX = cor_x.max();
668 var minX = cor_x.min();
669 var maxY = cor_y.max();
670 var minY = cor_y.min();
671 if(is_adding) {
672 if(!mainMap.addNewLinks(minX, maxX, minY, maxY, linkname)) return;
673 } else {
674 if(!mainMap.removeOldLinks(minX, maxX, minY, maxY, linkname)) return;
675 }
676 numoflinks++;
677 actual_links = actual_links + linkname + " ";
678 var canvas = document.createElement("canvas");
679 canvas.width = maxX - minX + 10;
680 canvas.height = maxY - minY + 10;
681 canvas.id = linkname;
682 
683 if(is_ie) {
684 // for IE's VML absolute positioning
685 var div = document.createElement("div");
686 div.style.width = maxX - minX + 10 + "px";
687 div.style.height = maxY - minY + 10 + "px";
688 div.style.position = "absolute";
689 div.style.left = (minX - 5) + "px";
690 div.style.top = (minY - 5) + "px";
691 div.appendChild(canvas);
692 div_paint.appendChild(div);
693 G_vmlCanvasManager.initElement(canvas);
694 } else {
695 canvas.setAttribute("style", "position:absolute;left:" + (minX - 5) + "px;top:" + (minY - 5) + "px;");
696 div_paint.appendChild(canvas);
697 }
698 var ctx = document.getElementById(linkname).getContext('2d');
699 
700 minX -= 5;
701 minY -= 5;
7021unreal 
7039unreal ctx.lineJoin = "round";
704 ctx.strokeStyle = "rgb(20, 20, 20)";
705 ctx.lineWidth = size+1;
706 ctx.beginPath();
707 ctx.moveTo(coordinates[0]-minX,coordinates[1]-minY);
708 for(i=2;i<coordinates.length;i+=2){
709 ctx.lineTo(coordinates[i]-minX,coordinates[i+1]-minY);
7101unreal }
7119unreal ctx.stroke();
7121unreal 
7139unreal ctx.lineJoin = "round";
714 ctx.strokeStyle = "rgb(0, 0, 0)";
715 ctx.lineWidth = size+1;
716 ctx.beginPath();
717 ctx.moveTo(coordinates[0]-minX,coordinates[1]-minY);
718 for(i=2;i<coordinates.length;i+=2){
719 ctx.lineTo(coordinates[i]-minX,coordinates[i+1]-minY);
7201unreal }
7219unreal ctx.stroke();
7221unreal 
7239unreal ctx.lineJoin = "round";
724 ctx.strokeStyle = color;
725 ctx.lineWidth = size-1;
726 ctx.beginPath();
727 ctx.moveTo(coordinates[0]-minX,coordinates[1]-minY);
728 for(i=2;i<coordinates.length;i+=2){
729 ctx.lineTo(coordinates[i]-minX,coordinates[i+1]-minY);
7301unreal }
7319unreal ctx.stroke();
732}
7331unreal 
7349unrealfunction drawINPLink(pos, size, nas, color) {
735 var linkname = "canvas" + pos.replace(/(#|&|_|\.|\:)/gi, "");
736 var points = new Array();
737 var posxy = new Array();
738 var coordinates = new Array();
739 var cor_x = new Array();
740 var cor_y = new Array();
741 points = pos.split('#');
742 var reg=/(\d+)&(\d+)/;
743 for(i=0;i<points.length;i++){
744 if (reg.test(points[i])) {
745 posxy = points[i].split('&');
746 coordinates[i*2] = parseInt(posxy[0]*nas);
747 coordinates[i*2+1] = parseInt(posxy[1]*nas);
748 cor_x.push(coordinates[i*2]);
749 cor_y.push(coordinates[i*2+1]);
750 } else {
751 coordinates[i*2] = parseInt(node2sour(points[i],1)*nas);
752 coordinates[i*2+1] = parseInt(node2sour(points[i],2)*nas);
753 cor_x.push(coordinates[i*2]);
754 cor_y.push(coordinates[i*2+1]);
755 }
7561unreal }
7579unreal 
758 var maxX = cor_x.max();
759 var minX = cor_x.min();
760 var maxY = cor_y.max();
761 var minY = cor_y.min();
762 if(is_adding) {
763 if(!mainMap.addNewLinks(minX, maxX, minY, maxY, linkname)) return;
764 } else {
765 if(!mainMap.removeOldLinks(minX, maxX, minY, maxY, linkname)) return;
766 }
767 numoflinks++;
768 actual_links = actual_links + linkname + " ";
769 var canvas = document.createElement("canvas");
770 canvas.width = maxX - minX + 10;
771 canvas.height = maxY - minY + 10;
772 canvas.id = linkname;
773 
774 if(is_ie) {
775 // for IE's VML absolute positioning
776 var div = document.createElement("div");
777 div.style.width = maxX - minX + 10 + "px";
778 div.style.height = maxY - minY + 10 + "px";
779 div.style.position = "absolute";
780 div.style.left = (minX - 5) + "px";
781 div.style.top = (minY - 5) + "px";
782 div.appendChild(canvas);
783 div_paint.appendChild(div);
784 G_vmlCanvasManager.initElement(canvas);
785 } else {
786 canvas.setAttribute("style", "position:absolute;left:" + (minX - 5) + "px;top:" + (minY - 5) + "px;");
787 div_paint.appendChild(canvas);
788 }
789 var ctx = document.getElementById(linkname).getContext('2d');
790 
791 minX -= 5;
792 minY -= 5;
7931unreal 
7949unreal ctx.lineJoin = "round";
795 ctx.strokeStyle = "rgba(0, 0, 0, 0.1)";
796 ctx.lineWidth = size+1.5;
797 ctx.beginPath();
798 ctx.moveTo(coordinates[0]-minX,coordinates[1]-minY);
799 for(i=2;i<coordinates.length;i+=2){
800 ctx.lineTo(coordinates[i]-minX,coordinates[i+1]-minY);
8011unreal }
8029unreal ctx.stroke();
8031unreal 
8049unreal ctx.lineJoin = "round";
805 ctx.strokeStyle = color;
806 ctx.lineWidth = size+0.5;
807 ctx.beginPath();
808 ctx.moveTo(coordinates[0]-minX,coordinates[1]-minY);
809 for(i=2;i<coordinates.length;i+=2){
810 ctx.lineTo(coordinates[i]-minX,coordinates[i+1]-minY);
8111unreal }
8129unreal ctx.stroke();
813}
8141unreal 
8159unrealfunction checkLinks() {
816 if(file_links.length>0) {
817 pozdrav3 = file_links.split('\n');
818 var p3count = pozdrav3.length;
819 for(a=0;a<p3count;a++){
820 if(pozdrav3[a]!=false) {
821 pozdrav4 = pozdrav3[a].split(';');
822 if(pozdrav4[1].toLowerCase()=="backbone") { size = 4.1; } else { size = 2.7; }
823 if(pozdrav4[2].toLowerCase()!="inp") {
824 if(pozdrav4[3]==1) { clrlnk = wifi_client; m1 = 1; }
825 else if(pozdrav4[3]==2) { clrlnk = wifi_backbone; m2 = 1; }
826 else if(pozdrav4[3]==3) { clrlnk = eth_100; m3 = 1; }
827 else if(pozdrav4[3]==4) { clrlnk = fso; m4 = 1; }
828 else if(pozdrav4[3]==5) { clrlnk = fso_backup; m5 = 1; }
829 else if(pozdrav4[3]==6) { clrlnk = ghz5; m6 = 1; }
830 else if(pozdrav4[3]==7) { clrlnk = ghz10; m7 = 1; }
831 else if(pozdrav4[3]==8) { clrlnk = fiber; m8 = 1; }
832 else { clrlnk = other; m9 = 1; }
833 } else {
834 if(pozdrav4[3]==1) { clrlnk = wifi_client_a; m1_a = 1; }
835 else if(pozdrav4[3]==2) { clrlnk = wifi_backbone_a; m2_a = 1; }
836 else if(pozdrav4[3]==3) { clrlnk = eth_100_a; m3_a = 1; }
837 else if(pozdrav4[3]==4) { clrlnk = fso_a; m4_a = 1; }
838 else if(pozdrav4[3]==5) { clrlnk = fso_backup_a; m5_a = 1; }
839 else if(pozdrav4[3]==6) { clrlnk = ghz5_a; m6_a = 1; }
840 else if(pozdrav4[3]==7) { clrlnk = ghz10_a; m7_a = 1; }
841 else if(pozdrav4[3]==8) { clrlnk = fiber_a; m8_a = 1; }
842 else { clrlnk = other_a; m9_a = 1; }
843 }
844 
845 if(pozdrav4[2].toLowerCase()!="inp") {
846 if((ch_backbone && size==4.1) || (ch_client && size==2.7)) {
847 drawLink(pozdrav4[0], size, ann, clrlnk);
848 }
849 } else {
850 if(ch_inp) {
851 drawINPLink(pozdrav4[0], size-1, ann, clrlnk);
852 }
853 }
854 }
855 }
8561unreal }
8579unreal}
8581unreal 
8599unrealfunction drawNode(xo, yo, nas, img) {
860 xo = parseInt((xo*nas)-7);
861 yo = parseInt((yo*nas)-7);
862 var text = '<div class="node" style="position:absolute;left:' + xo + 'px;top:' + yo + 'px;background:url(\'' + img + '.png\');" unselectable = "on"></div>';
863 div_points.innerHTML += text;
864}
8651unreal 
8669unrealfunction drawAP(xn, yn, nas) {
867 xn = parseInt((xn*nas)-31);
868 yn = parseInt((yn*nas)-17);
869 var text = '<div class="ap" style="position:absolute;left:' + xn + 'px;top:' + yn + 'px;" unselectable = "on"></div>';
870 div_wave.innerHTML += text;
871}
8721unreal 
8739unrealfunction drawClient(xc, yc, nas) {
874 xc = parseInt((xc*nas)-7);
875 yc = parseInt((yc*nas)-7);
876 var text = '<div class="client" style="position:absolute;left:' + xc + 'px;top:' + yc + 'px;" unselectable = "on"></div>';
877 div_wave.innerHTML += text;
878}
8791unreal 
8809unrealfunction drawSwitch(xs, ys, nas) {
881 xs = parseInt((xs*nas)-6);
882 ys = parseInt((ys*nas)-6);
883 var text = '<div class="switch" style="position:absolute;left:' + xs + 'px;top:' + ys + 'px;" unselectable = "on"></div>';
884 div_wave.innerHTML += text;
885}
8861unreal 
8879unrealfunction drawInfoPoint(xl, yl, nas) {
888 xl = parseInt((xl*nas)-7);
889 yl = parseInt((yl*nas)-7);
890 var text = '<div class="infopoint" style="position:absolute;left:' + xl + 'px;top:' + yl + 'px;" unselectable = "on"></div>';
891 div_wave.innerHTML += text;
892}
8934unreal 
8949unrealfunction drawInfo(txt, xa, ya, nas) {
895 xa = parseInt((xa*nas)+6);
896 ya = parseInt((ya*nas)-13);
897 var text = '<div class="stitek" style="position:absolute;left:' + xa + 'px;top:' + ya + 'px;" unselectable = "on">' + txt + '</div>';
898 div_infopoint.innerHTML += text;
899}
9001unreal 
9019unrealfunction drawName(txt, xa, ya, nas) {
902 xa = parseInt((xa*nas)+6);
903 ya = parseInt((ya*nas)-13);
904 var text = '<div class="stitek" style="position:absolute;left:' + xa + 'px;top:' + ya + 'px;" unselectable = "on">' + txt + '</div>';
905 div_name.innerHTML += text;
906}
9071unreal 
9089unrealfunction drawIP(txt, xb, yb, nas) {
909 xb = parseInt((xb*nas)+6);
910 yb = parseInt((yb*nas)-1);
911 var text = '<div class="stitek" style="position:absolute;left:' + xb + 'px;top:' + yb + 'px;" unselectable = "on">' + txt + '</div>';
912 div_ip.innerHTML += text;
913}
9141unreal 
9159unrealfunction drawStatus(txt, xc, yc, nas) {
916 xc = parseInt((xc*nas)+6);
917 yc = parseInt((yc*nas)+11);
918 var text = '<div class="stitek" style="position:absolute;left:' + xc + 'px;top:' + yc + 'px;" unselectable = "on">' + txt + '</div>';
919 div_status.innerHTML += text;
920}
9211unreal 
9229unrealfunction drawLegendText(txt) {
923 document.getElementById("mapstats_legend").innerHTML = '<div class="legend" unselectable = "on">' + txt + '</div>';
924}
9251unreal 
9269unrealfunction drawLegend() {
927 var epsilon;
928 var cislo = 0;
929 var name = "";
930 var paintlegend = document.getElementById('paintlegend');
931 paintlegend.height = (((cntm-1) * 12)+13);
932 paintlegend.width = "25";
933 var ctx = paintlegend.getContext('2d');
934 ctx.clearRect(0,0,25,((cntm-1) * 12)+13);
935 if(m1==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,wifi_client,2.7); name = name + name1 + "<br/>"; cislo++; }
936 if(m2==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,wifi_backbone,4.1); name = name + name2 + "<br/>"; cislo++; }
937 if(m3==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,eth_100,4.1); name = name + name3 + "<br/>"; cislo++; }
938 if(m4==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,fso,4.1); name = name + name4 + "<br/>"; cislo++; }
939 if(m5==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,fso_backup,4.1); name = name + name5 + "<br/>"; cislo++; }
940 if(m6==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,ghz5,4.1); name = name + name6 + "<br/>"; cislo++; }
941 if(m7==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,ghz10,4.1); name = name + name7 + "<br/>"; cislo++; }
942 if(m8==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,fiber,4.1); name = name + name8 + "<br/>"; cislo++; }
943 if(m9==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,other,4.1); name = name + name9 + "<br/>"; cislo++; }
944 if(m1_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,wifi_client_a,2.7); name = name + name1 + " " + inp + "<br/>"; cislo++; }
945 if(m2_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,wifi_backbone_a,4.1); name = name + name2 + " " + inp + "<br/>"; cislo++; }
946 if(m3_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,eth_100_a,4.1); name = name + name3 + " " + inp + "<br/>"; cislo++; }
947 if(m4_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,fso_a,4.1); name = name + name4 + " " + inp + "<br/>"; cislo++; }
948 if(m5_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,fso_backup_a,4.1); name = name + name5 + " " + inp + "<br/>"; cislo++; }
949 if(m6_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,ghz5_a,4.1); name = name + name6 + " " + inp + "<br/>"; cislo++; }
950 if(m7_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,ghz10_a,4.1); name = name + name7 + " " + inp + "<br/>"; cislo++; }
951 if(m8_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,fiber_a,4.1); name = name + name8 + " " + inp + "<br/>"; cislo++; }
952 if(m9_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,other_a,4.1); name = name + name9 + " " + inp + "<br/>"; }
953 drawLegendText(name);
954}
9551unreal 
9569unrealfunction drawLegendLink(yg,color,size) {
957 var ctx = document.getElementById('paintlegend').getContext('2d');
958 ctx.strokeStyle = "rgb(20, 20, 20)";
959 ctx.lineWidth = size+1;
960 ctx.beginPath();
961 ctx.moveTo(1,yg);
962 ctx.lineTo(24,yg);
963 ctx.stroke();
9641unreal 
9659unreal ctx.strokeStyle = "rgb(0, 0, 0)";
966 ctx.lineWidth = size;
967 ctx.beginPath();
968 ctx.moveTo(1,yg);
969 ctx.lineTo(24,yg);
970 ctx.stroke();
9711unreal 
9729unreal ctx.strokeStyle = color;
973 ctx.lineWidth = size-1;
974 ctx.beginPath();
975 ctx.moveTo(1,yg);
976 ctx.lineTo(24,yg);
977 ctx.stroke();
978}
9791unreal 
9809unrealfunction drawLegendINPLink(yg,color,size) {
981 var ctx = document.getElementById('paintlegend').getContext('2d');
982 ctx.strokeStyle = "rgba(255, 255, 255, 0.5)";
983 ctx.lineWidth = size;
984 ctx.beginPath();
985 ctx.moveTo(1,yg);
986 ctx.lineTo(24,yg);
987 ctx.stroke();
9881unreal 
9899unreal ctx.strokeStyle = "rgba(0, 0, 0, 0.1)";
990 ctx.lineWidth = size;
991 ctx.beginPath();
992 ctx.moveTo(1,yg);
993 ctx.lineTo(24,yg);
994 ctx.stroke();
9955unreal 
9969unreal ctx.strokeStyle = color;
997 ctx.lineWidth = size-0.5;
998 ctx.beginPath();
999 ctx.moveTo(1,yg);
1000 ctx.lineTo(24,yg);
1001 ctx.stroke();
1002}
10031unreal 
10049unrealfunction clearMap() {
1005 div_paint.innerHTML = "";
1006}
10071unreal 
10089unrealfunction node2sour(name, pos) {
1009 var ok = 0;
1010 for(k=0;k<nodecount;k++){
1011 if(node[k][0]==name) {
1012 ok = node[k][pos];
1013 }
1014 if(ok!=0) { return ok; }
10151unreal }
10169unreal return ok;
1017}
10181unreal 
10199unrealfunction ip2sour(ip, pos) {
1020 var ok = 0;
1021 for(k=0;k<nodecount;k++){
1022 if(node[k][4]==ip) {
1023 ok = node[k][pos];
1024 }
1025 if(ok!=0) { return ok; }
10261unreal }
10279unreal return ok;
1028}
10291unreal 
10309unrealfunction loadFiles() {
1031 var d = new Date();
1032 var tm = d.getTime();
1033 file_nodes = getFile(nodes + "?" + tm);
1034 file_noping = getFile(noping + "?" + tm);
1035 file_links = getFile(links + "?" + tm);
1036 file_infopoints = getFile(infopoints + "?" + tm);
1037 file_state = getFile(state + "?" + tm);
1038 redrawUpdate();
1039}
10401unreal 
10419unrealfunction getFile(url) {
1042 AJAX = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : false));
1043 if (AJAX) {
1044 AJAX.open("GET", url, false);
1045 AJAX.setRequestHeader("Cache-Control", "no-store");
1046 AJAX.setRequestHeader("Cache-Control", "no-cache");
1047 AJAX.setRequestHeader("Cache-Control", "must-revalidate");
1048 AJAX.setRequestHeader("Pragma", "no-cache");
1049 AJAX.send(null);
1050 return AJAX.responseText;
1051 } else {
1052 return false;
1053 }
1054}
10551unreal 
10569unrealfunction setAutoLoader() {
1057 // auto-downloading source files every 2 minutes
1058 setInterval("loadFiles()", 2 * 60 * 1000);
1059}
10601unreal 
10619unrealfunction setCheckboxes() {
1062 document.form_map.ch_ap.checked = ch_ap;
1063 document.form_map.ch_router.checked = ch_router;
1064 document.form_map.ch_node.checked = ch_node;
1065 document.form_map.ch_infopoint.checked = ch_infopoint;
1066 document.form_map.ch_noping.checked = ch_noping;
1067 document.form_map.ch_legend.checked = ch_legend;
1068 document.form_map.ch_name.checked = ch_name;
1069 document.form_map.ch_ip.checked = ch_ip;
1070 document.form_map.ch_status.checked = ch_status;
1071 document.form_map.ch_backbone.checked = ch_backbone;
1072 document.form_map.ch_client.checked = ch_client;
1073 document.form_map.ch_inp.checked = ch_inp;
1074}
1075 
1076function deleteNames() {
1077 div_paint.innerHTML = "";
1078 div_points.innerHTML = "";
1079 div_wave.innerHTML = "";
1080 div_infopoint.innerHTML = "";
1081 div_name.innerHTML = "";
1082 div_ip.innerHTML = "";
1083 div_status.innerHTML = "";
1084 document.getElementById("mapstats_legend").innerHTML = "";
1085}
10861unreal 
10879unrealfunction reDraw() {
1088 if(document.form_map.ch_ap.checked) { ch_ap = true; } else { ch_ap = false; }
1089 if(document.form_map.ch_router.checked) { ch_router = true; } else { ch_router = false; }
1090 if(document.form_map.ch_node.checked) { ch_node = true; } else { ch_node = false; }
1091 if(document.form_map.ch_infopoint.checked) { ch_infopoint = true; } else { ch_infopoint = false; }
1092 if(document.form_map.ch_noping.checked) { ch_noping = true; } else { ch_noping = false; }
1093 if(document.form_map.ch_legend.checked) { ch_legend = true; } else { ch_legend = false; }
1094 if(document.form_map.ch_name.checked) { ch_name = true; } else { ch_name = false; }
1095 if(document.form_map.ch_ip.checked) { ch_ip = true; } else { ch_ip = false; }
1096 if(document.form_map.ch_status.checked) { ch_status = true; } else { ch_status = false; }
1097 if(document.form_map.ch_backbone.checked) { ch_backbone = true; } else { ch_backbone = false; }
1098 if(document.form_map.ch_client.checked) { ch_client = true; } else { ch_client = false; }
1099 if(document.form_map.ch_inp.checked) { ch_inp = true; } else { ch_inp = false; }
1100 deleteNames();
1101 clearMap();
1102 canvasInit(ann);
1103}
11041unreal 
11059unrealfunction changeOpacity(opc) {
1106 var opcprc = opc / 100;
1107 var mapstats_update = document.getElementById("mapstats_update");
11081unreal 
11099unreal if (is_ie) {
1110 mapstats_update.style.filter = 'alpha(opacity=' + opc + ');';
1111 } else {
1112 mapstats_update.style.setProperty("-moz-opacity",opcprc,null);
1113 mapstats_update.style.setProperty("opacity",opcprc,null);
11141unreal }
11159unreal}
11161unreal 
11179unrealfunction changeUpdate() {
1118 var promenna = new Date();
1119 var rok = promenna.getFullYear();
1120 var mesic = "" + (promenna.getMonth() + 1);
1121 var den = "" + (promenna.getDate());
1122 var hodin = "" + (promenna.getHours());
1123 var minut = "" + (promenna.getMinutes());
1124 var sekund = "" + (promenna.getSeconds());
1125 if(mesic.length==1) { mesic = "0" + mesic; }
1126 if(den.length==1) { den = "0" + den; }
1127 if(hodin.length==1) { hodin = "0" + hodin; }
1128 if(minut.length==1) { minut = "0" + minut; }
1129 if(sekund.length==1) { sekund = "0" + sekund; }
1130 document.getElementById("mapstats_update").innerHTML = den + ". " + mesic + ". " + rok + " " + hodin + ":" + minut + ":" + sekund;
1131}
1132 
1133function redrawUpdate() {
1134 setTimeout("changeOpacity(90)",100);
1135 setTimeout("changeOpacity(80)",200);
1136 setTimeout("changeOpacity(70)",300);
1137 setTimeout("changeOpacity(60)",400);
1138 setTimeout("changeOpacity(50)",500);
1139 setTimeout("changeOpacity(40)",600);
1140 setTimeout("changeOpacity(30)",700);
1141 setTimeout("changeOpacity(20)",800);
1142 setTimeout("changeOpacity(10)",900);
1143 setTimeout("changeOpacity(0)",1000);
1144 setTimeout("changeUpdate()",1050);
1145 setTimeout("changeOpacity(10)",1100);
1146 setTimeout("changeOpacity(20)",1200);
1147 setTimeout("changeOpacity(30)",1300);
1148 setTimeout("changeOpacity(40)",1400);
1149 setTimeout("changeOpacity(50)",1500);
1150 setTimeout("changeOpacity(60)",1600);
1151 setTimeout("changeOpacity(70)",1700);
1152 setTimeout("changeOpacity(80)",1800);
1153 setTimeout("changeOpacity(90)",1900);
1154 setTimeout("changeOpacity(100)",2000);
1155}

Powered by WebSVN 2.2.1