You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by gs...@apache.org on 2011/08/06 22:27:18 UTC

svn commit: r1154577 [3/3] - in /lucene/cms/trunk: content/lucene/images/ content/lucene/scripts/ templates/

Propchange: lucene/cms/trunk/content/lucene/scripts/prototype.js
------------------------------------------------------------------------------
    svn:executable = *

Added: lucene/cms/trunk/content/lucene/scripts/search.js
URL: http://svn.apache.org/viewvc/lucene/cms/trunk/content/lucene/scripts/search.js?rev=1154577&view=auto
==============================================================================
--- lucene/cms/trunk/content/lucene/scripts/search.js (added)
+++ lucene/cms/trunk/content/lucene/scripts/search.js Sat Aug  6 20:27:17 2011
@@ -0,0 +1,21 @@
+function initSearch(){
+    var methods = {
+        defaultValueActsAsHint: function(element){
+            element = $(element);
+            element._default = element.value;
+            return element.observe('focus', function(){
+                if(element._default != element.value) return;
+                element.removeClassName('hint').value = '';
+            }).observe('blur', function(){
+                if(element.value.strip() != '') return;
+                element.addClassName('hint').value = element._default;
+            }).addClassName('hint');
+        }
+    };
+    $w('input textarea').each(function(tag){ Element.addMethods(tag, methods) });
+}
+initSearch();
+
+document.observe('dom:loaded', function(){
+    $('searchDocs').defaultValueActsAsHint();
+});
\ No newline at end of file

Propchange: lucene/cms/trunk/content/lucene/scripts/search.js
------------------------------------------------------------------------------
    svn:executable = *

Added: lucene/cms/trunk/content/lucene/scripts/slides.js
URL: http://svn.apache.org/viewvc/lucene/cms/trunk/content/lucene/scripts/slides.js?rev=1154577&view=auto
==============================================================================
--- lucene/cms/trunk/content/lucene/scripts/slides.js (added)
+++ lucene/cms/trunk/content/lucene/scripts/slides.js Sat Aug  6 20:27:17 2011
@@ -0,0 +1,109 @@
+var Slides = Class.create({
+
+	initialize: function(element, options) {		
+		this.options = {
+      		Duration: 1,
+			Delay: 10.0,
+			Random: true,
+			Slideshow:true,
+			Controls:true
+    	}
+		Object.extend(this.options, options || {});
+
+    	this.element        = $(element);
+		this.slides			= this.element.childElements();
+		this.num_slides		= this.slides.length;		
+		this.current_slide 	= (this.options.Random) ? (Math.floor(Math.random()*this.num_slides)) : 0;
+		this.end_slide		= this.num_slides - 1;
+		
+		this.slides.invoke('hide');
+		this.slides[this.current_slide].show();
+				
+		if (this.options.Slideshow) { 
+			this.startSlideshow();
+		}				
+		if (this.options.Controls) {
+			this.addControls();
+		}		
+	},
+	
+	addControls: function() {
+		this.btn_previous	= $('previous');
+		this.btn_next 		= $('next');
+		this.btn_start		= $('start');
+		this.btn_stop		= $('stop');
+		
+		this.btn_previous.observe('click', this.moveToPrevious.bindAsEventListener(this));
+		this.btn_next.observe('click', this.moveToNext.bindAsEventListener(this));
+		this.btn_start.observe('click', this.startSlideshow.bindAsEventListener(this));
+		this.btn_stop.observe('click', this.stopSlideshow.bindAsEventListener(this));
+	},
+
+	startSlideshow: function(event) {
+		if (event) { Event.stop(event); }
+		if (!this.running)	{
+			this.fadeStartBtn();
+			this.executer = new PeriodicalExecuter(function(){
+	  			this.updateSlide(this.current_slide+1);
+	 		}.bind(this),this.options.Delay);
+			this.running=true;
+		}
+		
+	},
+	
+	fadeStartBtn: function() {
+		var startBtn = $('start');
+		var stopBtn = $('stop');
+		Effect.Fade(startBtn, { duration: 0.3 }),
+		Effect.Appear(stopBtn, { duration: 0.3 }) 
+	},
+	
+	stopSlideshow: function(event) {	
+		if (event) { Event.stop(event); } 
+		if (this.executer) {
+			this.fadeStopBtn();
+			this.executer.stop();
+			this.running=false;
+		}	 
+	},
+	
+	fadeStopBtn: function() {
+		var startBtn = $('start');
+		var stopBtn = $('stop');
+		Effect.Fade(stopBtn, { duration: 0.3 }),
+		Effect.Appear(startBtn, { duration: 0.3 }) 
+	},
+
+	moveToPrevious: function (event) {
+		if (event) { Event.stop(event); }
+		//this.stopSlideshow();
+  		this.updateSlide(this.current_slide-1);
+	},
+
+	moveToNext: function (event) {
+		if (event) { Event.stop(event); }
+		//this.stopSlideshow();
+  		this.updateSlide(this.current_slide+1);
+	},
+	
+	updateSlide: function(next_slide) {
+		if (next_slide > this.end_slide) { 
+				next_slide = 0; 
+		} 
+		else if ( next_slide == -1 ) {
+				next_slide = this.end_slide;
+		}
+		
+		this.fadeInOut(next_slide, this.current_slide);		
+	},
+
+ 	fadeInOut: function (next, current) {		
+		new Effect.Parallel([
+			new Effect.Fade(this.slides[current], { sync: true }),
+			new Effect.Appear(this.slides[next], { sync: true }) 
+  		], { duration: this.options.Duration });
+		
+		this.current_slide = next;		
+	}
+
+});
\ No newline at end of file

Propchange: lucene/cms/trunk/content/lucene/scripts/slides.js
------------------------------------------------------------------------------
    svn:executable = *

Modified: lucene/cms/trunk/templates/skeleton.html
URL: http://svn.apache.org/viewvc/lucene/cms/trunk/templates/skeleton.html?rev=1154577&r1=1154576&r2=1154577&view=diff
==============================================================================
--- lucene/cms/trunk/templates/skeleton.html (original)
+++ lucene/cms/trunk/templates/skeleton.html Sat Aug  6 20:27:17 2011
@@ -22,9 +22,145 @@
   <link href="/lucene/css/lucene.css" rel="stylesheet" type="text/css">
   <title>Apache Lucene - {% block title %}{{ headers.title }}{% endblock %}</title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> 
+  <meta name="Distribution" content="Global"/> 
+  <meta name="Robots" content="index,follow"/> 
+  <meta name="keywords"
+        content="apache, apache lucene, apache solr, solr, lucene
+        search, information retrieval, spell checking, faceting, inverted index, open source"/> 
+  <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"/> 
+  <link rel="stylesheet" href="images/global.css" type="text/css"/> 
+  <script type="text/javascript" src="scripts/prototype.js"></script> 
+  <script type="text/javascript" src="scripts/effects.js"></script> 
+  <script type="text/javascript" src="scripts/search.js"></script> 
+  <script type="text/javascript" src="scripts/slides.js"></script>
 </head>
 
 <body>
+	<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:lucene";
+	      } else if (provider == "sl") {
+	      form.action = "http://search-lucene.com/lucene";
+	      }
+
+	      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/lucene"
+	          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"> 
+	    <div class="slideshow" id="mantleSlides"> 
+	      <div id="slide1" style="display:none"> 
+	        <div class="callout"> 
+	          Ultra-fast Search Library and Server<br/> 
+	        </div> 
+	        <div class="description"> 
+	          Apache Lucene and Solr set the standard for search and indexing performance
+	        </div> 
+	        <div class="mantle"> 
+	          <img alt="Apache Lucene" src="images/mantle-lucene.png"/> 
+	        </div> 
+	      </div> 
+	      <div id="slide2" style="display:none"> 
+	        <div class="callout"> 
+	          Proven search capabilities<br/> 
+	        </div> 
+	        <div class="description"> 
+	          Our core algorithms along with the Solr search server power applications the world over, ranging
+	from mobile devices to sites like Twitter, Apple and Wikipedia.
+	        </div> 
+	        <div class="mantle"> 
+	          <img alt="Lucene Power" src="images/mantle-power.png"/> 
+	        </div> 
+	      </div> 
+	      <div id="slide3" style="display:none"> 
+	        <div class="callout"> 
+	          Large, Vibrant community
+	        </div> 
+	        <div class="description"> 
+	          The goal of Apache Lucene and Solr is to provide world class search capabilities
+	        </div> 
+	        <div class="mantle"> 
+	          <img alt="Apache Mahout community" src="images/mantle-community.png"/> 
+	        </div> 
+	      </div> 
+	      <div id="slide4" style="opacity:0.5"> 
+	        <div class="callout"> 
+	          Apache 2.0 licensed
+	        </div> 
+	        <div class="description"> 
+	          Apache Lucene and Solr are distributed under a commercially friendly Apache Software license
+	        </div> 
+	        <div class="mantle"> 
+	          <img alt="Apache Software Foundation" src="images/mantle-asf.png"/> 
+	        </div> 
+	      </div> 
+	    </div> 
+	    <div class="controls"> 
+	      <a class="next" id="next" title="Next" href="http://lucene.apache.org/#">Next</a> 
+	      <a class="previous" id="previous" title="Previous" href="http://lucene.apache.org/#">Previous</a> 
+	      <a class="start" id="start" title="Start" href="http://lucene.apache.org/#" style="display: none; ">Start</a> 
+	      <a class="stop" id="stop" title="Stop" href="http://lucene.apache.org/#">Stop</a> 
+	    </div> 
+	  </div> 
+
+	  <script type="text/javascript"> 
+	    function StartSlides() {
+	    new Slides('mantleSlides');
+	    }
+	    document.observe ('dom:loaded', StartSlides);
+	  </script> 
+	</div>
   <div id="navigation"> 
   {% filter markdown %}{% include "sidenav.mdtext" %}{% endfilter %}
   </div>