preparations for media snippets

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3064 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent 52abbd4131
commit fb9e0f0284

@ -1,24 +1,24 @@
function AllSnippets() { function AllTextSnippets() {
var query = document.getElementsByName("former")[0].value; var query = document.getElementsByName("former")[0].value;
var span = document.getElementsByTagName("span"); var span = document.getElementsByTagName("span");
for(var x=0;x<span.length;x++) { for(var x=0;x<span.length;x++) {
if (span[x].className == 'snippetLoading') { if (span[x].className == 'snippetLoading') {
var url = document.getElementById("url" + span[x].id); 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(); var request=createRequestObject();
request.open('get', '/xml/snippet.xml?url=' + escape(url) + '&search=' + escape(query) + '&remove=true',true); 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); request.send(null);
} }
function handleState(req) { function handleTextState(req) {
if(req.readyState != 4){ if(req.readyState != 4){
return; return;
} }

@ -61,6 +61,9 @@ public class snippet {
} }
prop.put("urlHash",plasmaURL.urlHash(url)); prop.put("urlHash",plasmaURL.urlHash(url));
// attach link information
prop.put("links", 0);
// return rewrite properties // return rewrite properties
return prop; return prop;

@ -3,4 +3,13 @@
<text>#[text]#</text> <text>#[text]#</text>
<status>#[status]#</status> <status>#[status]#</status>
<urlHash>#[urlHash]#</urlHash> <urlHash>#[urlHash]#</urlHash>
<links>#[linkCount]#</links>
#{results}#
<link>
<type>#[type]</type>
<href>#[href]#</href>
<name>#[name]#</name>
<attr>#[attr]#</attr>
</link>
#{/results}#
</snippet> </snippet>

@ -117,6 +117,11 @@ available for everyone. Then stay online to support crawls from other peers. Tha
<!-- link end --> <!-- link end -->
#{/results}# #{/results}#
<script type="text/javascript">
AllTextSnippets();
addHover();
</script>
<!-- linklist end --> <!-- linklist end -->
<p> <p>
#(resultbottomline)# #(resultbottomline)#
@ -162,10 +167,5 @@ You can enrich the search results by using the 'global' option; you must also sw
#%env/templates/footer.template%# #%env/templates/footer.template%#
#(/display)# #(/display)#
<script type="text/javascript">
AllSnippets();
addHover();
</script>
</body> </body>
</html> </html>
Loading…
Cancel
Save