From 5d806623d58dddb099b39a19de5f7d4ac37e5489 Mon Sep 17 00:00:00 2001 From: apfelmaennchen Date: Sun, 22 Feb 2009 15:59:24 +0000 Subject: [PATCH] YaCy-UI: - fix for folders - first experiments with topwords - first experiments with bookmark tag folder git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5634 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/yacy/ui/index.html | 4 ++-- htroot/yacy/ui/sidebar/sidebar_1.html | 32 ++++++++++++++------------- htroot/yacy/ui/sidebar/sidebar_2.html | 27 +++++++++++++++++++--- htroot/yacy/ui/yacyui-search.html | 21 ++++++++++++++++-- 4 files changed, 62 insertions(+), 22 deletions(-) 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 = "
  • Bookmark Tags
  • "; + var bfold = $(bhtml).prependTo("#yfolder"); + $("#yfolder").treeview({ + add: bfold + }); $("#sidebar-2-1").toggleClass("ui.loading"); } }); //close $.ajax( @@ -47,7 +58,7 @@ //]]> -

    Search Options

    +

    @@ -76,6 +87,16 @@

    + +
    + +
    + 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 = "
  • "+search+"
  • "; + 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) {