|
|
|
@ -5,6 +5,12 @@
|
|
|
|
|
#%env/templates/metas.template%#
|
|
|
|
|
<script language="Javascript">
|
|
|
|
|
function xmlhttpPost() {
|
|
|
|
|
|
|
|
|
|
var searchform = document.forms['searchform'];
|
|
|
|
|
search(searchform.query.value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function search(query) {
|
|
|
|
|
var xmlHttpReq = false;
|
|
|
|
|
var self = this;
|
|
|
|
|
if (window.XMLHttpRequest) { // Mozilla/Safari
|
|
|
|
@ -13,8 +19,7 @@ function xmlhttpPost() {
|
|
|
|
|
else if (window.ActiveXObject) { // IE
|
|
|
|
|
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
|
|
|
|
|
}
|
|
|
|
|
var searchform = document.forms['searchform'];
|
|
|
|
|
self.xmlHttpReq.open('GET', "yacysearch.json?verify=false&resource=local&maximumRecords=100&query=" + searchform.query.value, true);
|
|
|
|
|
self.xmlHttpReq.open('GET', "yacysearch.json?verify=false&resource=local&maximumRecords=100&query=" + query, true);
|
|
|
|
|
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
|
|
|
|
self.xmlHttpReq.onreadystatechange = function() {
|
|
|
|
|
if (self.xmlHttpReq.readyState == 4) {
|
|
|
|
@ -24,7 +29,7 @@ function xmlhttpPost() {
|
|
|
|
|
self.xmlHttpReq.send(null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updatepage(str){
|
|
|
|
|
function updatepage(str) {
|
|
|
|
|
var raw = document.getElementById("raw");
|
|
|
|
|
if (raw != null) raw.innerHTML = str;
|
|
|
|
|
var rsp = eval("("+str+")");
|
|
|
|
@ -32,25 +37,42 @@ function updatepage(str){
|
|
|
|
|
var totalResults = firstChannel.totalResults;
|
|
|
|
|
var startIndex = firstChannel.startIndex;
|
|
|
|
|
var itemsPerPage = firstChannel.itemsPerPage;
|
|
|
|
|
var html = "<br>total results = " + totalResults;
|
|
|
|
|
var item;
|
|
|
|
|
html += "<table class=\"networkTable\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\">";
|
|
|
|
|
html += "<tr class=\"TableHeader\" valign=\"bottom\">";
|
|
|
|
|
html += "<td>Name</td>";
|
|
|
|
|
//html += "<td>Description</td>";
|
|
|
|
|
html += "<td>Link</td></tr>";
|
|
|
|
|
for (var i = 0; i < firstChannel.items.length; i++) {
|
|
|
|
|
item = firstChannel.items[i];
|
|
|
|
|
html += "<tr class=\"TableCellLight\"><td>"+ item.title + "</td>";
|
|
|
|
|
//html += "<td>" + item.description + "</td>";
|
|
|
|
|
html += "<td><a href=\"" + item.link + "\">" + item.link + "</a></td></tr>";
|
|
|
|
|
|
|
|
|
|
var html = "<span id=\"resCounter\" style=\"display: inline;\">total results = " + totalResults;
|
|
|
|
|
if (firstChannel.topwords.length > 0) {
|
|
|
|
|
var topwords = "";
|
|
|
|
|
for (var i = 0; i < firstChannel.topwords.length; i++) {
|
|
|
|
|
topwords += "<a href=\"yacyinteractive.html?query=" + firstChannel.searchTerms + "+" + firstChannel.topwords[i].word + "\">" + firstChannel.topwords[i].word + "</a> ";
|
|
|
|
|
if (i > 10) break;
|
|
|
|
|
}
|
|
|
|
|
html += " topwords: " + topwords;
|
|
|
|
|
}
|
|
|
|
|
html += "</span><br>";
|
|
|
|
|
|
|
|
|
|
if (totalResults > 0) {
|
|
|
|
|
var item;
|
|
|
|
|
html += "<table class=\"networkTable\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" width=\"99%\">";
|
|
|
|
|
html += "<tr class=\"TableHeader\" valign=\"bottom\">";
|
|
|
|
|
html += "<td width=\"30%\">Name</td>";
|
|
|
|
|
//html += "<td>Description</td>";
|
|
|
|
|
html += "<td>Link</td></tr>";
|
|
|
|
|
for (var i = 0; i < firstChannel.items.length; i++) {
|
|
|
|
|
item = firstChannel.items[i];
|
|
|
|
|
html += "<tr class=\"TableCellLight\"><td>"+ item.title + "</td>";
|
|
|
|
|
//html += "<td>" + item.description + "</td>";
|
|
|
|
|
html += "<td><a href=\"" + item.link + "\">" + item.link + "</a></td></tr>";
|
|
|
|
|
}
|
|
|
|
|
html += "</table>";
|
|
|
|
|
}
|
|
|
|
|
html += "</table>";
|
|
|
|
|
document.getElementById("searchresults").innerHTML = html;
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
var q = "#[query]#";
|
|
|
|
|
if (q != "") search(q);
|
|
|
|
|
</script>
|
|
|
|
|
#(display)#
|
|
|
|
|
#%env/templates/simpleheader.template%#
|
|
|
|
|
::
|
|
|
|
@ -64,16 +86,16 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
|
|
|
|
|
#%env/templates/embeddedheader.template%#
|
|
|
|
|
#(/display)#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<form class="search small" name="searchform" onkeyup='xmlhttpPost(); return false;'>
|
|
|
|
|
<h2>#[promoteSearchPageGreeting]#</h2>
|
|
|
|
|
<div class="yacylogo">
|
|
|
|
|
<a href="#[promoteSearchPageGreeting.homepage]#" class="yacylogo"><img src="#[promoteSearchPageGreeting.smallImage]#" alt="yacysearch" align="left"/></a></div>
|
|
|
|
|
<fieldset class="yacys"><input name="query" type="text" size="50" maxlength="80" /></fieldset>
|
|
|
|
|
<div id="searchresults"></div>
|
|
|
|
|
<a href="#[promoteSearchPageGreeting.homepage]#" class="yacylogo"><img src="#[promoteSearchPageGreeting.smallImage]#" alt="yacysearch" align="left"/></a>
|
|
|
|
|
</div>
|
|
|
|
|
<fieldset class="yacys"><input name="query" type="text" value="#[query]#" size="50" maxlength="80" /></fieldset>
|
|
|
|
|
|
|
|
|
|
<!--<pre>Raw JSON String: <div id="raw"></div></pre>-->
|
|
|
|
|
</form>
|
|
|
|
|
<div id="searchresults"></div>
|
|
|
|
|
|
|
|
|
|
#%env/templates/footer.template%#
|
|
|
|
|
</body>
|
|
|
|
|