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

Issue 554: Web Console in an IFrame not fully supported

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