Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

- yacy portalsearch experiments with navigation in sidebar (topwords & domains) - not yet functional ...

apfelmaennchen0d44a6d5035d
diff --git a/htroot/yacy/ui/js/yacyui-portalsearch.js b/htroot/yacy/ui/js/yacyui-portalsearch.js
index a7ad0d405..c32ba8c86 100644
--- a/htroot/yacy/ui/js/yacyui-portalsearch.js
+++ b/htroot/yacy/ui/js/yacyui-portalsearch.js
@@ -30,6 +30,7 @@ $(document).ready(function() {
var style3 = yconf.url + '/yacy/ui/css/themes/'+yconf.theme+'/ui.dialog.css';
var style4 = yconf.url + '/yacy/ui/css/themes/'+yconf.theme+'/ui.theme.css';
var style5 = yconf.url + '/yacy/ui/css/themes/'+yconf.theme+'/ui.resizable.css';
+ var style6 = yconf.url + '/yacy/ui/css/themes/'+yconf.theme+'/ui.accordion.css';
var head = document.getElementsByTagName('head')[0];
@@ -48,6 +49,9 @@ $(document).ready(function() {
$(document.createElement('link'))
.attr({type:'text/css', href: style5, rel:'stylesheet', media:'screen'})
.appendTo(head);
+ $(document.createElement('link'))
+ .attr({type:'text/css', href: style6, rel:'stylesheet', media:'screen'})
+ .appendTo(head);
var script0 = yconf.url + '/yacy/ui/js/jquery.dimensions.min.js';
var script1 = yconf.url + '/yacy/ui/js/jquery.query.js';
@@ -120,7 +124,10 @@ $(document).ready(function() {
$('#yside').remove();
},
open: function(event, ui) {
- $('<div id="yside" style="padding-left:0px; margin-left:-10px;"><ul><li>text</li><li>text</li><li>text</li><li>text</li><li>text</li><li>text</li><li>text</li></ul></div>').insertAfter(".ui-dialog-content");
+ $('<div id="yside" style="padding:0px;"></div>').insertAfter(".ui-dialog-content");
+ $('<div id="ynav" style="margin0px; padding:0px;"></div>').appendTo('#yside');
+ $('<h3 style="padding-left:25px;">Topics</h3><div id="ytop"></div>').appendTo('#ynav');
+ $('<h3 style="padding-left:25px;">Domains</h3><div id="ydom"></div>').appendTo('#ynav');
var position = $(".ui-dialog").position();
$("#yside").dialog({
title: 'Navigation',
@@ -140,6 +147,11 @@ $(document).ready(function() {
});
$('.ui-widget-shadow').remove();
$('div[aria-labelledby="ui-dialog-title-yside"] div.ui-dialog-titlebar').remove();
+ $("#ynav").accordion({
+ autoHeight: false,
+ clearStyle: true,
+ header: "h3"
+ });
}
});
});
@@ -222,6 +234,32 @@ function yacysearch(global) {
defaultImage: yconf.url + "/yacy/ui/img-2/article.png",
className: "favicon"
});
+
+ $("#ytop").empty();
+ var bhtml = "<ul style='padding-left: 0px;'>";
+ $.each (
+ data.channels[0].topwords,
+ function(i,topword) {
+ if (topword) {
+ bhtml = bhtml + "<li>"+topword.word+"</li>";
+ }
+ }
+ );
+ bhtml = bhtml + "</ul>";
+ $(bhtml).appendTo("#ytop");
+
+ $("#ydom").empty();
+ var bhtml = "<ul style='padding-left: 0px;'>";
+ $.each (
+ data.channels[0].domains,
+ function(i,dom) {
+ if (dom) {
+ bhtml = bhtml + "<li>"+dom.domain+"</li>";
+ }
+ }
+ );
+ bhtml = bhtml + "</ul>";
+ $(bhtml).appendTo("#ydom");
}
);
}
\ No newline at end of file
diff --git a/htroot/yacysearchtrailer.java b/htroot/yacysearchtrailer.java
index 0d92cbc30..8b6ed6877 100644
--- a/htroot/yacysearchtrailer.java
+++ b/htroot/yacysearchtrailer.java
@@ -71,10 +71,15 @@ public class yacysearchtrailer {
} else {
prop.put("navigation", 1);
hostnaventry entry;
- for (int i = 0; i < hostNavigator.size(); i++) {
+ int i;
+ for (i = 0; i < hostNavigator.size(); i++) {
entry = hostNavigator.get(i);
prop.put("navigation_domains_" + i + "_domain", plasmaSearchQuery.navurla(0, display, theQuery, theQuery.urlMask, "site:" + entry.host) + entry.host + " (" + entry.count + ")</a>");
+ prop.putJSON("navigation_domains_" + i + "_domain-json", plasmaSearchQuery.navurla(0, display, theQuery, theQuery.urlMask, "site:" + entry.host) + entry.host + " (" + entry.count + ")</a>");
+ prop.put("navigation_domains_" + i + "_nl", 1);
}
+ i--;
+ prop.put("navigation_domains_" + i + "_nl", 0);
prop.put("navigation_domains", hostNavigator.size());
}
diff --git a/htroot/yacysearchtrailer.json b/htroot/yacysearchtrailer.json
index ec4194ac3..7a03b0d46 100644
--- a/htroot/yacysearchtrailer.json
+++ b/htroot/yacysearchtrailer.json
@@ -2,4 +2,12 @@
#{words}#
{ "word": "#[word]#" }#(nl)#::,#(/nl)#
#{/words}#
-]
\ No newline at end of file
+],
+#(navigation)#
+::
+"domains": [
+#{domains}#
+{ "domain": "#[domain-json]#" }#(nl)#::,#(/nl)#
+#{/domains}#
+]
+#(/navigation)#
\ No newline at end of file