no focus on preview frames for search integration

fixes bug http://bugs.yacy.net/view.php?id=161
pull/1/head
Lotus 13 years ago
parent 0b3f39136e
commit 78f0d8f046

@ -5,7 +5,7 @@
<title>YaCy '#[clientname]#': Integration of a Search Portal</title>
#%env/templates/metas.template%#
</head>
<body id="ConfigSkins" onload="document.getElementById('promoteSearchPageGreeting').focus()">
<body id="ConfigSkins">
#%env/templates/header.template%#
#%env/templates/submenuPortalIntegration.template%#
<h2>Integration of a Search Portal</h2>
@ -156,7 +156,7 @@
</pre></fieldset>
This would look like:
<iframe name="target"
src="http://#[myaddress]#/index.html?display=2&amp;resource=local"
src="http://#[myaddress]#/index.html?display=2&amp;resource=local&amp;focus=0"
width="100%"
height="410"
frameborder="0"
@ -179,7 +179,7 @@
</pre></fieldset>
This would look like:
<iframe name="target2"
src="http://#[myaddress]#/yacysearch.html?display=2&amp;resource=local"
src="http://#[myaddress]#/yacysearch.html?display=2&amp;resource=local&amp;focus=0"
width="100%"
height="180"
frameborder="0"
@ -203,7 +203,7 @@
</pre></fieldset>
This would look like:
<iframe name="target3"
src="http://#[myaddress]#/yacyinteractive.html?display=2"
src="http://#[myaddress]#/yacyinteractive.html?display=2&amp;focus=0"
width="100%"
height="180"
frameborder="0"

@ -20,7 +20,7 @@
</style>
<script type="text/javascript">
<!--
imagestub = "WebStructurePicture_p.png?host=#[besthost]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[time]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot=#[colordot]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#";
imagestub = "WebStructurePicture_p.png?host=#[besthost]#&depth=#[depth]#&width=#[width]#&height=#[height]#&nodes=#[nodes]#&time=#[time]#&colortext=#[colortext]#&colorback=#[colorback]#&colordot=#[colordot]#&colorline=#[colorline]#&colorlineend=#[colorlineend]#";
idx = 0;
setTimeout("doanimation()", 3000);
function doanimation() {

@ -52,7 +52,7 @@
});
</script>
</head>
<body id="index" onload="document.getElementById('search').focus()">
<body id="index" onload="#(focus)#::document.getElementById('search').focus()#(/focus)#">
#(topmenu)#
#%env/templates/embeddedheader.template%#
::
@ -218,7 +218,9 @@
#(/searchoptions)#
</form>
<script type="text/javascript">
#(focus)#::
document.getElementById("search").focus();
#(/focus)#
</script>
#(topmenu)#

@ -60,6 +60,7 @@ public class index {
}
boolean global = (post == null) ? true : post.get("resource", "global").equals("global");
final boolean focus = (post == null) ? true : post.get("focus", "1").equals("1");
int searchoptions = (post == null) ? 0 : Math.min(1, post.getInt("searchoptions", 0));
if (!sb.getConfigBool("search.options", true)) searchoptions = 0;
@ -115,6 +116,7 @@ public class index {
prop.put("type", type);
prop.put("depth", "0");
prop.put("topmenu", sb.getConfigBool("publicTopmenu", true) ? 1 : 0);
prop.put("focus", focus ? 1 : 0);
prop.put("pi", sb.getConfigBool("publicAdministratorPi", false) ? 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);

@ -80,7 +80,9 @@ var q = "#[query]#";
var s = "#[startRecord]#";
var m = "#[maximumRecords]#";
if (q != "") search(q, m, s);
#(focus)#::
document.getElementById("search").focus();
#(/focus)#
//]]>
</script>
#%env/templates/footer.template%#

@ -49,11 +49,13 @@ public class yacyinteractive {
final String query = (post == null) ? "" : post.get("query", "");
final String startRecord = (post == null) ? "0" : post.get("startRecord", "");
final String maximumRecords = (post == null) ? "10" : post.get("maximumRecords", "");
final boolean focus = (post == null) ? true : post.get("focus", "1").equals("1");
prop.putHTML("query", query);
prop.put("startRecord", startRecord);
prop.put("maximumRecords", maximumRecords);
prop.putHTML("querys", query.replaceAll(" ", "+"));
prop.put("serverlist", query.length() == 0 ? 1 : 0);
prop.put("focus", focus ? 1 : 0);
prop.put("allowrealtime", sb.indexSegments.URLCount() < 100000 ? 1 : 0);
return prop;
}

@ -98,7 +98,9 @@ $(function() {
$("#sidebarNameSpace").accordion({});
$("#sidebarTopics").tagcloud({type:"sphere",power:.25,seed:0,sizemin:10,sizemax:20,height:80,colormin:"682",colormax:"20C"}).find("li").tsort();
$("#sidebarAbout").accordion({});
#(focus)#::
$("#search").focus();
#(/focus)#
});
//]]>
</script>
@ -176,7 +178,9 @@ document.getElementById("Enter").value = "search again";
<!-- the search results -->
<script type="text/javascript">
var progressbar = new Progressbar(#[results]#, document.getElementById("results"));
#(focus)#::
document.getElementById("search").focus();
#(/focus)#
</script>
<div style="float:left; width:70%;">

@ -118,6 +118,10 @@ public class yacysearch {
final servletProperties prop = new servletProperties();
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);
// produce vocabulary navigation sidebars
Collection<Vocabulary> vocabularies = LibraryProvider.autotagging.getVocabularies();
int j = 0;

Loading…
Cancel
Save