Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
preparations for media snippets
orbiterfb9e0f02842d
diff --git a/htroot/js/yacysearch.js b/htroot/js/yacysearch.jsindex 418d7815b..3db12772d 100644--- a/htroot/js/yacysearch.js+++ b/htroot/js/yacysearch.js@@ -1,24 +1,24 @@-function AllSnippets() {+function AllTextSnippets() {var query = document.getElementsByName("former")[0].value;var span = document.getElementsByTagName("span");for(var x=0;x<span.length;x++) {if (span[x].className == 'snippetLoading') {var url = document.getElementById("url" + span[x].id);- requestSnippet(url,query);+ requestTextSnippet(url,query);}}}-function requestSnippet(url, query){+function requestTextSnippet(url, query){var request=createRequestObject();request.open('get', '/xml/snippet.xml?url=' + escape(url) + '&search=' + escape(query) + '&remove=true',true);- request.onreadystatechange = function () {handleState(request)};+ request.onreadystatechange = function () {handleTextState(request)};request.send(null);}-function handleState(req) {+function handleTextState(req) {if(req.readyState != 4){return;}diff --git a/htroot/xml/snippet.java b/htroot/xml/snippet.javaindex d15098800..39602ae3c 100644--- a/htroot/xml/snippet.java+++ b/htroot/xml/snippet.java@@ -61,6 +61,9 @@ public class snippet {}prop.put("urlHash",plasmaURL.urlHash(url));+ // attach link information+ prop.put("links", 0);+// return rewrite propertiesreturn prop;diff --git a/htroot/xml/snippet.xml b/htroot/xml/snippet.xmlindex 1e6f24879..0fb2aa22d 100644--- a/htroot/xml/snippet.xml+++ b/htroot/xml/snippet.xml@@ -3,4 +3,13 @@<text>#[text]#</text><status>#[status]#</status><urlHash>#[urlHash]#</urlHash>+ <links>#[linkCount]#</links>+ #{results}#+ <link>+ <type>#[type]</type>+ <href>#[href]#</href>+ <name>#[name]#</name>+ <attr>#[attr]#</attr>+ </link>+ #{/results}#</snippet>\ No newline at end of filediff --git a/htroot/yacysearch.html b/htroot/yacysearch.htmlindex 75ee4ddd2..a4f50a9ea 100644--- a/htroot/yacysearch.html+++ b/htroot/yacysearch.html@@ -117,6 +117,11 @@ available for everyone. Then stay online to support crawls from other peers. Tha<!-- link end -->#{/results}#+<script type="text/javascript">+AllTextSnippets();+addHover();+</script>+<!-- linklist end --><p>#(resultbottomline)#@@ -162,10 +167,5 @@ You can enrich the search results by using the 'global' option; you must also sw#%env/templates/footer.template%##(/display)#-<script type="text/javascript">-AllSnippets();-addHover();-</script>-</body></html>\ No newline at end of file