Skip to content

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

YaCy-UI: - fix for folders - first experiments with topwords - first experiments with bookmark tag folder

apfelmaennchen5d806623d58d
diff --git a/htroot/yacy/ui/index.html b/htroot/yacy/ui/index.html
index bc3af5215..70c8cada3 100644
--- a/htroot/yacy/ui/index.html
+++ b/htroot/yacy/ui/index.html
@@ -58,6 +58,7 @@
$(function() {
qtag = "";
flex = {};
+ bmk_tab = 2;
tabid = "#Welcome";
/* Initialize Tabs and set up close function */
$tabs = $('#tabs-container').tabs({
@@ -105,8 +106,7 @@
ui.panel - element, that contains the selected/clicked tab contents
ui.index - zero-based index of the selected (clicked) tab
*/
- tabid = "#"+ui.panel.id;
- var bmk_tab = 2;
+ tabid = "#"+ui.panel.id;
if (ui.index == bmk_tab) {
$("#searchbox select[name='resource']").setValue('ymarks');
$("#searchbox input[name='contentdom']").setValue('text');
diff --git a/htroot/yacy/ui/sidebar/sidebar_1.html b/htroot/yacy/ui/sidebar/sidebar_1.html
index c34b1ac35..e73aa591c 100644
--- a/htroot/yacy/ui/sidebar/sidebar_1.html
+++ b/htroot/yacy/ui/sidebar/sidebar_1.html
@@ -15,24 +15,26 @@
unique: false,
toggle: function() {
var $this = $(this);
- if ($this.hasClass("expandable")) {
- var select = "li:has(ul li[id="+$this.attr("id")+"])";
- qtag = $(select).attr("id");
- if (!qtag) qtag = "/";
- $this.addClass("hasChildren");
- $this.find("ul").empty();
- if (tabid == "#Bookmarks") {
- reloadBM();
- }
- } else if ($this.hasClass("collapsable")) {
- qtag = $this.attr("id");
- if (tabid == "#Bookmarks") {
- reloadBM();
- }
+ if (!$this.attr("id") == "bmk_tags_folder") {
+ if ($this.hasClass("expandable")) {
+ var select = "li:has(ul li[id="+$this.attr("id")+"])";
+ qtag = $(select).attr("id");
+ if (!qtag) qtag = "/";
+ $this.addClass("hasChildren");
+ $this.find("ul").empty();
+ if ($tabs.tabs.index == bmk_tab) {
+ reloadBM();
+ }
+ } else if ($this.hasClass("collapsable")) {
+ qtag = $this.attr("id");
+ if ($tabs.tabs.index == bmk_tab) {
+ reloadBM();
+ }
+ }
}
}
});
-
+
/* Menu .click(function() */
$("#searchtext").click(function () {
$("#side2").accordion("activate", 0);
diff --git a/htroot/yacy/ui/sidebar/sidebar_2.html b/htroot/yacy/ui/sidebar/sidebar_2.html
index 31de5389d..851448f9a 100644
--- a/htroot/yacy/ui/sidebar/sidebar_2.html
+++ b/htroot/yacy/ui/sidebar/sidebar_2.html
@@ -12,6 +12,10 @@
loadTagCloud();
});
+ $("#topwords").treeview({
+ unique: true
+ });
+
function loadTagCloud() {
$("#tagcloud *").remove();
$("#sidebar-2-1").toggleClass("ui.loading");
@@ -21,6 +25,7 @@
dataType: "xml",
cache: false,
success: function(xml) {
+ var bhtml = "<li id='bmk_tags_folder' class='closed'><span class='folder'>Bookmark Tags</span><ul>";
$(xml).find('tag').each(function(){
var count = $(this).attr('count');
var tag = $(this).attr('tag');
@@ -33,13 +38,19 @@
qtag = $(this).text().replace(/\s+/g,"");
$("select[name='resource']").setValue('ymarks');
$("input[name='search']").setValue(qtag);
- if (tabid == "#Bookmarks") {
+ if ($tabs.tabs.index == bmk_tab) {
reloadBM();
} else {
$tabs.tabs('select',2);
}
- });
+ });
+ bhtml = bhtml + "<li><span class='tag'>"+tag+"</span></li>";
}); //close each(
+ bhtml = bhtml + "</ul></li>";
+ var bfold = $(bhtml).prependTo("#yfolder");
+ $("#yfolder").treeview({
+ add: bfold
+ });
$("#sidebar-2-1").toggleClass("ui.loading");
}
}); //close $.ajax(
@@ -47,7 +58,7 @@
//]]>
</script>
-<h3><a href="#">Search Options</a></h3><!-- 0 -->
+<h3 id="sidebar-2-0"><a href="#">Search Options</a></h3><!-- 0 -->
<div class="yform">
<form id="yoptions" class="small" method="get" action="" accept-charset="UTF-8">
<p>
@@ -76,6 +87,16 @@
<p id="tagcloud"></p>
</div>
+<h3 id="sidebar-2-2"><a href="#">Topwords</a></h3><!-- 2 -->
+<div>
+ <ul id="topwords" class="filetree">
+ <li><span class='folder'>Topwords</span>
+ <ul id="topul">
+ </ul>
+ </li>
+ </ul>
+</div>
+
diff --git a/htroot/yacy/ui/yacyui-search.html b/htroot/yacy/ui/yacyui-search.html
index e675a3573..3e73137c5 100644
--- a/htroot/yacy/ui/yacyui-search.html
+++ b/htroot/yacy/ui/yacyui-search.html
@@ -37,6 +37,7 @@
height: height,
autoload: true,
onSuccess: function() {
+ $("#side2").accordion("activate", 2);
$("a.favicon").faviconize({
position: "before",
defaultImage: "img-2/article.png",
@@ -45,7 +46,8 @@
},
preProcess: function(data) {
var total = data.channels[0].totalResults.replace(/[,.]/,"");
- var page = (data.channels[0].startIndex / data.channels[0].itemsPerPage) + 1;
+ var page = (data.channels[0].startIndex / data.channels[0].itemsPerPage) + 1;
+ var search = data.channels[0].searchTerms;
var rows = {};
$.each (
data.channels[0].items,
@@ -56,7 +58,22 @@
rows[i] = {id: item.guid, cell: [item.guid, fav, html, "Tags", "Folders", item.pubDate]};
}
}
+ );
+ var bhtml = "<li id='"+search+"'><span class='folder'>"+search+"</span><ul>";
+ $.each (
+ data.channels[0].topwords,
+ function(i,topword) {
+ if (topword) {
+ bhtml = bhtml + "<li><span class='topword'>"+topword.word+"</span></li>";
+ }
+ }
);
+ bhtml = bhtml + "</ul></li>";
+ var bfold = $(bhtml).prependTo("#topul");
+ $("#topwords").treeview({
+ add: bfold
+ });
+
var pdata = {
page: page,
total: total,
@@ -99,7 +116,7 @@
dataType: p.dataType,
success: function(data){
/* yacy limits itemsPerPage for unauthenticated users */
- p.rp = parseInt(data.channels[0].itemsPerPage);
+ p.rp = parseInt(data.channels[0].itemsPerPage);
g.flexAddData(data);
},
error: function(data) {