From 4565b2f2c075c961b354873440dd856a51b26748 Mon Sep 17 00:00:00 2001
From: orbiter
Date: Wed, 8 Dec 2010 10:50:23 +0000
Subject: [PATCH] removed the display option from index.html, yacysearch.html
and yacyinteractive.html instead, a setting at ConfigPortal.html can be made
to define if the topmenu shall be shown at these pages or if there is no
naviagtion at all.
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7366 6c8d7289-2bf4-0310-a012-ef5d649a1542
---
defaults/yacy.init | 5 +++
htroot/ConfigPortal.html | 6 ++++
htroot/ConfigPortal.java | 4 +++
htroot/env/templates/header.template | 4 +--
htroot/index.html | 27 ++++++----------
htroot/index.java | 11 +------
htroot/js/yacyinteractive.js | 2 ++
htroot/yacyinteractive.html | 31 ++++++++++---------
htroot/yacyinteractive.java | 10 +-----
htroot/yacysearch.html | 23 ++++++--------
htroot/yacysearch.java | 26 ++++------------
htroot/yacysearchitem.html | 2 +-
htroot/yacysearchitem.java | 2 --
htroot/yacysearchtrailer.java | 20 ++++++------
.../anomic/http/server/HTTPDFileHandler.java | 25 ++++++++++-----
source/de/anomic/search/QueryParams.java | 9 ++----
16 files changed, 92 insertions(+), 115 deletions(-)
diff --git a/defaults/yacy.init b/defaults/yacy.init
index de55cd76a..9626d591a 100644
--- a/defaults/yacy.init
+++ b/defaults/yacy.init
@@ -831,6 +831,11 @@ currentSkin=pdblue
publicSurftips = true
publicSearchpage = true
+# flag to show if the top navigation bar shall be shown to all users
+# if this is disabled, then the user must navigate manually from the search page
+# to /Status.html to get the main memu bar back
+publicTopmenu = true
+
# Wiki access rights
# the built-in wiki system allows by default only that the administrator is allowed to make changes
# this can be changed. There are three options:
diff --git a/htroot/ConfigPortal.html b/htroot/ConfigPortal.html
index 81699851f..65dabd883 100644
--- a/htroot/ConfigPortal.html
+++ b/htroot/ConfigPortal.html
@@ -30,6 +30,12 @@
URL of a Large Corporate Image
+
Show Navigation Bar on Search Page?
+
+ Show Navigation Top-Menu
+ no link to YaCy Menu (admin must navigate to /Status.html manually)
+
diff --git a/htroot/index.java b/htroot/index.java
index b476bffbd..d3badf413 100644
--- a/htroot/index.java
+++ b/htroot/index.java
@@ -63,14 +63,6 @@ public class index {
}
final boolean global = (post == null) ? true : post.get("resource", "global").equals("global");
- final boolean authenticated = sb.adminAuthenticated(header) >= 2;
- int display = (post == null) ? 0 : post.getInt("display", 0);
- if ((display == 1) && (!authenticated)) display = 0;
- final boolean browserPopUpTrigger = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_TRIGGER, "true").equals("true");
- if (browserPopUpTrigger) {
- final String browserPopUpPage = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "ConfigBasic.html");
- if (browserPopUpPage.startsWith("index") || browserPopUpPage.startsWith("yacysearch")) display = 2;
- }
final int searchoptions = (post == null) ? 0 : post.getInt("searchoptions", 0);
final String former = (post == null) ? "" : post.get("former", "");
@@ -126,7 +118,7 @@ public class index {
prop.putHTML("cat", cat);
prop.put("type", type);
prop.put("depth", "0");
- prop.put("display", display);
+ prop.put("topmenu", sb.getConfigBool("publicTopmenu", true) ? 1 : 0);
prop.putHTML("constraint", constraint);
prop.put("searchdomswitches", sb.getConfigBool("search.text", true) || sb.getConfigBool("search.audio", true) || sb.getConfigBool("search.video", true) || sb.getConfigBool("search.image", true) || sb.getConfigBool("search.app", true) ? 1 : 0);
prop.put("searchdomswitches_searchtext", sb.getConfigBool("search.text", true) ? 1 : 0);
@@ -139,7 +131,6 @@ public class index {
prop.put("searchdomswitches_searchvideo_check", (contentdom == ContentDomain.VIDEO) ? "1" : "0");
prop.put("searchdomswitches_searchimage_check", (contentdom == ContentDomain.IMAGE) ? "1" : "0");
prop.put("searchdomswitches_searchapp_check", (contentdom == ContentDomain.APP) ? "1" : "0");
- prop.put("searchoptions_display", display);
// online caution timing
sb.localSearchLastAccess = System.currentTimeMillis();
diff --git a/htroot/js/yacyinteractive.js b/htroot/js/yacyinteractive.js
index 59fc791b4..af0f35efc 100644
--- a/htroot/js/yacyinteractive.js
+++ b/htroot/js/yacyinteractive.js
@@ -1,5 +1,7 @@
function xmlhttpPost() {
var searchform = document.forms['searchform'];
+ var rsslink = document.getElementById("rsslink");
+ if (rsslink != null) rsslink.href="yacysearch.rss?query=" + searchform.query.value;
search(searchform.query.value);
}
diff --git a/htroot/yacyinteractive.html b/htroot/yacyinteractive.html
index 9274163e6..f0655ebf8 100644
--- a/htroot/yacyinteractive.html
+++ b/htroot/yacyinteractive.html
@@ -13,22 +13,23 @@ var q = "#[query]#";
if (q != "") search(q);
//]]>
-#(display)#
- #%env/templates/simpleheader.template%#
-
-
- kiosk mode
-
- ::
-
-This page uses the JSON search API to display search results as you type.
-Click the API icon to see an example call to the native API.
+#(topmenu)#
+#%env/templates/embeddedheader.template%#
+::
+
+
+
+This search result can also be retrieved as RSS/opensearch output.
+The query format is similar to SRU.
+Click the API icon to see an example call to the search rss API.
To see a list of all APIs, please visit the API wiki page.
-