Commit f808e492 authored by Leigh Stoller's avatar Leigh Stoller

An attempt to be a little bit more browser independent! Not sure I

have made any progress yet.
parent b4429b1b
...@@ -24,3 +24,13 @@ function PageReplace(URL) ...@@ -24,3 +24,13 @@ function PageReplace(URL)
window.location.replace(URL); window.location.replace(URL);
} }
function IframeDocument(id)
{
var oIframe = document.getElementById(id);
var oDoc = (oIframe.contentWindow || oIframe.contentDocument);
if (oDoc.document) {
oDoc = oDoc.document;
}
return oDoc;
}
...@@ -162,8 +162,8 @@ function ml_getScrollHeight() { ...@@ -162,8 +162,8 @@ function ml_getScrollHeight() {
*/ */
function ml_handleReadyState(state) { function ml_handleReadyState(state) {
var Iframe = document.getElementById('outputframe'); var Iframe = document.getElementById('outputframe');
var idoc = Iframe.contentWindow.document; var idoc = IframeDocument('outputframe');
var oa = Iframe.contentWindow.document.getElementById('outputarea'); var oa = idoc.getElementById('outputarea');
var dl = document.getElementById('downloader'); var dl = document.getElementById('downloader');
if ((rt = ml_getBodyText(dl)) == null) { if ((rt = ml_getBodyText(dl)) == null) {
...@@ -353,8 +353,8 @@ function ml_handleReadyState(state) { ...@@ -353,8 +353,8 @@ function ml_handleReadyState(state) {
/* See if we should scroll the window down. */ /* See if we should scroll the window down. */
if ((h - (y + ih)) < (y == 0 ? 200 : 10)) { if ((h - (y + ih)) < (y == 0 ? 200 : 10)) {
Iframe.contentWindow.document.documentElement.scrollTop = nh; idoc.documentElement.scrollTop = nh;
Iframe.contentWindow.document.body.scrollTop = nh; idoc.body.scrollTop = nh;
} }
} }
} }
...@@ -97,6 +97,7 @@ function STARTLOG($pid, $eid) ...@@ -97,6 +97,7 @@ function STARTLOG($pid, $eid)
echo "<script type='text/javascript' language='javascript'>\n"; echo "<script type='text/javascript' language='javascript'>\n";
echo "function SetupOutputArea() { echo "function SetupOutputArea() {
var Iframe = document.getElementById('outputframe'); var Iframe = document.getElementById('outputframe');
var IframeDoc = IframeDocument('outputframe');
var winheight = 0; var winheight = 0;
var yoff = 0; var yoff = 0;
...@@ -114,9 +115,9 @@ function STARTLOG($pid, $eid) ...@@ -114,9 +115,9 @@ function STARTLOG($pid, $eid)
// Now get the Y offset of the outputframe. // Now get the Y offset of the outputframe.
yoff = Iframe.offsetTop; yoff = Iframe.offsetTop;
Iframe.contentWindow.document.open(); IframeDoc.open();
Iframe.contentWindow.document.write('<html><head><base href=$BASEPATH/></head><body><pre id=outputarea></pre></body></html>'); IframeDoc.write('<html><head><base href=$BASEPATH/></head><body><pre id=outputarea></pre></body></html>');
Iframe.contentWindow.document.close(); IframeDoc.close();
if (winheight != 0) if (winheight != 0)
// Now calculate how much room is left and make the iframe // Now calculate how much room is left and make the iframe
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment