fix for domain options in search box

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6848 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2010-04-30 21:53:20 +00:00
parent fc5efcc05a
commit 5efc0dce0b
5 changed files with 18 additions and 12 deletions

View File

@ -698,7 +698,7 @@ stacker.slots = 2000
# search domains. If set to false then that search is not available
search.text = true
search.images = true
search.image = true
search.audio = true
search.video = true
search.app = true

View File

@ -32,6 +32,7 @@
<input name="query" id="search" type="text" size="52" maxlength="80" value="#[former]#" />
<input type="submit" name="Enter" value="Search" />
<input type="hidden" name="verify" value="true" />
#(searchdomswitches)#::
<div class="yacysearch">
#(searchtext)#::<input type="radio" id="text" name="contentdom" value="text" #(check)#::checked="checked"#(/check)# /><label for="text">Text</label>&nbsp;&nbsp;#(/searchtext)#
#(searchimage)#::<input type="radio" id="image" name="contentdom" value="image" #(check)#::checked="checked"#(/check)# /><label for="image">Images</label>&nbsp;&nbsp;#(/searchimage)#
@ -39,6 +40,7 @@
#(searchvideo)#::<input type="radio" id="video" name="contentdom" value="video" #(check)#::checked="checked"#(/check)# /><label for="video">Video</label>&nbsp;&nbsp;#(/searchvideo)#
#(searchapp)#::<input type="radio" id="app" name="contentdom" value="app" #(check)#::checked="checked"#(/check)# /><label for="app">Applications</label>#(/searchapp)#
</div>
#(/searchdomswitches)#
<input type="hidden" name="nav" value="all" />
#(searchoptions)#
<input type="hidden" name="maximumRecords" value="#[maximumRecords]#" />

View File

@ -120,12 +120,13 @@ public class index {
prop.put("depth", "0");
prop.put("display", display);
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);
prop.put("searchdomswitches_searchaudio", sb.getConfigBool("search.audio", true) ? 1 : 0);
prop.put("searchdomswitches_searchvideo", sb.getConfigBool("search.video", true) ? 1 : 0);
prop.put("searchdomswitches_searchimage", sb.getConfigBool("search.image", true) ? 1 : 0);
prop.put("searchdomswitches_searchapp", sb.getConfigBool("search.app", true) ? 1 : 0);
prop.put("searchoptions_display", display);
prop.put("searchtext", sb.getConfigBool("search.text", true) ? 1 : 0);
prop.put("searchaudio", sb.getConfigBool("search.audio", true) ? 1 : 0);
prop.put("searchvideo", sb.getConfigBool("search.video", true) ? 1 : 0);
prop.put("searchimage", sb.getConfigBool("search.image", true) ? 1 : 0);
prop.put("searchapp", sb.getConfigBool("search.app", true) ? 1 : 0);
prop.put("searchtext_check", (contentdom == ContentDomain.TEXT) ? "1" : "0");
prop.put("searchaudio_check", (contentdom == ContentDomain.AUDIO) ? "1" : "0");
prop.put("searchvideo_check", (contentdom == ContentDomain.VIDEO) ? "1" : "0");

View File

@ -69,8 +69,9 @@ $(function() {
<fieldset class="yacys">
<input id="search" name="query" type="text" size="50" maxlength="80" value="#[former]#" onclick="document.getElementById('Enter').value = 'Search'" />
<input id="Enter" type="submit" name="Enter" value="Search" />
#(searchdomswitches)#::
<div class="yacysearch">
#(searchtext)#::<input type="radio" id="text" name="contentdom" value="text" #(check)#::checked="checked"#(/check)# /><label for="text">Text</label>&nbsp;&nbsp;#(/searchtext)#
#(searchtext)#::<input type="radio" id="text" name="contentdom" value="text" #(check)#::checked="checked"#(/check)# /><label for="text">Text</label>&nbsp;&nbsp;#(/searchtext)#
#(searchimage)#::<input type="radio" id="image" name="contentdom" value="image" #(check)#::checked="checked"#(/check)# /><label for="image">Images</label>&nbsp;&nbsp;#(/searchimage)#
#(searchaudio)#::<input type="radio" id="audio" name="contentdom" value="audio" #(check)#::checked="checked"#(/check)# /><label for="audio">Audio</label>&nbsp;&nbsp;#(/searchaudio)#
#(searchvideo)#::<input type="radio" id="video" name="contentdom" value="video" #(check)#::checked="checked"#(/check)# /><label for="video">Video</label>&nbsp;&nbsp;#(/searchvideo)#
@ -78,6 +79,7 @@ $(function() {
&nbsp;
<a href="index.html?display=#[display]#&amp;searchoptions=1&amp;count=#[count]#&amp;resource=#[resource]#&amp;urlmaskfilter=#[urlmaskfilter]#&amp;prefermaskfilter=#[prefermaskfilter]#&amp;cat=#[cat]#&amp;constraint=#[constraint]#&amp;contentdom=#[contentdom]#&amp;former=#[former]#&amp;meanCount=#[meanCount]#">more options</a>
</div>
#(/searchdomswitches)#
<input type="hidden" name="former" value="#[former]#" />
<input type="hidden" name="maximumRecords" value="#[count]#" />
<input type="hidden" name="startRecord" value="#[offset]#" />

View File

@ -685,11 +685,12 @@ public class yacysearch {
prop.put("constraint", (constraint == null) ? "" : constraint.exportB64());
prop.put("verify", (fetchSnippets) ? "true" : "false");
prop.put("contentdom", (post == null ? "text" : post.get("contentdom", "text")));
prop.put("searchtext", sb.getConfigBool("search.text", true) ? 1 : 0);
prop.put("searchaudio", sb.getConfigBool("search.audio", true) ? 1 : 0);
prop.put("searchvideo", sb.getConfigBool("search.video", true) ? 1 : 0);
prop.put("searchimage", sb.getConfigBool("search.image", true) ? 1 : 0);
prop.put("searchapp", sb.getConfigBool("search.app", true) ? 1 : 0);
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);
prop.put("searchdomswitches_searchaudio", sb.getConfigBool("search.audio", true) ? 1 : 0);
prop.put("searchdomswitches_searchvideo", sb.getConfigBool("search.video", true) ? 1 : 0);
prop.put("searchdomswitches_searchimage", sb.getConfigBool("search.image", true) ? 1 : 0);
prop.put("searchdomswitches_searchapp", sb.getConfigBool("search.app", true) ? 1 : 0);
prop.put("searchtext_check", (contentdom == ContentDomain.TEXT) ? "1" : "0");
prop.put("searchaudio_check", (contentdom == ContentDomain.AUDIO) ? "1" : "0");
prop.put("searchvideo_check", (contentdom == ContentDomain.VIDEO) ? "1" : "0");