I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 0deaab7c authored by str4d's avatar str4d
Browse files

Improvements to resizing JS in iframed app container pages

parent c6d45b22
No related branches found
No related tags found
No related merge requests found
...@@ -21,16 +21,20 @@ ...@@ -21,16 +21,20 @@
var failMessage = "<hr><b><%=intl._("Router is down")%><\/b>"; var failMessage = "<hr><b><%=intl._("Router is down")%><\/b>";
function requestAjax1() { ajax("/xhr1.jsp?requestURI=<%=request.getRequestURI()%>", "xhr", <%=intl.getRefresh()%>000); } function requestAjax1() { ajax("/xhr1.jsp?requestURI=<%=request.getRequestURI()%>", "xhr", <%=intl.getRefresh()%>000); }
function initAjax() { setTimeout(requestAjax1, <%=intl.getRefresh()%>000); } function initAjax() { setTimeout(requestAjax1, <%=intl.getRefresh()%>000); }
function injectClass(f) {
f.className += ' iframed';
var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document;
doc.body.className += ' iframed';
doc.getElementsByClassName('panel')[0].className += ' iframed';
}
function resizeFrame(f) { function resizeFrame(f) {
var body = f.contentWindow.document.body, var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document;
html = f.contentWindow.document.documentElement; f.style.height = doc.body.offsetHeight + "px";
f.style.height = body.scrollHeight + "px";
} }
function injectClass(f) { f.contentWindow.document.body.setAttribute('class', 'iframed'); }
function setupFrame() { function setupFrame() {
f = document.getElementById("i2ptunnelframe"); f = document.getElementById("i2ptunnelframe");
resizeFrame(f);
injectClass(f); injectClass(f);
resizeFrame(f);
} }
</script> </script>
</head><body onload="initAjax()"> </head><body onload="initAjax()">
......
...@@ -21,12 +21,19 @@ ...@@ -21,12 +21,19 @@
var failMessage = "<hr><b><%=intl._("Router is down")%><\/b>"; var failMessage = "<hr><b><%=intl._("Router is down")%><\/b>";
function requestAjax1() { ajax("/xhr1.jsp?requestURI=<%=request.getRequestURI()%>", "xhr", <%=intl.getRefresh()%>000); } function requestAjax1() { ajax("/xhr1.jsp?requestURI=<%=request.getRequestURI()%>", "xhr", <%=intl.getRefresh()%>000); }
function initAjax() { setTimeout(requestAjax1, <%=intl.getRefresh()%>000); } function initAjax() { setTimeout(requestAjax1, <%=intl.getRefresh()%>000); }
function resizeFrame(f) { f.style.height = f.contentWindow.document.body.scrollHeight + "px"; } function injectClass(f) {
function injectClass(f) { f.contentWindow.document.body.setAttribute('class', 'iframed'); } f.className += ' iframed';
var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document;
doc.body.className += ' iframed';
}
function resizeFrame(f) {
var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document;
f.style.height = doc.body.offsetHeight + "px";
}
function setupFrame() { function setupFrame() {
f = document.getElementById("i2psnarkframe"); f = document.getElementById("i2psnarkframe");
resizeFrame(f);
injectClass(f); injectClass(f);
resizeFrame(f);
} }
</script> </script>
</head><body onload="initAjax()"> </head><body onload="initAjax()">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment