- navigation appear at correct position when opengeodb-results are also presented after a search

- show an about box if about.headline and about.body is set

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6332 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 4db34eea73
commit 23ab6fbca4

@ -915,3 +915,8 @@ content.phpbb3.dbuser = notroot
content.phpbb3.dbpw = joshua content.phpbb3.dbpw = joshua
content.phpbb3.ppf = 1000 content.phpbb3.ppf = 1000
content.phpbb3.dumpfile = content.phpbb3.dumpfile =
# search engine teaser: an about box in search results
# this is only shown, if the about.body is filled
about.headline =
about.body =

@ -56,6 +56,7 @@ $(function() {
$("#sidebar2").accordion('activate', false); $("#sidebar2").accordion('activate', false);
$("#sidebar3").accordion({}); $("#sidebar3").accordion({});
$("#sidebar3").accordion('activate', false); $("#sidebar3").accordion('activate', false);
$("#sidebarAbout").accordion({});
$("#search").focus(); $("#search").focus();
}); });
//]]> //]]>
@ -128,9 +129,15 @@ document.getElementById("Enter").value = "search again";
<p>Searching the web with this peer is disabled for unauthorized users. Please <a href="Status.html?login=">log in</a> as administrator to use the search function</p> <p>Searching the web with this peer is disabled for unauthorized users. Please <a href="Status.html?login=">log in</a> as administrator to use the search function</p>
#(/num-results)# #(/num-results)#
<!-- the search results -->
<script type="text/javascript">
var progressbar = new Progressbar(#[results]#, document.getElementById("results"));
</script>
<div style="float:left; width:70%;">
<!-- show openstreetmap tiles if geoinfo was found --> <!-- show openstreetmap tiles if geoinfo was found -->
#(geoinfo)# #(geoinfo)#
:: ::
<div class="searchresults"> <div class="searchresults">
<h4 class="linktitle"> <h4 class="linktitle">
<img src="http://www.openstreetmap.org/favicon.ico" class="favicon" style="width:16px; height:16px;" alt="" /> <img src="http://www.openstreetmap.org/favicon.ico" class="favicon" style="width:16px; height:16px;" alt="" />
@ -150,11 +157,6 @@ document.getElementById("Enter").value = "search again";
</div> </div>
#(/geoinfo)# #(/geoinfo)#
<!-- the search results -->
<script type="text/javascript">
var progressbar = new Progressbar(#[results]#, document.getElementById("results"));
</script>
<div style="float:left; width:70%;">
<!-- linklist begin --> <!-- linklist begin -->
#(resultTable)#::<table width="100%"><tr class="TableHeader"><td width="30%">Media</td><td width="70%">URL</tr>#(/resultTable)# #(resultTable)#::<table width="100%"><tr class="TableHeader"><td width="30%">Media</td><td width="70%">URL</tr>#(/resultTable)#
#{results}# #{results}#

@ -1,6 +1,6 @@
<div id="sidebar1" style="float: right; margin-top:5px; width: 220px;"> <div id="sidebar1" style="float: right; margin-top:5px; width: 220px;">
#(nav-domains)#:: #(nav-domains)#::
<h3 style="padding-left:25px;">Domains</h3> <h3 style="padding-left:25px;">Domain Navigator</h3>
<div><ul style="padding-left: 0px;">#{element}# <div><ul style="padding-left: 0px;">#{element}#
<li>#[url]#</li> <li>#[url]#</li>
#{/element}#</ul></div> #{/element}#</ul></div>
@ -9,7 +9,7 @@
<div id="sidebar2" style="float: right; margin-top:5px; width: 220px;"> <div id="sidebar2" style="float: right; margin-top:5px; width: 220px;">
#(nav-authors)#:: #(nav-authors)#::
<h3 style="padding-left:25px;">Authors</h3> <h3 style="padding-left:25px;">Author Navigator</h3>
<div><ul style="padding-left: 0px;">#{element}# <div><ul style="padding-left: 0px;">#{element}#
<li>#[url]#</li> <li>#[url]#</li>
#{/element}#</ul></div> #{/element}#</ul></div>
@ -18,12 +18,21 @@
<div id="sidebar3" style="float: right; margin-top:5px; width: 220px;"> <div id="sidebar3" style="float: right; margin-top:5px; width: 220px;">
#(nav-topics)#:: #(nav-topics)#::
<h3 style="padding-left:25px;">Topics</h3> <h3 style="padding-left:25px;">Topic Navigator</h3>
<div><ul style="padding-left: 0px;">#{element}# <div><ul style="padding-left: 0px;">#{element}#
<li>#[url]#</li> <li>#[url]#</li>
#{/element}#</ul></div> #{/element}#</ul></div>
#(/nav-topics)# #(/nav-topics)#
</div> </div>
#(nav-about)#::
<div id="sidebarAbout" style="float: right; margin-top:5px; width: 220px;">
<h3 style="padding-left:25px;">#[headline]#</h3>
<div>
#[body]#
</div>
</div>
#(/nav-about)#

@ -104,7 +104,7 @@ public class yacysearchtrailer {
prop.put("nav-authors_element", authorNavigator.size()); prop.put("nav-authors_element", authorNavigator.size());
} }
// attach always the topics // topics navigator
ArrayList<NavigatorEntry> topicNavigator = theSearch.getTopicNavigator(10); ArrayList<NavigatorEntry> topicNavigator = theSearch.getTopicNavigator(10);
if (topicNavigator == null || topicNavigator.size() == 0) { if (topicNavigator == null || topicNavigator.size() == 0) {
topicNavigator = new ArrayList<NavigatorEntry>(); topicNavigator = new ArrayList<NavigatorEntry>();
@ -132,6 +132,17 @@ public class yacysearchtrailer {
prop.put("nav-topics_element", i); prop.put("nav-topics_element", i);
} }
// about box
String aboutBody = env.getConfig("about.body", "");
String aboutHeadline = env.getConfig("about.headline", "");
if (aboutBody.length() == 0 && aboutHeadline.length() == 0) {
prop.put("nav-about", 0);
} else {
prop.put("nav-about", 1);
prop.put("nav-about_headline", aboutHeadline);
prop.put("nav-about_body", aboutBody);
}
serverProfiling.update("SEARCH", new ProfilingGraph.searchEvent(theQuery.id(true), SearchEvent.FINALIZATION + "-" + "bottomline", 0, 0), false); serverProfiling.update("SEARCH", new ProfilingGraph.searchEvent(theQuery.id(true), SearchEvent.FINALIZATION + "-" + "bottomline", 0, 0), false);
return prop; return prop;

@ -324,9 +324,9 @@ public class ContentScraper extends AbstractScraper implements Scraper {
public byte[] getText(final String charSet) { public byte[] getText(final String charSet) {
try { try {
return content.toString().getBytes(charSet); return content.getBytes(charSet);
} catch (final UnsupportedEncodingException e) { } catch (final UnsupportedEncodingException e) {
return content.toString().getBytes(); return content.getBytes();
} }
} }

@ -28,6 +28,7 @@ import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileReader; import java.io.FileReader;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.io.Writer; import java.io.Writer;
import java.util.Properties; import java.util.Properties;
@ -268,6 +269,18 @@ public final class serverCharBuffer extends Writer {
return tmp; return tmp;
} }
public byte[] getBytes(String charset) throws UnsupportedEncodingException {
return new String(buffer, offset, length).getBytes(charset);
}
public byte[] getBytes() {
try {
return getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
return null;
}
}
public serverCharBuffer trim(final int start) { public serverCharBuffer trim(final int start) {
// the end value is outside (+1) of the wanted target array // the end value is outside (+1) of the wanted target array
if (start > length) throw new IndexOutOfBoundsException("trim: start > length"); if (start > length) throw new IndexOutOfBoundsException("trim: start > length");

Loading…
Cancel
Save