Added Google Search integration. * Closes #6.
h3rald h3rald@h3rald.com
Sun, 02 Aug 2009 21:28:33 +0200
5 files changed,
60 insertions(+),
8 deletions(-)
M
ui-dev/css/elements.css
→
ui-dev/css/elements.css
@@ -226,4 +226,29 @@ border: 1px solid #C0C0C0;
background-color: #E2E9EB; } +/* Google Search */ + +.gsc-branding, .gsc-resultsHeader, .gs-visibleUrl +{ + display:none; +} + +table.gsc-search-box +{ + height: 25px; +} + +.gsc-control, .gsc-resultsRoot +{ + width: 850px; +} +.gsc-results +{ +} + +.gsc-search-box td +{ + border: none; +} +
M
ui-dev/css/layout.css
→
ui-dev/css/layout.css
@@ -84,8 +84,8 @@ }
#navigation { - color: #ccc; + margin-top: -3px; } #navigation li
M
ui-dev/css/text.css
→
ui-dev/css/text.css
@@ -44,18 +44,18 @@
/******* LINKS *******/ -a +a, a.gs-title { text-decoration:none; outline:none; } -a +a, a.gs-title { color: #A4282D; } -a:hover +a:hover, a.gs-title { color: #CF282D; }
M
ui-dev/home.htm
→
ui-dev/home.htm
@@ -26,7 +26,9 @@ <script type="text/javascript">
function tweets_received(){ $('.twitter-item[title]').qtip(dark_tooltip); } - </script> + </script> + <script src="http://www.google.com/jsapi?key=ABQIAAAA6h3j8Jri5D_da53UPbEbThRlq2n1sm52B5HDRR5tm6o8XM18FhTKn3v155RpPeD0kWnWG81QEhhifQ" type="text/javascript"></script> + <script src="js/search.js" type="text/javascript"></script> <script type="text/javascript" src="js/jquery-1.3.2.js"></script> <!-- JQuery Plugins -->@@ -61,6 +63,7 @@ <li>/<a href="#tags" class="cross-link">tags</a></li>
<li>/<a href="#projects" class="cross-link">projects</a></li> <li>/<a href="#about" class="cross-link">about</a></li> </ul> + <div id="search_form"></div> </div> </div>@@ -78,6 +81,7 @@ <!-- CONTENT START -->
<div id="content" class="clearfix"> <h2>Home</h2> + <div id="search_results"></div> <div id="slider"> <div class="scroll"> <div class="scrollContainer">@@ -132,17 +136,17 @@ <div id="footer-container">
<div id="services"> <div class ="footer-left"> <div id="backtype"> - <img src="images/icons/rss.png" /><h3> comments</h3> + <img src="images/icons/rss.png" /><h3> <a href="http://www.backtype.com/h3rald">comments</a></h3> </div> </div> <div class ="footer-center"> <div id="twitter"> - <img src="images/icons/twitter.png" /><h3> tweets</h3> + <img src="images/icons/twitter.png" /><h3> <a href="http://www.twitter.com/h3rald">tweets</a></h3> </div> </div> <div class ="footer-right"> <div id="delicious"> - <img src="images/icons/delicious.png" /><h3> bookmarks</h3> + <img src="images/icons/delicious.png" /><h3> <a href="http://www.delicious.com/h3rald">bookmarks</a></h3> </div> </div> </div>
A
ui-dev/js/search.js
@@ -0,0 +1,23 @@
+google.load('search', '1'); + +function OnLoad() { + // create a search control + var searchControl = new google.search.SearchControl(); + + // create a draw options object so that we + // can position the search form root + var draw_options = new google.search.DrawOptions(); + draw_options.setSearchFormRoot(document.getElementById("search_form")); + + // populate with searchers + var webSearch = new google.search.WebSearch(); + webSearch.setSiteRestriction('h3rald.com'); + var search_options = new google.search.SearcherOptions(); + search_options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN); + + searchControl.addSearcher(webSearch, search_options); + + + searchControl.draw(document.getElementById("search_results"), draw_options); +} +google.setOnLoadCallback(OnLoad);