diff options
| author | orbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2010-03-09 15:44:11 +0000 |
|---|---|---|
| committer | orbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2010-03-09 15:44:11 +0000 |
| commit | 3014e5f6f9f9919db23159ada93051dba0ed608f (patch) | |
| tree | 98ce0571d3521a19ba2b951a79f5f5b747875b1b /htroot/IndexControlURLs_p.html | |
| parent | ae2f3f000f6ef8b60c5741ef8c8b209aeecdc733 (diff) | |
- integrated live search in the IndexControlURLs input window for URLs:
this searchs for occurrences of the given word in URLs and presents them
in a pop-up list below the input line
- some bugfixes for the new robots table viewer
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6735 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot/IndexControlURLs_p.html')
| -rw-r--r-- | htroot/IndexControlURLs_p.html | 60 |
1 files changed, 58 insertions, 2 deletions
diff --git a/htroot/IndexControlURLs_p.html b/htroot/IndexControlURLs_p.html index 3553a5339..f809dd2c6 100644 --- a/htroot/IndexControlURLs_p.html +++ b/htroot/IndexControlURLs_p.html @@ -4,13 +4,66 @@ <head>
<title>YaCy '#[clientname]#': Index Control</title>
#%env/templates/metas.template%#
+ <script language="Javascript">
+//<![CDATA[
+function xmlhttpPost() {
+ var searchform = document.forms['searchform'];
+ search(searchform.urlstring.value);
+}
+
+function search(query) {
+ var xmlHttpReq = false;
+ var self = this;
+ if (window.XMLHttpRequest) { // Mozilla/Safari
+ self.xmlHttpReq = new XMLHttpRequest();
+ }
+ else if (window.ActiveXObject) { // IE
+ self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ self.xmlHttpReq.open('GET', "yacysearch.json?verify=false&resource=local&maximumRecords=100&nav=none&query=" + query + "+inurl:" + query, true);
+ self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ self.xmlHttpReq.onreadystatechange = function() {
+ if (self.xmlHttpReq.readyState == 4) {
+ updatepage(self.xmlHttpReq.responseText);
+ }
+ }
+ self.xmlHttpReq.send(null);
+}
+
+function updatepage(str) {
+ var raw = document.getElementById("raw");
+ if (raw != null) raw.innerHTML = str;
+ var rsp = eval("("+str+")");
+ var firstChannel = rsp.channels[0];
+ var totalResults = firstChannel.totalResults.replace(/[,.]/,"");
+ var startIndex = firstChannel.startIndex;
+ var itemsPerPage = firstChannel.itemsPerPage;
+ var navigation = firstChannel.navigation;
+
+ var html = "";
+
+ if (totalResults > 0 && firstChannel.items.length > 0) {
+ var item;
+ html += "<table class=\"networkTable\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" width=\"99%\">";
+ html += "<tr class=\"TableHeader\" valign=\"bottom\">";
+ html += "<td>URL from index (total results = " + totalResults + ")</td>";
+ for (var i = 0; i < firstChannel.items.length; i++) {
+ item = firstChannel.items[i];
+ html += "<tr class=\"TableCellLight\"><td align=\"left\"><a href=\"IndexControlURLs_p.html?urlstringsearch=&urlstring=" + item.link + "\">" + item.link + "</a></td>";
+ }
+ html += "</table>";
+ }
+ document.getElementById("searchresults").innerHTML = html;
+}
+//]]>
+</script>
</head>
<body id="IndexControl">
#%env/templates/header.template%#
#%env/templates/submenuIndexControl.template%#
<h2>Index Administration</h2>
<p>The local index currently contains #[ucount]# URL references</p>
- <form action="IndexControlURLs_p.html" method="post" enctype="multipart/form-data">
+ <form action="IndexControlURLs_p.html" name="searchform" method="post" enctype="multipart/form-data" onkeyup="xmlhttpPost(); return false;">
<fieldset><legend>URL Retrieval</legend>
<dl>
<dt class="TableCellDark">Select Segment:</dt>
@@ -24,7 +77,8 @@ <dt class="TableCellDark">Retrieve by URL:</dt>
<dd><input type="text" name="urlstring" value="#[urlstring]#" size="40" maxlength="250" />
- <input type="submit" name="urlstringsearch" value="Show Details for URL" />
+ <input type="submit" name="urlstringsearch" value="Show Details for URL" /><br />
+ <div id="searchresults"></div>
</dd>
<dt class="TableCellDark">Retrieve by URL-Hash:</dt>
@@ -36,6 +90,8 @@ </fieldset>
</form>
+
+
#(statistics)#::
<form action="IndexControlURLs_p.html" method="post" enctype="multipart/form-data">
<fieldset><legend>Statistics about top-domains in URL Database</legend>
|
