Skip to content

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

Keep the selected view mode when typing a new URL in the ViewFile page

luccioman0b6aed4de6ed
diff --git a/htroot/ViewFile.html b/htroot/ViewFile.html
index 3481c4690..c1d2ccd0d 100644
--- a/htroot/ViewFile.html
+++ b/htroot/ViewFile.html
@@ -77,6 +77,7 @@ function updatepage(str) {
<h2>View URL Content</h2>
<form method="get" action="ViewFile.html" id="searchform" accept-charset="ascii" onkeyup="xmlhttpPost(); return false;">
+ <input type="hidden" name="viewMode" value="#[viewModeValue]#" />
<fieldset><legend>Get URL Viewer</legend>
<dl>
<dt>URL:</dt>
diff --git a/htroot/ViewFile.java b/htroot/ViewFile.java
index 5a8037637..9a04a1fc6 100644
--- a/htroot/ViewFile.java
+++ b/htroot/ViewFile.java
@@ -89,6 +89,7 @@ public class ViewFile {
prop.put("topmenu", sb.getConfigBool("publicTopmenu", true) ? 1 : 0);
prop.put("moar", 0);
prop.put("viewMode", VIEW_MODE_NO_TEXT);
+ prop.put("viewModeValue", "");
prop.putHTML("error_words", "");
prop.put("error_vMode-sentences", "1");
prop.put("error", "1");
@@ -118,6 +119,7 @@ public class ViewFile {
final boolean showSnippet = post.get("show", "").equals("Show Snippet");
final String viewMode = showSnippet ? "sentences" : post.get("viewMode", "sentences");
prop.put("error_vMode-" + viewMode, "1");
+ prop.put("viewModeValue", viewMode);
DigestURL url = null;
String descr = "";