Use JS injection to allow iframe-specific I2PTunnel styling

This commit is contained in:
str4d
2012-06-21 23:47:49 +00:00
parent ab1144865f
commit 8412bafc5c
3 changed files with 13 additions and 2 deletions

View File

@ -22,8 +22,11 @@
function requestAjax1() { ajax("/xhr1.jsp?requestURI=<%=request.getRequestURI()%>", "xhr", <%=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) { f.contentWindow.document.getElementsByTagName('body')[0].setAttribute('class', 'iframed'); }
function init() {
resizeFrame(document.getElementById("i2ptunnelframe"));
f = document.getElementById("i2ptunnelframe");
resizeFrame(f);
injectClass(f);
initAjax();
}
</script>
@ -33,7 +36,7 @@
<h1><%=intl._("I2P Tunnel Manager")%></h1>
<div class="main" id="main">
<iframe src="/i2ptunnel/" width="100%" frameborder="0" border="0" name="i2ptunnelframe" id="i2ptunnelframe" onload="resizeFrame(document.getElementById('i2ptunnelframe'))">
<iframe src="/i2ptunnel/" width="100%" height="100%" frameborder="0" border="0" name="i2ptunnelframe" id="i2ptunnelframe" onload="resizeFrame(document.getElementById('i2ptunnelframe'))" allowtransparency="true">
</iframe>
</div></body></html>
<%

View File

@ -18,6 +18,10 @@ body {
box-sizing: border-box;
}
body.iframed {
background: transparent url('images/transparent.gif') !important;
}
div {
-moz-box-sizing: border-box;
box-sizing: border-box;
@ -213,6 +217,10 @@ hr {
padding: 10px 20px;
}
.iframed .panel {
margin: 16px auto -7px auto !important;
}
.panel .footer {
float: right;
padding: 4px;

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B