From aa01c78722a8ab83b16924f576ef55a2548abbfe Mon Sep 17 00:00:00 2001 From: orbiter Date: Tue, 7 Feb 2006 22:40:54 +0000 Subject: [PATCH] - added bookmarks to main menu - added '+' to search results; this can be used to add search results to bookmarks git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1567 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/Bookmarks_p.java | 27 ++++++++++++++++++--------- htroot/env/templates/header.template | 1 + htroot/index.html | 12 ++++++++---- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/htroot/Bookmarks_p.java b/htroot/Bookmarks_p.java index efed2c9af..5fef108fb 100644 --- a/htroot/Bookmarks_p.java +++ b/htroot/Bookmarks_p.java @@ -98,16 +98,25 @@ public class Bookmarks_p { } if(post.containsKey("edit")){ String urlHash=(String) post.get("edit"); - bookmarksDB.Bookmark bookmark = switchboard.bookmarksDB.getBookmark(urlHash); - prop.put("edit", 1); //edit mode - prop.put("title", bookmark.getTitle()); - prop.put("description", bookmark.getDescription()); - prop.put("url", bookmark.getUrl()); - prop.put("tags", bookmark.getTags()); - if(bookmark.getPublic()){ - prop.put("public", 1); - }else{ + if (urlHash.length() == 0) { + prop.put("edit", 0); // create mode + prop.put("title", (String) post.get("title")); + prop.put("description", (String) post.get("description")); + prop.put("url", (String) post.get("url")); + prop.put("tags", (String) post.get("tags")); prop.put("public", 0); + } else { + bookmarksDB.Bookmark bookmark = switchboard.bookmarksDB.getBookmark(urlHash); + prop.put("edit", 1); // edit mode + prop.put("title", bookmark.getTitle()); + prop.put("description", bookmark.getDescription()); + prop.put("url", bookmark.getUrl()); + prop.put("tags", bookmark.getTags()); + if (bookmark.getPublic()) { + prop.put("public", 1); + } else { + prop.put("public", 0); + } } } if(post.containsKey("delete")){ diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template index e439255e4..195f5ce24 100644 --- a/htroot/env/templates/header.template +++ b/htroot/env/templates/header.template @@ -28,6 +28,7 @@  Global Index  Search Page  Detailed Search +   Bookmarks  Help diff --git a/htroot/index.html b/htroot/index.html index 0a517975e..d0007435e 100644 --- a/htroot/index.html +++ b/htroot/index.html @@ -13,6 +13,8 @@ picEmpty = new Image(11, 11); picEmpty.src = "/env/grafics/empty.gif"; picMinus = new Image(11, 11); picMinus.src = "/env/grafics/minus.gif"; +picPlus = new Image(11, 11); +picPlus.src = "/env/grafics/plus.gif";
@@ -150,11 +152,13 @@ from 'late' peers. #{results}#

+ +bookmark  +#[description]#
-delete #[description]#
-#(snippet)#:: #[text]#
#(/snippet)# - #[urlname]#
- #[date]# | YBR-#[ybr]# | Info
+delete  +#(snippet)#::#[text]#
#(/snippet)##[urlname]#
+  #[date]# | YBR-#[ybr]# | Info

#{/results}#