Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

better refresh ui

allod0f8254f95e2
diff --git a/htroot/WatchCrawler_p.html b/htroot/WatchCrawler_p.html
index 6282d0314..9c7cf5d50 100644
--- a/htroot/WatchCrawler_p.html
+++ b/htroot/WatchCrawler_p.html
@@ -11,7 +11,7 @@
#%env/templates/header.template%#
#%env/templates/submenuCrawler.template%#
<h2>Crawler Monitor</h2>
-<p> Next update in <span id="nextUpdate" onclick="changeInterval()"></span> seconds. <img src="/env/grafics/empty.gif" name="ajax" alt="empty"/>
+<p> Next update in <input type="text" id="nextUpdate" onfocus="changeInterval()" onblur="newInterval()" size="2" /> seconds. <img src="/env/grafics/empty.gif" name="ajax" alt="empty"/>
</p>
<table border="0" cellpadding="2" cellspacing="1" class="watchCrawler">
<tbody>
diff --git a/htroot/WatchWebStructure_p.html b/htroot/WatchWebStructure_p.html
index 921107414..1eb5708c1 100644
--- a/htroot/WatchWebStructure_p.html
+++ b/htroot/WatchWebStructure_p.html
@@ -3,6 +3,7 @@
<head>
<title>YaCy '#[clientname]#': Web Structure</title>
#%env/templates/metas.template%#
+<script type="text/javascript" src="/js/WatchWebStructure.js"></script>
</head>
<body id="WebStructure" style="margin:0px;">
#%env/templates/header.template%#
@@ -13,7 +14,7 @@
<tr>
<td valign="top">
<dl>
-<dt>host</dt><dd>#[host]#</dd>
+<dt>host</dt><dd><input type="text" value="#[host]#" id="host" onblur="changeHost()" /></dd>
<dt>depth</dt><dd>#[depth]#<br/>
<a href="WatchWebStructure_p.html?host=#[host]#&depth=#[depthd]#&width=#[width]#&height=#[height]#"><img src="env/grafics/minus.gif" /></a>
<a href="WatchWebStructure_p.html?host=#[host]#&depth=#[depthi]#&width=#[width]#&height=#[height]#"><img src="env/grafics/plus.gif" /></a>
diff --git a/htroot/js/WatchCrawler.js b/htroot/js/WatchCrawler.js
index 151618c0f..4805313ab 100644
--- a/htroot/js/WatchCrawler.js
+++ b/htroot/js/WatchCrawler.js
@@ -18,19 +18,20 @@ function changeInterval(){
if(!changing){
window.clearInterval(countInterval);
counter=document.getElementById("nextUpdate");
- counter.innerHTML='<input type="text" id="newInterval" onblur="newInterval()" size="2" />';
- document.getElementById("newInterval").focus();
+ //counter.innerHTML='<input type="text" id="newInterval" onblur="newInterval()" size="2" />';
+ //document.getElementById("newInterval").focus();
+ counter.value=refreshInterval;
changing=true;
}
}
function newInterval(){
- refreshInterval=document.getElementById("newInterval").value;
+ refreshInterval=document.getElementById("nextUpdate").value;
refresh();
countInterval=window.setInterval("countdown()", 1000);
changing=false;
}
function countdown(){
- document.getElementById("nextUpdate").innerHTML=wait;
+ document.getElementById("nextUpdate").value=wait;
wait--;
if(wait==0){
refresh();
diff --git a/htroot/js/WatchWebStructure.js b/htroot/js/WatchWebStructure.js
new file mode 100644
index 000000000..5b5f754ba
--- /dev/null
+++ b/htroot/js/WatchWebStructure.js
@@ -0,0 +1,3 @@
+function changeHost(){
+ window.location.replace("http://"+window.location.host+":"+window.location.port+"/WatchWebStructure_p.html?host="+document.getElementById("host").value);
+}
\ No newline at end of file