some refactoring for js

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2191 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 19 years ago
parent 75ed507d39
commit 251b3b636e

@ -5,6 +5,7 @@
#%env/templates/metas.template%#
<script src="/js/ajax.js"></script>
<script src="/js/xml.js"></script>
<script src="/js/html.js"></script>
<script src="/js/WatchCrawler.js"></script>
</head>
<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">

@ -135,24 +135,6 @@ function handleQueues(){
}
}
function clearTable(table, numSkip){
if(numSkip==null){
numSkip=0;
}
row=getFirstChild(getFirstChild(table, "tbody"), "tr");
//skip numSkip rows
for(i=0;i<numSkip;i++){
row=getNextSibling(row, "tr");
}
while(row != null){ //delete old entries
getFirstChild(table, "tbody").removeChild(row);
row=getFirstChild(getFirstChild(table, "tbody"), "tr");
//skip numSkip rows
for(i=0;i<numSkip;i++){
row=getNextSibling(row, "tr");
}
}
}
function createLoaderTable(loaderqueue){
entries=loaderqueue.getElementsByTagName("entry");
loaderTable=document.getElementById("loaderTable");
@ -275,12 +257,6 @@ function createRemoteCrawlerTable(remotecrawlerqueue){
}
}
function createCol(content){
col=document.createElement("td");
text=document.createTextNode(content);
col.appendChild(text);
return col;
}
function createIndexingRow(initiator, depth, modified, anchor, url, size, hash){
row=document.createElement("tr");
row.appendChild(createCol(initiator));
@ -319,13 +295,4 @@ function createRemoteCrawlerRow(profile, depth, modified, anchor, url){
row.appendChild(createLinkCol(url, url));
return row;
}
function createLinkCol(url, linktext){
col=document.createElement("td");
link=document.createElement("a");
link.setAttribute("href", url);
link.setAttribute("target", "_blank");
text=document.createTextNode(linktext);
link.appendChild(text);
col.appendChild(link)
return col
}

@ -0,0 +1,36 @@
function createCol(content){
col=document.createElement("td");
text=document.createTextNode(content);
col.appendChild(text);
return col;
}
function clearTable(table, numSkip){
if(numSkip==null){
numSkip=0;
}
row=getFirstChild(getFirstChild(table, "tbody"), "tr");
//skip numSkip rows
for(i=0;i<numSkip;i++){
row=getNextSibling(row, "tr");
}
while(row != null){ //delete old entries
getFirstChild(table, "tbody").removeChild(row);
row=getFirstChild(getFirstChild(table, "tbody"), "tr");
//skip numSkip rows
for(i=0;i<numSkip;i++){
row=getNextSibling(row, "tr");
}
}
}
function createLinkCol(url, linktext){
col=document.createElement("td");
link=document.createElement("a");
link.setAttribute("href", url);
link.setAttribute("target", "_blank");
text=document.createTextNode(linktext);
link.appendChild(text);
col.appendChild(link)
return col
}
Loading…
Cancel
Save