You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by sr...@apache.org on 2010/12/01 18:35:36 UTC

svn commit: r1041099 - /mahout/site/new_website/index.html

Author: srowen
Date: Wed Dec  1 17:35:35 2010
New Revision: 1041099

URL: http://svn.apache.org/viewvc?rev=1041099&view=rev
Log:
MAHOUT-514

Modified:
    mahout/site/new_website/index.html

Modified: mahout/site/new_website/index.html
URL: http://svn.apache.org/viewvc/mahout/site/new_website/index.html?rev=1041099&r1=1041098&r2=1041099&view=diff
==============================================================================
--- mahout/site/new_website/index.html (original)
+++ mahout/site/new_website/index.html Wed Dec  1 17:35:35 2010
@@ -44,11 +44,63 @@
             </li> 
           </ul> 
         </div> 
-        <div id="search"> <form  id="quick-search" method="get" action="https://cwiki.apache.org/confluence/dosearchsite.action" name="searchForm"> 
-            <fieldset> 
-              <input type="search" name="queryString" value="Search..." class="class1 class2 hint" accesskey="q" /> 
-              <input type="hidden" name="where" value="MAHOUT" /> 
-            </fieldset> 
+        <div id="search">
+          <script type="text/javascript">
+            function getBlank(input, stdValue) {
+              if (input.value == stdValue) {
+                input.value = '';
+              }
+              return true;
+            }
+
+            function selectProvider(form) {
+              provider = form.elements['searchProvider'].value;
+              if (provider == "any") {
+                if (Math.random() > 0.5) {
+                  provider = "lucid";
+                } else {
+                  provider = "sl";
+                }
+              }
+
+              if (provider == "lucid") {
+                form.action = "http://search.lucidimagination.com/p:mahout";
+              } else if (provider == "sl") {
+                form.action = "http://search-lucene.com/mahout";
+              }
+
+              days = 90; // cookie will be valid for 90 days
+              date = new Date();
+              date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+              expires = "; expires=" + date.toGMTString();
+              document.cookie = "searchProvider=" + provider + expires + "; path=/";
+              return true;
+            }
+          </script>
+          <form  id="quick-search" method="GET" onsubmit="return selectProvider(this)" action="http://search-lucene.com/mahout" name="searchform">
+            <fieldset>
+              <input type="search" name="q" value="Search with Apache Solr..." class="class1 class2 hint" accesskey="q" onfocus="getBlank(this, 'Search with Apache Solr...')">
+              <span style="color:white">@</span>
+              <select name="searchProvider" id="searchProvider">
+                <option value="any">select provider</option>
+                <option value="lucid">Lucid Find</option>
+                <option value="sl">Search-Lucene</option>
+              </select>
+            </fieldset>
+            <script type="text/javascript">
+              if (document.cookie.length>0) {
+                cStart=document.cookie.indexOf("searchProvider=");
+                if (cStart!=-1) {
+                  cStart=cStart + "searchProvider=".length;
+                  cEnd=document.cookie.indexOf(";", cStart);
+                  if (cEnd==-1) {
+                    cEnd=document.cookie.length;
+                  }
+                  provider = unescape(document.cookie.substring(cStart,cEnd));
+                  document.forms['searchform'].elements['searchProvider'].value = provider;
+                }
+              }
+            </script>
           </form> 
         </div> 
         <div id="slides">