Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
some refactoring for js
allo251b3b636ed5
diff --git a/htroot/WatchCrawler.html b/htroot/WatchCrawler.htmlindex 9adf3b8c9..bb1b406e1 100644--- a/htroot/WatchCrawler.html+++ b/htroot/WatchCrawler.html@@ -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">diff --git a/htroot/js/WatchCrawler.js b/htroot/js/WatchCrawler.jsindex 8e9375dce..2bb255999 100644--- a/htroot/js/WatchCrawler.js+++ b/htroot/js/WatchCrawler.js@@ -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-}+diff --git a/htroot/js/html.js b/htroot/js/html.jsnew file mode 100644index 000000000..29e36746c--- /dev/null+++ b/htroot/js/html.js@@ -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+}\ No newline at end of file