blob: 000a7b4d02f692f23bf774ca98b3692d7dd5f039 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>YaCy Interactive Search</title>
#%env/templates/metas.template%#
<script type="text/javascript">
//<![CDATA[
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
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=topics&query=" + 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 navget(list, name) {
for (var i = 0; i < list.length; i++) {
if (list[i].facetname == name) return list[i];
}
}
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 topics = navget(navigation, "topics");
var html = "<span id=\"resCounter\" style=\"display: inline;\">total results = " + totalResults;
if (topics.length > 0) {
var topwords = "";
for (var i = 0; i < topics.elements.length; i++) {
topwords += "<a href=\"yacyinteractive.html?query=" + firstChannel.searchTerms + "+" + topics.elements[i].name + "\">" + topics.elements[i].name + "</a> ";
if (i > 10) break;
}
html += " topwords: " + topwords;
}
html += "</span><br>";
if (totalResults > 0) {
var item;
html += "<table class=\"sortable\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" width=\"99%\">";
html += "<tr class=\"TableHeader\" valign=\"bottom\">";
html += "<td>Name</td>";
html += "<td width=\"60\">Size</td>";
//html += "<td>Description</td>";
html += "<td width=\"180\">Date</td></tr>";
for (var i = 0; i < firstChannel.items.length; i++) {
item = firstChannel.items[i];
html += "<tr class=\"TableCellLight\"><td align=\"left\"><a href=\"" + item.link + "\">" + item.title + "</a></td>";
html += "<td align=\"right\">" + item.sizename + "</td>";
//html += "<td>" + item.description + "</td>";
html += "<td align=\"right\">" + item.pubDate + "</td></tr>";
}
html += "</table>";
}
document.getElementById("searchresults").innerHTML = html;
}
//]]>
</script>
<script type="text/javascript" src="/js/sorttable.js"></script>
</head>
<body>
<script type="text/javascript">
//<![CDATA[
var q = "#[query]#";
if (q != "") search(q);
//]]>
</script>
#(display)#
#%env/templates/simpleheader.template%#
<div id="kiosk">
<a href="yacyinteractive.html?display=2"><img src="env/grafics/close.gif" width="16" height="16" alt="close" /></a>
<span>kiosk mode</span>
</div>
::
<div id="api"><a href="yacysearch.json?query=yacy"><img src="env/grafics/api.png" width="60" height="40" alt="API" /></a>
<span>This page uses the JSON search API to display search results as you type.
Click the API icon to see an example call to the native API.
To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de/wiki/index.php/Dev:API">API wiki page</a>.</span>
</div>
#%env/templates/header.template%#
::
#%env/templates/embeddedheader.template%#
#(/display)#
<form class="search small" id="searchform" action="yacyinteractive.html" method="get" onkeyup="xmlhttpPost(); return false;">
<h2>#[promoteSearchPageGreeting]#</h2>
<div class="yacylogo">
<a href="#[promoteSearchPageGreeting.homepage]#" class="yacylogo"><img src="#[promoteSearchPageGreeting.smallImage]#" alt="yacysearch"/></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>
</html>
|