File: 1.10.0a/server/web/js/monitor.popup.js (View as HTML)

  1: var openNode = "";
  2: 
  3: function nodeClick(nodeid)
  4: {
  5: if (openNode==nodeid)
  6: 	{ // already open so goto node page...
  7: 	window.location.href = "node.php?nodeid=" + nodeid;
  8: 	return 0;
  9: 	}
 10: openNode = nodeid;
 11: popup = document.getElementById('popup_div');
 12: popup.innerHTML = popupTop + "Loading..." + popupBottom;
 13: popup.style.left = (MouseX-10) + 'px';
 14: popup.style.top = MouseY + 'px';
 15: popup.style.display = 'block';
 16: 
 17: var xmlhttp=false;
 18: if (window.XMLHttpRequest)
 19: 	{
 20: 	xmlhttp=new XMLHttpRequest();
 21: 	if (xmlhttp.overrideMimeType) xmlhttp.overrideMimeType('text/xml');
 22: 	}
 23: else if (window.ActiveXObject)
 24: 	{
 25: 	try
 26: 		{
 27: 		xmlhttp = new ActiveXObject("Msxml2.HTTP");
 28: 		}
 29: 	catch(e)
 30: 		{
 31: 		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 32: 		}
 33: 	}
 34: 
 35: if (!xmlhttp)
 36: 	{
 37: 	alert("Cannot Create XML HTTP Request Object");
 38: 	return false;
 39: 	}
 40: 
 41: xmlhttp.onreadystatechange = function()
 42: 	{
 43: 	if (xmlhttp.readyState == 4)
 44: 		{
 45: 		if (xmlhttp.status == 200)
 46: 			{
 47: 			popup.innerHTML = popupTop + xmlhttp.responseText + popupBottom;
 48: 			}
 49: 		else
 50: 			{
 51: 			popup.innerHTML = popupTop + "Error Code Returned: " + xmlhttp.status + popupBottom;
 52: 			}
 53: 		}
 54: 	}
 55: 	
 56: var url="monitor.popup.php?type=node&nodeid="+nodeid;
 57: xmlhttp.open("GET",url,true);
 58: xmlhttp.send(null);
 59: 
 60: 
 61: }
 62: 
 63: function closePopup()
 64: {
 65: openNode="";
 66: document.getElementById('popup_div').style.display = 'none';
 67: }
 68: 
 69: var popupTop = "<div class=\"popup_top\"><a href=\"javascript:closePopup();\">X</a></div>";
 70: var popupBottom = "<div class=\"popup_bottom\"><a href=\"javascript:closePopup();\">close</a></div>";
 71: 
 72: var isIE = false;
 73: if (document.all) isIE=true;
 74: 
 75: var MouseX=0;
 76: var MouseY=0;
 77: 
 78: function recordMouse(e)
 79: {
 80: if (!e) e=window.event;
 81: if (isIE)
 82: 	{
 83: 	MouseX = e.clientX + document.body.scrollLeft;
 84: 	MouseY = e.clientY + document.body.scrollTop;
 85: 	}
 86: else
 87: 	{
 88: 	MouseX = e.pageX;
 89: 	MouseY = e.pageY;
 90: 	}
 91: }
 92: 
 93: if (!isIE) document.captureEvents(Event.MOUSEMOVE);
 94: 
 95: if (window.addEventListener) document.addEventListener("mousemove",recordMouse,false);
 96: else if (window.attachEvent) document.attachEvent("onmousemove",recordMouse);
 97: else document.onmousemove = recordMouse;
 98: 
 99: