aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2011-07-08 02:08:10 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2011-07-08 02:08:10 +0000
commit7bbe6da213ec338d73b9c919b9be5749ef715277 (patch)
tree62cd78119dc6d76c7516a9221835b9b9c431da1a
parentUpdate Google custom search code. (diff)
downloadpackages-3-7bbe6da213ec338d73b9c919b9be5749ef715277.tar.gz
packages-3-7bbe6da213ec338d73b9c919b9be5749ef715277.tar.bz2
packages-3-7bbe6da213ec338d73b9c919b9be5749ef715277.zip
Change Google CSE to redirect to a google page like it used to.
-rw-r--r--web/templates/layout.html14
1 files changed, 12 insertions, 2 deletions
diff --git a/web/templates/layout.html b/web/templates/layout.html
index ae1b646..4355f5d 100644
--- a/web/templates/layout.html
+++ b/web/templates/layout.html
@@ -72,12 +72,22 @@ def alpha_url(baseurl):
<a href="/"><img src="/media/packages_gentoo_logo.jpg" alt="Gentoo Logo" /></a>
</div>
<div id="search">
- <div id="cse" style="width: 100%;">Loading</div>
<script type="text/javascript">
+ var customSearchControl = null;
+ var cse_api_key = '018159084367138638961:rusorewqzfu';
+ function executeGoogleSearch() {
+ var textNode = document.getElementById('search_input');
+ if(textNode.value != '') {
+ customSearchControl.execute(textNode.value)
+ }
+ }
google.load('search', '1', {language : 'en', style : google.loader.themes.MINIMALIST});
google.setOnLoadCallback(function() {
- var customSearchControl = new google.search.CustomSearchControl('018159084367138638961:rusorewqzfu');
+ customSearchControl = new google.search.CustomSearchControl(cse_api_key);
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
+ var options = new google.search.DrawOptions();
+ //options.enableSearchResultsOnly();
+ options.enableSearchboxOnly("http://google.com/cse?cx="+cse_api_key, null, true);
customSearchControl.draw('cse');
}, true);
</script>