From 5f983faef9fc08c94c95023ad387d9d6d40ed5c4 Mon Sep 17 00:00:00 2001 From: Roland 'Quix0r' Haeder Date: Thu, 17 May 2012 05:49:25 +0200 Subject: [PATCH] No & in JavaScript-embeded URLs, added ability to stop focus in ConfigPortal.html preview (is this not secured with _p????) Conflicts: htroot/yacyinteractive.java htroot/yacysearch.java --- htroot/index.html | 1 - htroot/yacyinteractive.java | 4 ++-- htroot/yacysearch.html | 2 +- htroot/yacysearch.java | 13 +++++++++---- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/htroot/index.html b/htroot/index.html index 277270f8e..ed78a76b5 100644 --- a/htroot/index.html +++ b/htroot/index.html @@ -1,4 +1,3 @@ - #(forward)#::#(/forward)# diff --git a/htroot/yacyinteractive.java b/htroot/yacyinteractive.java index 01696fe54..959dbec48 100644 --- a/htroot/yacyinteractive.java +++ b/htroot/yacyinteractive.java @@ -54,9 +54,9 @@ public class yacyinteractive { prop.put("startRecord", startRecord); prop.put("maximumRecords", maximumRecords); prop.putHTML("querys", query.replaceAll(" ", "+")); - prop.put("serverlist", query.length() == 0 ? 1 : 0); + prop.put("serverlist", query.isEmpty() ? 1 : 0); prop.put("focus", focus ? 1 : 0); prop.put("allowrealtime", sb.indexSegments.URLCount() < 100000 ? 1 : 0); return prop; } -} \ No newline at end of file +} diff --git a/htroot/yacysearch.html b/htroot/yacysearch.html index ade1b8ed6..d1c5fc76d 100644 --- a/htroot/yacysearch.html +++ b/htroot/yacysearch.html @@ -252,4 +252,4 @@ window.setTimeout('latestinfo();',10000); - \ No newline at end of file + diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index 617e6a495..ff82313b9 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -28,6 +28,7 @@ // if the shell's current path is HTROOT import java.io.IOException; +import java.net.InetAddress; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -120,9 +121,8 @@ public class yacysearch { prop.put("topmenu", sb.getConfigBool("publicTopmenu", true) ? 1 : 0); //get focus option - final boolean focus = (post == null) ? true : post.get("focus", "1").equals("1"); - prop.put("focus", focus ? 1 : 0); - + prop.put("focus", ((post == null) ? true : post.get("focus", "1").equals("1")) ? 1 : 0); + // produce vocabulary navigation sidebars Collection vocabularies = LibraryProvider.autotagging.getVocabularies(); int j = 0; @@ -1104,7 +1104,12 @@ public class yacysearch { prop.putXML("rss_query", originalquerystring); prop.putXML("rss_queryenc", originalquerystring.replace(' ', '+')); - sb.localSearchLastAccess = System.currentTimeMillis(); + sb.localSearchLastAccess = System.currentTimeMillis(); + + // hostname and port (assume locahost if nothing helps) + final InetAddress hostIP = Domains.myPublicLocalIP(); + prop.put("myhost", hostIP != null ? hostIP.getHostAddress() : "localhost"); + prop.put("myport", serverCore.getPortNr(sb.getConfig("port", "8090"))); // return rewrite properties return prop;