From 01c613d4e27d5e8245846ab22ce704422798dd84 Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Tue, 10 Mar 2009 00:39:15 -0500 Subject: start migrating javascript to prototype --- config/imspector/services_imspector_logs.php | 36 +++++++++++++++------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'config/imspector') diff --git a/config/imspector/services_imspector_logs.php b/config/imspector/services_imspector_logs.php index fce9b892..14881bc6 100644 --- a/config/imspector/services_imspector_logs.php +++ b/config/imspector/services_imspector_logs.php @@ -151,6 +151,8 @@ include("head.inc"); //echo $pfSenseHead->getHTML(); ?> + +
@@ -188,7 +190,7 @@ function xmlhttpPost() updatepage(self.xmlHttpReq.responseText); } - document.getElementById('im_status').style.display = "inline"; + $('im_status').style.display = "inline"; self.xmlHttpReq.send("mode=render§ion=" + section); } @@ -204,25 +206,25 @@ function updatepage(str) if (!a[1] || !a[2] || !a[3]) continue; /* create titling information if needed */ - if (!document.getElementById(a[1])) { - document.getElementById('im_convos').innerHTML += + if (!$(a[1])) { + $('im_convos').innerHTML += "
" + a[1] + "
" + "
"; } - if (!document.getElementById(a[1] + "_" + a[2])) { + if (!$(a[1] + "_" + a[2])) { var imageref = ""; if (a[0]) imageref = "" + a[1] + ""; - document.getElementById(a[1]).innerHTML += + $(a[1]).innerHTML += "
" + imageref + a[2] + "
" + "
"; } - if (!document.getElementById(a[1] + "_" + a[2] + "_" + a[3])) { - document.getElementById(a[1] + "_" + a[2]).innerHTML += + if (!$(a[1] + "_" + a[2] + "_" + a[3])) { + $(a[1] + "_" + a[2]).innerHTML += "
" + a[3] + "
" + "
"; } - if (!document.getElementById(a[1] + "_" + a[2] + "_" + a[3] + "_" + a[4])) { - document.getElementById(a[1] + "_" + a[2] + "_" + a[3]).innerHTML += + if (!$(a[1] + "_" + a[2] + "_" + a[3] + "_" + a[4])) { + $(a[1] + "_" + a[2] + "_" + a[3]).innerHTML += "
»" + a[4] + "
"; @@ -236,21 +238,21 @@ function updatepage(str) if (!details[1]) title = " "; if (!parts[2]) parts[2] = " "; - document.getElementById('im_status').style.display = "none"; - var bottom = parseInt(document.getElementById('im_content').scrollTop); - var bottom2 = parseInt(document.getElementById('im_content').style.height); + $('im_status').style.display = "none"; + var bottom = parseInt($('im_content').scrollTop); + var bottom2 = parseInt($('im_content').style.height); var absheight = parseInt( bottom + bottom2 ); - if (absheight == document.getElementById('im_content').scrollHeight) { + if (absheight == $('im_content').scrollHeight) { moveit = 1; } else { moveit = 0; } - document.getElementById('im_content').innerHTML = parts[2]; + $('im_content').innerHTML = parts[2]; if (moveit == 1) { - document.getElementById('im_content').scrollTop = 0; - document.getElementById('im_content').scrollTop = document.getElementById('im_content').scrollHeight; + $('im_content').scrollTop = 0; + $('im_content').scrollTop = $('im_content').scrollHeight; } - document.getElementById('im_content_title').innerHTML = title; + $('im_content_title').update = title; the_timeout = setTimeout( "xmlhttpPost();", 5000 ); } -- cgit v1.2.3