Team:Peking S/copy
From 2011.igem.org
(Difference between revisions)
Line 1: | Line 1: | ||
- | |||
<html xmlns="http://www.w3.org/1999/xhtml"> | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | <head> | ||
Line 7: | Line 6: | ||
<body> | <body> | ||
+ | |||
Line 12: | Line 12: | ||
<script src="http://www.google.com/jsapi" type="text/javascript"></script> | <script src="http://www.google.com/jsapi" type="text/javascript"></script> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | google.load('search', '1', {language : ' | + | function parseQueryFromUrl () { |
+ | var queryParamName = "q"; | ||
+ | var search = window.location.search.substr(1); | ||
+ | var parts = search.split('&'); | ||
+ | for (var i = 0; i < parts.length; i++) { | ||
+ | var keyvaluepair = parts[i].split('='); | ||
+ | if (decodeURIComponent(keyvaluepair[0]) == queryParamName) { | ||
+ | return decodeURIComponent(keyvaluepair[1].replace(/\+/g, ' ')); | ||
+ | } | ||
+ | } | ||
+ | return ''; | ||
+ | } | ||
+ | google.load('search', '1', {language : 'en', style : google.loader.themes.GREENSKY}); | ||
google.setOnLoadCallback(function() { | google.setOnLoadCallback(function() { | ||
- | var customSearchControl = new google.search.CustomSearchControl('016223350660571007381: | + | var customSearchControl = new google.search.CustomSearchControl('016223350660571007381:hi1vf6exqtq'); |
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); | customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); | ||
- | customSearchControl.draw('cse'); | + | var options = new google.search.DrawOptions(); |
+ | options.enableSearchResultsOnly(); | ||
+ | customSearchControl.draw('cse', options); | ||
+ | var queryFromUrl = parseQueryFromUrl(); | ||
+ | if (queryFromUrl) { | ||
+ | customSearchControl.execute(queryFromUrl); | ||
+ | } | ||
}, true); | }, true); | ||
</script> | </script> | ||
- | + | <style type="text/css"> | |
+ | .gsc-control-cse { | ||
+ | font-family: Georgia, serif; | ||
+ | border-color: #E1F3DA; | ||
+ | background-color: #E1F3DA; | ||
+ | } | ||
+ | .gsc-tabHeader.gsc-tabhInactive { | ||
+ | border-color: #A9DA92; | ||
+ | background-color: #FFFFFF; | ||
+ | } | ||
+ | .gsc-tabHeader.gsc-tabhActive { | ||
+ | border-color: #A9DA92; | ||
+ | background-color: #A9DA92; | ||
+ | } | ||
+ | .gsc-tabsArea { | ||
+ | border-color: #A9DA92; | ||
+ | } | ||
+ | .gsc-webResult.gsc-result { | ||
+ | border-color: #A9DA92; | ||
+ | background-color: #FFFFFF; | ||
+ | } | ||
+ | .gsc-webResult.gsc-result:hover { | ||
+ | border-color: #A9DA92; | ||
+ | background-color: #FFFFFF; | ||
+ | } | ||
+ | .gs-webResult.gs-result a.gs-title:link, | ||
+ | .gs-webResult.gs-result a.gs-title:link b { | ||
+ | color: #0066CC; | ||
+ | } | ||
+ | .gs-webResult.gs-result a.gs-title:visited, | ||
+ | .gs-webResult.gs-result a.gs-title:visited b { | ||
+ | color: #0066CC; | ||
+ | } | ||
+ | .gs-webResult.gs-result a.gs-title:hover, | ||
+ | .gs-webResult.gs-result a.gs-title:hover b { | ||
+ | color: #0066CC; | ||
+ | } | ||
+ | .gs-webResult.gs-result a.gs-title:active, | ||
+ | .gs-webResult.gs-result a.gs-title:active b { | ||
+ | color: #0066CC; | ||
+ | } | ||
+ | .gsc-cursor-page { | ||
+ | color: #0066CC; | ||
+ | } | ||
+ | a.gsc-trailing-more-results:link { | ||
+ | color: #0066CC; | ||
+ | } | ||
+ | .gs-webResult .gs-snippet { | ||
+ | color: #454545; | ||
+ | } | ||
+ | .gs-webResult div.gs-visibleUrl { | ||
+ | color: #815FA7; | ||
+ | } | ||
+ | .gs-webResult div.gs-visibleUrl-short { | ||
+ | color: #815FA7; | ||
+ | } | ||
+ | .gs-webResult div.gs-visibleUrl-short { | ||
+ | display: none; | ||
+ | } | ||
+ | .gs-webResult div.gs-visibleUrl-long { | ||
+ | display: block; | ||
+ | } | ||
+ | .gsc-cursor-box { | ||
+ | border-color: #A9DA92; | ||
+ | } | ||
+ | .gsc-results .gsc-cursor-box .gsc-cursor-page { | ||
+ | border-color: #A9DA92; | ||
+ | background-color: #FFFFFF; | ||
+ | color: #0066CC; | ||
+ | } | ||
+ | .gsc-results .gsc-cursor-box .gsc-cursor-current-page { | ||
+ | border-color: #A9DA92; | ||
+ | background-color: #A9DA92; | ||
+ | color: #0066CC; | ||
+ | } | ||
+ | .gs-promotion { | ||
+ | border-color: #94CC7A; | ||
+ | background-color: #CBE8B4; | ||
+ | } | ||
+ | .gs-promotion a.gs-title:link, | ||
+ | .gs-promotion a.gs-title:link *, | ||
+ | .gs-promotion .gs-snippet a:link { | ||
+ | color: #0066CC; | ||
+ | } | ||
+ | .gs-promotion a.gs-title:visited, | ||
+ | .gs-promotion a.gs-title:visited *, | ||
+ | .gs-promotion .gs-snippet a:visited { | ||
+ | color: #0066CC; | ||
+ | } | ||
+ | .gs-promotion a.gs-title:hover, | ||
+ | .gs-promotion a.gs-title:hover *, | ||
+ | .gs-promotion .gs-snippet a:hover { | ||
+ | color: #0066CC; | ||
+ | } | ||
+ | .gs-promotion a.gs-title:active, | ||
+ | .gs-promotion a.gs-title:active *, | ||
+ | .gs-promotion .gs-snippet a:active { | ||
+ | color: #0066CC; | ||
+ | } | ||
+ | .gs-promotion .gs-snippet, | ||
+ | .gs-promotion .gs-title .gs-promotion-title-right, | ||
+ | .gs-promotion .gs-title .gs-promotion-title-right * { | ||
+ | color: #454545; | ||
+ | } | ||
+ | .gs-promotion .gs-visibleUrl, | ||
+ | .gs-promotion .gs-visibleUrl-short { | ||
+ | color: #815FA7; | ||
+ | } | ||
+ | </style> | ||
</body> | </body> | ||
</html> | </html> |
Revision as of 09:41, 19 July 2011
Loading