Skip to content

Commit

Permalink
- when there are no topics, the topics window is not shown
Browse files Browse the repository at this point in the history
- othervise: close topics window by default
There will be more navigation in the future (i.e. update-time selection)
and the topics will be less important than the others, therefore
it is now hidden by default

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6310 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Sep 11, 2009
1 parent 27d0028 commit 5658044
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
1 change: 1 addition & 0 deletions htroot/yacysearch.html
Expand Up @@ -55,6 +55,7 @@
$("#sidebar2").accordion({});
$("#sidebar2").accordion('activate', false);
$("#sidebar3").accordion({});
$("#sidebar3").accordion('activate', false);
$("#search").focus();
});
//]]>
Expand Down
42 changes: 23 additions & 19 deletions htroot/yacysearchtrailer.java
Expand Up @@ -106,27 +106,31 @@ public static serverObjects respond(final RequestHeader header, final serverObje

// attach always the topics
ArrayList<NavigatorEntry> topicNavigator = theSearch.getTopicNavigator(10);
if (topicNavigator == null) topicNavigator = new ArrayList<NavigatorEntry>();
int i = 0;
NavigatorEntry e;
Iterator<NavigatorEntry> iter = topicNavigator.iterator();
while (iter.hasNext()) {
e = iter.next();
if (/*(theQuery == null) ||*/ (theQuery.queryString == null)) break;
if (e != null && e.name != null) {
prop.putHTML("nav-topics_element_" + i + "_name", e.name);
prop.put("nav-topics_element_" + i + "_url", "<a href=\"" + QueryParams.navurl("html", 0, display, theQuery, theQuery.urlMask, e.name, theQuery.navigators) + "\">" + e.name + " (" + e.count + ")</a>");
prop.putJSON("nav-topics_element_" + i + "_url-json", QueryParams.navurl("json", 0, display, theQuery, theQuery.urlMask, e.name, theQuery.navigators));
prop.put("nav-topics_element_" + i + "_count", e.count);
prop.put("nav-topics_element_" + i + "_modifier", e.name);
prop.put("nav-topics_element_" + i + "_nl", (iter.hasNext() && i < MAX_TOPWORDS) ? 1 : 0);
}
if (i++ > MAX_TOPWORDS) {
break;
if (topicNavigator == null || topicNavigator.size() == 0) {
topicNavigator = new ArrayList<NavigatorEntry>();
prop.put("nav-topics", "0");
} else {
prop.put("nav-topics", "1");
int i = 0;
NavigatorEntry e;
Iterator<NavigatorEntry> iter = topicNavigator.iterator();
while (iter.hasNext()) {
e = iter.next();
if (/*(theQuery == null) ||*/ (theQuery.queryString == null)) break;
if (e != null && e.name != null) {
prop.putHTML("nav-topics_element_" + i + "_name", e.name);
prop.put("nav-topics_element_" + i + "_url", "<a href=\"" + QueryParams.navurl("html", 0, display, theQuery, theQuery.urlMask, e.name, theQuery.navigators) + "\">" + e.name + " (" + e.count + ")</a>");
prop.putJSON("nav-topics_element_" + i + "_url-json", QueryParams.navurl("json", 0, display, theQuery, theQuery.urlMask, e.name, theQuery.navigators));
prop.put("nav-topics_element_" + i + "_count", e.count);
prop.put("nav-topics_element_" + i + "_modifier", e.name);
prop.put("nav-topics_element_" + i + "_nl", (iter.hasNext() && i < MAX_TOPWORDS) ? 1 : 0);
}
if (i++ > MAX_TOPWORDS) {
break;
}
}
prop.put("nav-topics_element", i);
}
prop.put("nav-topics_element", i);
prop.put("nav-topics", "1");

serverProfiling.update("SEARCH", new ProfilingGraph.searchEvent(theQuery.id(true), SearchEvent.FINALIZATION + "-" + "bottomline", 0, 0), false);

Expand Down

0 comments on commit 5658044

Please sign in to comment.