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

Otherwise, when interested in viewing `Link List` for example, each time
you typed a new URL, `Parsed Sentences` view mode was selected as
default and you had to selected again the view mode you are insterested
in.
pull/167/merge
luccioman 7 years ago
parent db55eaa673
commit 0b6aed4de6

@ -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>

@ -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 = "";

Loading…
Cancel
Save