diff options
Diffstat (limited to 'web/templates/layout.html')
-rw-r--r-- | web/templates/layout.html | 14 |
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> |