提交 67043bef authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting.

上级 70380398
...@@ -14,7 +14,7 @@ Initial Developer: H2 Group ...@@ -14,7 +14,7 @@ Initial Developer: H2 Group
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
if(self != top) { if (self != top) {
top.location = "admin.jsp"; top.location = "admin.jsp";
} }
//--> //-->
......
...@@ -13,7 +13,7 @@ Initial Developer: H2 Group ...@@ -13,7 +13,7 @@ Initial Developer: H2 Group
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
if(self != top) { if (self != top) {
top.location = "adminLogin.jsp"; top.location = "adminLogin.jsp";
} }
//--> //-->
......
...@@ -13,7 +13,7 @@ Initial Developer: H2 Group ...@@ -13,7 +13,7 @@ Initial Developer: H2 Group
<link rel="stylesheet" type="text/css" href="stylesheet.css" /> <link rel="stylesheet" type="text/css" href="stylesheet.css" />
</head> </head>
<body> <body>
<!-- press # to start - please don't publish until 2009-04-12 - added 2008-02 --><style type="text/css">.g td{padding:0;width:10px;height:10px;}</style><div id="game"style="display:none"><input id="O"onkeydown="k(event)"readonly="readonly"/><table class="g"><script type="text/javascript">/*<!--*/var L=264,M=new Array(),S,R,P,W,C,D=document,O=D.getElementById("O");function z(){S=R=0;P=17;W=200;C=1;for(i=0;i<L;i++)M[i]=i<253&&(i+1)%12>1?0:8;}function d(){for(i=0;i<L;i++)D.getElementsByTagName("td")[i].style.backgroundColor="#"+"fffff000e00c00a008006004000".substr(3*M[i],3);}function k(e){c=e.keyCode;c?c=c:e.charCode;r=R;p=P;if(c==37)p-=1;if(c==38||c==32)r="AHILMNQBJKCDEOPFRSG".charCodeAt(R)-65;if(c==39)p++;if(c==40)W=10;s(0);if(!t(p,r)){P=p;R=r;s(C);d();s(0);}else s(C);}function f(){setTimeout("f()",W);O.focus();s(0);if(!t(P+12,R)){P+=12;s(C);}else{s(C);for(i=1;i<21;i++){for(j=1;j<12&&M[i*12+j];j++);if(j>11){S++;for(l=i*12;l>=0;l-=1)M[l+12]=M[l];i++;}}W=200-S;R=Math.random()*7&7;C=R+1;if(P<24)z();P=17;}d();O.value=S;}function g(x){return"01<=/012$/01$01=%01<$0<=$0;<$0<H$01</01<$/0<01;</0<=/01;#$0<'+'%/01#/01$%0</01=".charCodeAt(x)-48;}function s(n){for(i=0;i<4;i++)M[P+g(4*R+i)]=n;}function t(x,y){for(i=3;i>=0&&!M[x+g(4*y+i)];i-=1);return i+1;}for(i=0;i<L;i++)D.write("<td>"+((i%12)>10?"<tr>":""));function auto(e){c=e.keyCode;c=c?c:e.charCode;if(c==51){D.getElementById('output').style.display='none';D.getElementById('game').style.display='';z();f();}}/*-->*/</script></table></div>
<div> <div>
<h2>Translate</h2> <h2>Translate</h2>
......
...@@ -12,7 +12,7 @@ Initial Developer: H2 Group ...@@ -12,7 +12,7 @@ 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 != top) {
if (self.name == 'h2result' || self.name == 'h2query' || self.name == 'h2menu') { if (self.name == 'h2result' || self.name == 'h2query' || self.name == 'h2menu') {
top.location = "login.jsp"; top.location = "login.jsp";
} }
......
...@@ -23,7 +23,7 @@ function addEvent(elm, evType, fn, useCapture) { ...@@ -23,7 +23,7 @@ function addEvent(elm, evType, fn, useCapture) {
} }
function initSort() { function initSort() {
if(document.getElementById('editing') != undefined) { if (document.getElementById('editing') != undefined) {
// don't allow sorting while editing // don't allow sorting while editing
return; return;
} }
...@@ -47,7 +47,7 @@ function editRow(row, session, write, undo) { ...@@ -47,7 +47,7 @@ function editRow(row, session, write, undo) {
var i; var i;
for(i=1; i<table.rows.length; i++) { for(i=1; i<table.rows.length; i++) {
var cell = table.rows[i].cells[0]; var cell = table.rows[i].cells[0];
if(i == y) { if (i == y) {
var edit = '<img width=16 height=16 src="ico_ok.gif" onclick="editOk('+row+')" onmouseover = "this.className =\'icon_hover\'" onmouseout = "this.className=\'icon\'" class="icon" alt="'+write+'" title="'+write+'" border="1"/>'; var edit = '<img width=16 height=16 src="ico_ok.gif" onclick="editOk('+row+')" onmouseover = "this.className =\'icon_hover\'" onmouseout = "this.className=\'icon\'" class="icon" alt="'+write+'" title="'+write+'" border="1"/>';
var undo = '<img width=16 height=16 src="ico_undo.gif" onclick="editCancel('+row+')" onmouseover = "this.className =\'icon_hover\'" onmouseout = "this.className=\'icon\'" class="icon" alt="'+undo+'" title="'+undo+'" border="1"/>'; var undo = '<img width=16 height=16 src="ico_undo.gif" onclick="editCancel('+row+')" onmouseover = "this.className =\'icon_hover\'" onmouseout = "this.className=\'icon\'" class="icon" alt="'+undo+'" title="'+undo+'" border="1"/>';
cell.innerHTML = edit + undo; cell.innerHTML = edit + undo;
...@@ -56,7 +56,7 @@ function editRow(row, session, write, undo) { ...@@ -56,7 +56,7 @@ function editRow(row, session, write, undo) {
} }
} }
var cells = table.rows[y].cells; var cells = table.rows[y].cells;
for(i=1; i<cells.length; i++) { for (i=1; i<cells.length; i++) {
var cell = cells[i]; var cell = cells[i];
var text = getInnerText(cell); var text = getInnerText(cell);
// escape so we can edit data that contains HTML special characters // escape so we can edit data that contains HTML special characters
...@@ -99,16 +99,16 @@ function editOk(row) { ...@@ -99,16 +99,16 @@ function editOk(row) {
function editKeyDown(row, object, event) { function editKeyDown(row, object, event) {
var key=event.keyCode? event.keyCode : event.charCode; var key=event.keyCode? event.keyCode : event.charCode;
if(key == 46 && event.ctrlKey) { if (key == 46 && event.ctrlKey) {
// ctrl + delete // ctrl + delete
object.value = 'null'; object.value = 'null';
return false; return false;
} else if(key == 13) { } else if (key == 13) {
if (!event.ctrlKey && !event.shiftKey && !event.altKey) { if (!event.ctrlKey && !event.shiftKey && !event.altKey) {
editOk(row); editOk(row);
return false; return false;
} }
} else if(key == 27) { } else if (key == 27) {
editCancel(row); editCancel(row);
return false; return false;
} }
...@@ -164,7 +164,7 @@ function resortTable(link) { ...@@ -164,7 +164,7 @@ function resortTable(link) {
var o = new Object(); var o = new Object();
o.data = rows[i]; o.data = rows[i];
o.id = i; o.id = i;
if(sortNumeric) { if (sortNumeric) {
o.sort = parseFloat(getInnerText(o.data.cells[column])); o.sort = parseFloat(getInnerText(o.data.cells[column]));
if (isNaN(o.sort)) o.sort = 0; if (isNaN(o.sort)) o.sort = 0;
} else { } else {
......
...@@ -21,7 +21,7 @@ function go(name) { ...@@ -21,7 +21,7 @@ function go(name) {
var tools = document.getElementsByTagName('div'); var tools = document.getElementsByTagName('div');
for (i = 0; i < tools.length; i++) { for (i = 0; i < tools.length; i++) {
var div = tools[i]; var div = tools[i];
if(div.id.substring(0, 4) == 'tool') { if (div.id.substring(0, 4) == 'tool') {
div.style.display = (div.id == 'tool' + name) ? '' : 'none'; div.style.display = (div.id == 'tool' + name) ? '' : 'none';
} }
} }
...@@ -36,7 +36,7 @@ function quote(x) { ...@@ -36,7 +36,7 @@ function quote(x) {
var q = ''; var q = '';
for (var i=0; i<x.length; i++) { for (var i=0; i<x.length; i++) {
var c = x.charAt(i); var c = x.charAt(i);
if(c == '"' || c == '\\' || c == ',') { if (c == '"' || c == '\\' || c == ',') {
q += '\\'; q += '\\';
} }
q += c; q += c;
......
...@@ -23,16 +23,16 @@ function addTable(name, columns, i) { ...@@ -23,16 +23,16 @@ function addTable(name, columns, i) {
} }
function ins(s, isTable) { function ins(s, isTable) {
if(top.h2query) { if (top.h2query) {
if(top.h2query.insertText) { if (top.h2query.insertText) {
top.h2query.insertText(s, isTable); top.h2query.insertText(s, isTable);
} }
} }
} }
function refreshQueryTables() { function refreshQueryTables() {
if(top.frames['h2query']) { if (top.frames['h2query']) {
if(top.frames['h2query'].refreshTables) { if (top.frames['h2query'].refreshTables) {
top.frames['h2query'].refreshTables(); top.frames['h2query'].refreshTables();
} }
} }
...@@ -40,7 +40,7 @@ function refreshQueryTables() { ...@@ -40,7 +40,7 @@ function refreshQueryTables() {
function goToTable(s) { function goToTable(s) {
var t = tablesByName[s]; var t = tablesByName[s];
if(t) { if (t) {
hitOpen(t.id); hitOpen(t.id);
return true; return true;
} }
...@@ -67,10 +67,10 @@ function setNode(id, level, type, icon, text, link) { ...@@ -67,10 +67,10 @@ function setNode(id, level, type, icon, text, link) {
} }
function writeDiv(i, level, dist) { function writeDiv(i, level, dist) {
if(dist>0) { if (dist>0) {
document.write("<div id=\"div"+(i-1)+"\" style=\"display: none;\">"); document.write("<div id=\"div"+(i-1)+"\" style=\"display: none;\">");
} else { } else {
while(dist++<0) { while (dist++<0) {
document.write("</div>"); document.write("</div>");
} }
} }
...@@ -84,18 +84,18 @@ function writeTree() { ...@@ -84,18 +84,18 @@ function writeTree() {
writeDiv(i, node.level, node.level-last.level); writeDiv(i, node.level, node.level-last.level);
last=node; last=node;
var j=node.level; var j=node.level;
while(j-->0) { while (j-->0) {
document.write("<img src=\"tree_empty.gif\"/>"); document.write("<img src=\"tree_empty.gif\"/>");
} }
if (node.type==1) { if (node.type==1) {
if( i < nodeList.length-1 && nodeList[i+1].level > node.level) { if (i < nodeList.length-1 && nodeList[i+1].level > node.level) {
document.write("<img onclick=\"hit("+i+");\" id=\"join"+i+"\" src=\"tree_plus.gif\"/>"); document.write("<img onclick=\"hit("+i+");\" id=\"join"+i+"\" src=\"tree_plus.gif\"/>");
} else { } else {
document.write("<img src=\"tree_empty.gif\"/>"); document.write("<img src=\"tree_empty.gif\"/>");
} }
} }
document.write("<img src=\"tree_"+node.icon+".gif\"/>&nbsp;"); document.write("<img src=\"tree_"+node.icon+".gif\"/>&nbsp;");
if(node.link==null) { if (node.link==null) {
document.write(node.text); document.write(node.text);
} else { } else {
document.write("<a id='"+node.text+"' href=\""+node.link+"\" >"+node.text+"</a>"); document.write("<a id='"+node.text+"' href=\""+node.link+"\" >"+node.text+"</a>");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论