web/rsln/polemicaltimeline.php
changeset 57 5422b3d398c5
parent 55 3845177131d2
child 59 9266a28107b3
--- a/web/rsln/polemicaltimeline.php	Fri Feb 18 19:50:52 2011 +0100
+++ b/web/rsln/polemicaltimeline.php	Mon Feb 21 11:15:34 2011 +0100
@@ -156,14 +156,14 @@
 		});
 		
 		
-		<!-- LIMIT TEXTAREA:
+		//<!-- LIMIT TEXTAREA:
 		function imposemax(Object)
 		{
 		  return (Object.value.length <= 140);
 		}
 		// End -->
 		
-		<!-- TIMER 
+		//<!-- TIMER 
 		var c=0;
 		var t;
 		var timer_is_on=0;
@@ -248,7 +248,7 @@
   	$(document).mousemove(function(e){
 		if (over){
 			tip.css("left", e.pageX-106).css("top", e.pageY-160);
-			tip.css("color", tipColor)
+			tip.css("color", tipColor);
 			tip.text(tipText);
 		}
 	});
@@ -436,7 +436,7 @@
 					width:650,
 					height:70,
 					heightmax:70
-					}
+					};
 	// Make and define the Raphael area
 	//var paper = Raphael(document.getElementById(config.target),config.width, config.height);
 	
@@ -444,7 +444,8 @@
 	function ChartTimeLine (){
 		
 		//var paper = Raphael(config.x, config.y,config.width, config.height);
-		var paper = Raphael(document.getElementById("chartTimeline"),config.width, config.height);
+		var paper = Raphael(config.target,config.width, config.height);
+		var current = null;
 		paper.rect(0,20,config.width,config.heightmax-20).attr({fill:"#fff","stroke-width":0.1,opacity: 0.1});	
 		paper.rect(0,20,config.width,1).attr({fill:"#fff",stroke: "none"});	
 		paper.rect(0,20,config.width,1).attr({fill:"#fff",stroke: "none"});	
@@ -485,11 +486,11 @@
 			// ou Frame vide 
 		};
 		Frames.prototype.draw = function(){
-		}
+		};
 		Frames.prototype.zoom = function(){
-		}
+		};
 		Frames.prototype.inside = function(){
-		}
+		};
 		var Clusters = function(){
 			var Object;
 			var yDist;
@@ -502,7 +503,7 @@
 			// make my object
 		};
 		var Tweet = function(){
-		}
+		};
 		// Classes =======================================================================
 		
 		
@@ -556,7 +557,7 @@
 													yframe:Myframe,
 													title:item.content['title'],
 													timeframe:item.begin
-													}
+													};
 										numberOfTweet+=1;
 								}
 						}else{
@@ -568,7 +569,7 @@
 										yframe:Myframe,
 										title:item.content['title'],
 										timeframe:item.begin
-							}
+							};
 							numberOfTweet+=1;
 						}
 						
@@ -625,7 +626,7 @@
 				for (var j=0; j<6; j++){		
 					if (frames[i]!=undefined){
 						if (frames[i].qualifVol[j]!=undefined){
-							moy += frames[i].qualifVol[j]
+							moy += frames[i].qualifVol[j];
 						}
 					}
 				}
@@ -634,7 +635,7 @@
 			}
 		
 			var tweetDrawed = new Array();
-			var TweetHeight = 5;
+			var TweetHeight = 5;			
 			// DRAW  TWEETS ============================================
 			for(var i=0; i<nbrframes;i++) {
 				var addEheight = 5;
@@ -655,12 +656,30 @@
 									e.time= frames[i].mytweetsID[k].timeframe;
 									e.title= frames[i].mytweetsID[k].title;
 									e.mouseover(function () {
-										this.attr({stroke:"#fff","stroke-width":5});
-										this.toFront();
+										if(this != current) {
+											to = this.attr("timeout");
+											if(to != null) {
+												clearTimeout(to);
+											}
+											if(current != null) {
+												current.attr({stroke:"#00","stroke-width":0.1});
+											}
+											this.attr({stroke:"#fff","stroke-width":5});
+											this.toFront();
+											var elem = this;
+											this.attr("timeout", 
+												setTimeout(function() {
+													elem.attr({stroke:"#00","stroke-width":0.1});
+													current = null;
+												}, 10000));
+											current = this;
+										}
 									}).mouseout(function () {
-										this.attr({stroke:"#00","stroke-width":0.1});	
+										this.attr({stroke:"#00","stroke-width":0.1});
+										current = null;
+										clearTimeout(this.attr("timeout"));
 									}).mousedown(function () {
-										__IriSP.MyApiPlayer.seek(this.time/1000)
+										__IriSP.MyApiPlayer.seek(this.time/1000);
 									});
 									$(e.node).attr('id', 't'+k+'');
 									$(e.node).attr('title', frames[i].mytweetsID[k].title);