changeset 774:58410c63bb84 feature_334

Force a Google search box rudely into the middle of the search view, just to see how it looks. It can be styled reasonably well -- but the adverts, when they appear, are atrocious.
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 17 Nov 2011 14:56:55 +0000
parents 7fd52a786954
children
files app/views/search/index.rhtml public/themes/soundsoftware/stylesheets/application.css public/themes/soundsoftware/stylesheets/fonts-generic.css public/themes/soundsoftware/stylesheets/fonts-mac.css public/themes/soundsoftware/stylesheets/fonts-ms.css
diffstat 5 files changed, 61 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/app/views/search/index.rhtml	Tue Nov 15 10:36:40 2011 +0000
+++ b/app/views/search/index.rhtml	Thu Nov 17 14:56:55 2011 +0000
@@ -20,6 +20,17 @@
 <% end %>
 </div>
 
+<div id="cse" style="width: 100%;">Loading</div>
+<script src="//www.google.com/jsapi" type="text/javascript"></script>
+<script type="text/javascript"> 
+  google.load('search', '1', {language : 'en'});
+  google.setOnLoadCallback(function() {
+    var customSearchControl = new google.search.CustomSearchControl('009438048077875231531:mfwwmuro5ps');
+    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
+    customSearchControl.draw('cse');
+  }, true);
+</script>
+
 <% if @project_matches and !@project_matches.empty? and (@project_matches.count < 6) and !@pagination_previous_date %>
    <h3><%= l(:label_matching_project_plural) %> (<%= @project_matches.count %>)</h3>
     <dl id="search-results">
--- a/public/themes/soundsoftware/stylesheets/application.css	Tue Nov 15 10:36:40 2011 +0000
+++ b/public/themes/soundsoftware/stylesheets/application.css	Thu Nov 17 14:56:55 2011 +0000
@@ -232,6 +232,42 @@
 }
 
 
+/* For Google search results */
+    
+.gs-title {
+    text-decoration: none !important;
+}
+.gs-title:hover {
+    text-decoration: underline !important;
+}
+.gs-title b {
+    color: #be5700 !important;
+/*    background-color: #FCFD8D; */
+    text-decoration: none !important;
+}
+.gs-snippet {
+    font-style: italic; color: #808080;
+}
+/*
+.gs-snippet b {
+   background-color: #FCFD8D;
+}
+*/
+.gs-visibleUrl {
+    display: none;
+}
+.gs-title, .gs-title b {
+    font-size: 12px !important;
+}
+.gs-snippet,.gs-visibleUrl,.gsc-cursor-page,.gsc-result-info {
+    font-size: 11px !important;
+}
+.gsc-result-info,.gs-fileFormat,.gs-fileFormatType {
+    font-size: 10px !important;
+}
+.gs-result {
+    padding-left: 40px;
+}
 
 
 
--- a/public/themes/soundsoftware/stylesheets/fonts-generic.css	Tue Nov 15 10:36:40 2011 +0000
+++ b/public/themes/soundsoftware/stylesheets/fonts-generic.css	Thu Nov 17 14:56:55 2011 +0000
@@ -10,3 +10,7 @@
   line-height: 1.34;
 }
 
+.gs-title,.gs-snippet,.gs-visibleUrl,.gsc-cursor-page,.gsc-result-info,.gs-fileFormat,.gs-fileFormatType {
+  font-family: DroidSans, 'Liberation Sans', tahoma, verdana, sans-serif; 
+  line-height: 1.34;
+}
--- a/public/themes/soundsoftware/stylesheets/fonts-mac.css	Tue Nov 15 10:36:40 2011 +0000
+++ b/public/themes/soundsoftware/stylesheets/fonts-mac.css	Thu Nov 17 14:56:55 2011 +0000
@@ -9,3 +9,8 @@
   font-family: 'Lucida Grande', 'Lucida Sans Unicode', DroidSans, 'Liberation Sans', tahoma, verdana, sans-serif; 
   line-height: 1.34;
 }
+
+.gs-title,.gs-snippet,.gs-visibleUrl,.gsc-cursor-page,.gsc-result-info,.gs-fileFormat,.gs-fileFormatType {
+  font-family: 'Lucida Grande', 'Lucida Sans Unicode', DroidSans, 'Liberation Sans', tahoma, verdana, sans-serif; 
+  line-height: 1.34;
+}
--- a/public/themes/soundsoftware/stylesheets/fonts-ms.css	Tue Nov 15 10:36:40 2011 +0000
+++ b/public/themes/soundsoftware/stylesheets/fonts-ms.css	Thu Nov 17 14:56:55 2011 +0000
@@ -9,3 +9,8 @@
   font-family: Calibri, DroidSans, 'Liberation Sans', tahoma, verdana, sans-serif; 
   line-height: 1.34;
 }
+
+.gs-title,.gs-snippet,.gs-visibleUrl,.gsc-cursor-page,.gsc-result-info,.gs-fileFormat,.gs-fileFormatType {
+  font-family: Calibri, DroidSans, 'Liberation Sans', tahoma, verdana, sans-serif; 
+  line-height: 1.34;
+}