summaryrefslogtreecommitdiff
path: root/htroot/yacyinteractive.html
diff options
context:
space:
mode:
authormikeworks <mikeworks@6c8d7289-2bf4-0310-a012-ef5d649a1542>2010-09-29 20:06:39 +0000
committermikeworks <mikeworks@6c8d7289-2bf4-0310-a012-ef5d649a1542>2010-09-29 20:06:39 +0000
commit421aa6a8bb4b59ff4bdb6f15e4117a8ffa0e5aa1 (patch)
treeef5e3948ef2858dcc921426bb2a14d1eed401af6 /htroot/yacyinteractive.html
parentc60aed44352067f708c418ebf83f5a6337dfc6eb (diff)
ConfigLiveSearch.html: Fixed some HTML problems to validate at least XHTML 1.0 Transitional - strict is not possible because iframes are used. Replacing iframes with embedded object tag does not work in IE
ConfigPortal.html: Fixed some HTML problems to validate at least XHTML 1.0 Transitional - for strict the target attribute of the a link has to be removed yacyinteractive.html: Moved all JS code to an external yacyinteractive.js file in JS folder yacysearch.html: Removed embedded scripts from in between the body tags - now everything is loaded in the header de.lng: Just in case JS files will be parsed at some point added translation for yacyinteractive.html result counter git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7208 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot/yacyinteractive.html')
-rw-r--r--htroot/yacyinteractive.html76
1 files changed, 1 insertions, 75 deletions
diff --git a/htroot/yacyinteractive.html b/htroot/yacyinteractive.html
index 000a7b4d0..f003dc5b0 100644
--- a/htroot/yacyinteractive.html
+++ b/htroot/yacyinteractive.html
@@ -3,81 +3,7 @@
<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 += "&nbsp;&nbsp;&nbsp;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/yacyinteractive.js"></script>
<script type="text/javascript" src="/js/sorttable.js"></script>
</head>
<body>