提交 b5ab23dc authored 作者: noelgrandin's avatar noelgrandin

Issue 554: Web Console in an IFrame not fully supported

上级 34f4d033
......@@ -25,6 +25,7 @@ Change Log
at session commit (LobStorageMap.removeLob).
</li><li>Remove the "h2.MAX_MEMORY_ROWS_DISTINCT" system property to reduce confusion.
We already have the MAX_MEMORY_ROWS setting which does a very similar thing, and is better documented.
</li><li>Issue 554: Web Console in an IFrame not fully supported
</li></ul>
<h2>Version 1.4.177 Beta (2014-04-12)</h2>
......
......@@ -1273,7 +1273,7 @@ public class WebApp {
sqlUpper.indexOf("RUNSCRIPT") >= 0) {
String sessionId = attributes.getProperty("jsessionid");
buff.append("<script type=\"text/javascript\">" +
"top['h2menu'].location='tables.do?jsessionid="
"parent['h2menu'].location='tables.do?jsessionid="
+ sessionId + "';</script>");
}
Statement stat;
......
......@@ -11,15 +11,6 @@ Initial Developer: H2 Group
<meta name="viewport" content="width=device-width, initial-scale=0.9" />
<title>${text.a.title}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script type="text/javascript">
<!--
if (self != top) {
top.location = "admin.jsp";
}
//-->
</script>
</head>
<body style="margin: 20px">
<h1>
......
......@@ -10,15 +10,6 @@ Initial Developer: H2 Group
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>${text.a.title}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script type="text/javascript">
<!--
if (self != top) {
top.location = "adminLogin.jsp";
}
//-->
</script>
</head>
<body style="margin: 20px">
<form name="adminLogin" method="post" action="admin.do?jsessionid=${sessionId}">
......
......@@ -17,7 +17,7 @@ Initial Developer: H2 Group
<table class="toolbar" cellspacing="0" cellpadding="0">
<tr class="toolbar">
<td class="toolbar">
<a href="logout.do?jsessionid=${sessionId}" target="_top">
<a href="logout.do?jsessionid=${sessionId}" target="_parent">
<img src="icon_disconnect.gif"
onmouseover="this.className ='icon_hover'"
onmouseout="this.className ='icon'"
......@@ -36,7 +36,7 @@ Initial Developer: H2 Group
</td>
<td class="toolbar">
<input type="checkbox" name="autoCommit" value="autoCommit" onclick=
"javascript:top.frames['h2result'].document.location='query.do?jsessionid=${sessionId}&amp;sql=@autocommit_' + (document.header.autoCommit.checked ? 'true' : 'false') + '.';"/>
"javascript:parent.h2result.document.location='query.do?jsessionid=${sessionId}&amp;sql=@autocommit_' + (document.header.autoCommit.checked ? 'true' : 'false') + '.';"/>
</td>
<td class="toolbar">
${text.toolbar.autoCommit}&nbsp;
......@@ -63,7 +63,7 @@ Initial Developer: H2 Group
</td>
<td class="toolbar">
<select name="rowcount" size="1" onchange=
"javascript:top.frames['h2result'].document.location='query.do?jsessionid=${sessionId}&amp;sql=@maxrows+'+header.rowcount.value+'.';">
"javascript:parent.h2result.document.location='query.do?jsessionid=${sessionId}&amp;sql=@maxrows+'+header.rowcount.value+'.';">
<option value="0">
${text.toolbar.all}
</option>
......@@ -82,7 +82,7 @@ Initial Developer: H2 Group
</select>&nbsp;
</td>
<td class="toolbar">
<a href="javascript:top.frames['h2query'].submitAll();">
<a href="javascript:parent.h2query.submitAll();">
<img src="icon_run.gif"
onmouseover="this.className ='icon_hover'"
onmouseout="this.className ='icon'"
......@@ -91,7 +91,7 @@ Initial Developer: H2 Group
</a>
</td>
<td class="toolbar">
<a href="javascript:top.frames['h2query'].submitSelected();">
<a href="javascript:parent.h2query.submitSelected();">
<img src="icon_run_selected.gif"
onmouseover="this.className ='icon_hover'"
onmouseout="this.className ='icon'"
......@@ -120,7 +120,7 @@ Initial Developer: H2 Group
<td class="toolbar">
${text.toolbar.autoComplete}&nbsp;
<select name="autoComplete" size="1"
onchange="javascript:top.frames['h2query'].setAutoComplete(this.value)">
onchange="javascript:parent.h2query.setAutoComplete(this.value)">
<option selected="selected" value="0">
${text.toolbar.autoComplete.off}
</option>
......
......@@ -17,7 +17,9 @@ Initial Developer: H2 Group
<script type="text/javascript">
<!--
function set(s) {
top.h2query.document.h2query.sql.value = s;
if (parent.h2query) {
parent.h2query.document.h2query.sql.value = s;
}
}
//-->
</script>
......
......@@ -12,10 +12,8 @@ Initial Developer: H2 Group
<title>${text.a.title}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script type="text/javascript">
if (self != top) {
if (self.name == 'h2result' || self.name == 'h2query' || self.name == 'h2menu') {
top.location = "login.jsp";
}
if (self.name == 'h2result' || self.name == 'h2query' || self.name == 'h2menu') {
parent.location = "login.jsp";
}
</script>
</head>
......
......@@ -28,7 +28,7 @@ var req;
function refreshTables() {
columnsByTable = new Object();
var tables = top.frames['h2menu'].tables;
var tables = parent.h2menu.tables;
for(var i=0; i<tables.length; i++) {
columnsByTable[tables[i].name] = tables[i].columns;
}
......@@ -91,9 +91,9 @@ function help() {
s = tableAliases[s];
}
if (columnsByTable[s]) {
if (top.h2menu.goToTable(s)) {
top.h2menu.document.location='tables.do?jsessionid=${sessionId}#' + s;
// top.h2menu.window.blur();
if (parent.h2menu.goToTable(s)) {
parent.h2menu.document.location='tables.do?jsessionid=${sessionId}#' + s;
// parent.h2menu.window.blur();
document.h2query.sql.focus();
}
}
......@@ -333,13 +333,11 @@ function highlightThisRow(row) {
}
function getAutoCompleteTable() {
return top.h2result.document.getElementById('h2auto');
// return top.frames['h2result'].document.getElementById('h2auto');
// return top.h2menu.h2result.document.getElementById('h2auto');
return parent.h2result.document.getElementById('h2auto');
}
function showOutput(x) {
// top.h2result.document.getElementById('output').style.display=x;
// parent.h2result.document.getElementById('output').style.display=x;
}
function showList(s) {
......@@ -357,7 +355,7 @@ function showList(s) {
}
selectedRow = 0;
var count = 0;
var doc = top.h2result.document;
var doc = parent.h2result.document;
var tbody = table.tBodies[0];
for(var i=0; list != null && i<list.length; i++) {
var kv = list[i].split('#');
......@@ -401,7 +399,7 @@ function showList(s) {
showOutput('');
}
// scroll to the top left
top.h2result.scrollTo(0, 0);
parent.h2result.scrollTo(0, 0);
autoCompleteManual = false;
}
......
......@@ -23,17 +23,17 @@ function addTable(name, columns, i) {
}
function ins(s, isTable) {
if (top.h2query) {
if (top.h2query.insertText) {
top.h2query.insertText(s, isTable);
if (parent.h2query) {
if (parent.h2query.insertText) {
parent.h2query.insertText(s, isTable);
}
}
}
function refreshQueryTables() {
if (top.frames['h2query']) {
if (top.frames['h2query'].refreshTables) {
top.frames['h2query'].refreshTables();
if (parent.h2query) {
if (parent.h2query.refreshTables) {
parent.h2query.refreshTables();
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论