Page 1 of 1

[Nagios-devel] Patch: statusmap popups with mozilla

Posted: Wed Apr 17, 2002 7:42 am
by Guest
Hi,

here is a patch against statusmap.c from nagios-1.0a7 to enable the
host-popups with mozilla.

Long live the lizard!

Have fun,
bkw


--- cgi/statusmap.c.orig Tue Feb 26 05:03:34 2002
+++ cgi/statusmap.c Wed Apr 17 17:22:55 2002
@@ -2293,23 +2293,27 @@
printf("function showPopup(text, eventObj){\n");
printf("ieLayer = 'document.all[\\'popup\\']';\n");
printf("nnLayer = 'document.layers[\\'popup\\']';\n");
+ printf("moLayer = 'document.getElementById(\\'popup\\')';\n");

- printf("if(!(document.all||document.layers)) return;\n");
+ printf("if(!(document.all||document.layers||document.documentElement)) return;\n");

- printf("if(document.all) document.popup=eval(ieLayer);\n");
- printf("else document.popup=eval(nnLayer);\n");
+ printf("if(document.all) { document.popup=eval(ieLayer); }\n");
+ printf("else {\n");
+ printf(" if (document.documentElement) document.popup=eval(moLayer);\n");
+ printf(" else document.popup=eval(nnLayer);\n");
+ printf("}\n");

printf("var table = \"\";\n");

- printf("if (document.all){\n");
+ printf("if (document.all||document.documentElement){\n");
printf("table += \"\";\n",background_color,border,padding);
printf("table += \"\";\n");
printf("table += \"\";\n",padding);
printf("table += \"\" + text + \"\";\n",background_color);
printf("table += \"\"\n");
printf("document.popup.innerHTML = table;\n");
- printf("document.popup.style.left = eventObj.x + %d;\n",x_offset);
- printf("document.popup.style.top = eventObj.y + %d;\n",y_offset);
+ printf("document.popup.style.left = (document.all ? eventObj.x : eventObj.layerX) + %d;\n",x_offset);
+ printf("document.popup.style.top = (document.all ? eventObj.y : eventObj.layerY) + %d;\n",y_offset);
printf("document.popup.style.visibility = \"visible\";\n");
printf("} \n");

@@ -2339,9 +2343,9 @@
printf("}\n");

printf("function hidePopup(){ \n");
- printf("if (!(document.all || document.layers)) return;\n");
+ printf("if (!(document.all || document.layers || document.documentElement)) return;\n");
printf("if (document.popup == null){ }\n");
- printf("else if (document.all) document.popup.style.visibility = \"hidden\";\n");
+ printf("else if (document.all||document.documentElement) document.popup.style.visibility = \"hidden\";\n");
printf("else document.popup.visibility = \"hidden\";\n");
printf("document.popup = null;\n");
printf("}\n");





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: bkw@weisshuhn.de