web/rsln/polemicaltimeline.php
changeset 57 5422b3d398c5
parent 55 3845177131d2
child 59 9266a28107b3
equal deleted inserted replaced
56:0829cd5dc6e8 57:5422b3d398c5
   154 			
   154 			
   155 
   155 
   156 		});
   156 		});
   157 		
   157 		
   158 		
   158 		
   159 		<!-- LIMIT TEXTAREA:
   159 		//<!-- LIMIT TEXTAREA:
   160 		function imposemax(Object)
   160 		function imposemax(Object)
   161 		{
   161 		{
   162 		  return (Object.value.length <= 140);
   162 		  return (Object.value.length <= 140);
   163 		}
   163 		}
   164 		// End -->
   164 		// End -->
   165 		
   165 		
   166 		<!-- TIMER 
   166 		//<!-- TIMER 
   167 		var c=0;
   167 		var c=0;
   168 		var t;
   168 		var t;
   169 		var timer_is_on=0;
   169 		var timer_is_on=0;
   170 
   170 
   171 		function timedCount()
   171 		function timedCount()
   246   <div id="tip"></div>
   246   <div id="tip"></div>
   247   <script type="text/javascript"> 
   247   <script type="text/javascript"> 
   248   	$(document).mousemove(function(e){
   248   	$(document).mousemove(function(e){
   249 		if (over){
   249 		if (over){
   250 			tip.css("left", e.pageX-106).css("top", e.pageY-160);
   250 			tip.css("left", e.pageX-106).css("top", e.pageY-160);
   251 			tip.css("color", tipColor)
   251 			tip.css("color", tipColor);
   252 			tip.text(tipText);
   252 			tip.text(tipText);
   253 		}
   253 		}
   254 	});
   254 	});
   255 	var over = false;
   255 	var over = false;
   256 	var tip = $("#tip").hide();
   256 	var tip = $("#tip").hide();
   434 					x:8,
   434 					x:8,
   435 					y:418,
   435 					y:418,
   436 					width:650,
   436 					width:650,
   437 					height:70,
   437 					height:70,
   438 					heightmax:70
   438 					heightmax:70
   439 					}
   439 					};
   440 	// Make and define the Raphael area
   440 	// Make and define the Raphael area
   441 	//var paper = Raphael(document.getElementById(config.target),config.width, config.height);
   441 	//var paper = Raphael(document.getElementById(config.target),config.width, config.height);
   442 	
   442 	
   443 	
   443 	
   444 	function ChartTimeLine (){
   444 	function ChartTimeLine (){
   445 		
   445 		
   446 		//var paper = Raphael(config.x, config.y,config.width, config.height);
   446 		//var paper = Raphael(config.x, config.y,config.width, config.height);
   447 		var paper = Raphael(document.getElementById("chartTimeline"),config.width, config.height);
   447 		var paper = Raphael(config.target,config.width, config.height);
       
   448 		var current = null;
   448 		paper.rect(0,20,config.width,config.heightmax-20).attr({fill:"#fff","stroke-width":0.1,opacity: 0.1});	
   449 		paper.rect(0,20,config.width,config.heightmax-20).attr({fill:"#fff","stroke-width":0.1,opacity: 0.1});	
   449 		paper.rect(0,20,config.width,1).attr({fill:"#fff",stroke: "none"});	
   450 		paper.rect(0,20,config.width,1).attr({fill:"#fff",stroke: "none"});	
   450 		paper.rect(0,20,config.width,1).attr({fill:"#fff",stroke: "none"});	
   451 		paper.rect(0,20,config.width,1).attr({fill:"#fff",stroke: "none"});	
   451 		paper.rect(0,20,1,1).attr({fill:"#fff",stroke: "none"});	
   452 		paper.rect(0,20,1,1).attr({fill:"#fff",stroke: "none"});	
   452 		
   453 		
   483 		Frames = function(json){
   484 		Frames = function(json){
   484 			// make my clusters
   485 			// make my clusters
   485 			// ou Frame vide 
   486 			// ou Frame vide 
   486 		};
   487 		};
   487 		Frames.prototype.draw = function(){
   488 		Frames.prototype.draw = function(){
   488 		}
   489 		};
   489 		Frames.prototype.zoom = function(){
   490 		Frames.prototype.zoom = function(){
   490 		}
   491 		};
   491 		Frames.prototype.inside = function(){
   492 		Frames.prototype.inside = function(){
   492 		}
   493 		};
   493 		var Clusters = function(){
   494 		var Clusters = function(){
   494 			var Object;
   495 			var Object;
   495 			var yDist;
   496 			var yDist;
   496 			var x;
   497 			var x;
   497 			var y;
   498 			var y;
   500 		};
   501 		};
   501 		Clusters = function(json){
   502 		Clusters = function(json){
   502 			// make my object
   503 			// make my object
   503 		};
   504 		};
   504 		var Tweet = function(){
   505 		var Tweet = function(){
   505 		}
   506 		};
   506 		// Classes =======================================================================
   507 		// Classes =======================================================================
   507 		
   508 		
   508 		
   509 		
   509 
   510 
   510 
   511 
   554 													qualification:colorTranslation(item.content['polemics'][j]),
   555 													qualification:colorTranslation(item.content['polemics'][j]),
   555 													yIndicator:MyTime,
   556 													yIndicator:MyTime,
   556 													yframe:Myframe,
   557 													yframe:Myframe,
   557 													title:item.content['title'],
   558 													title:item.content['title'],
   558 													timeframe:item.begin
   559 													timeframe:item.begin
   559 													}
   560 													};
   560 										numberOfTweet+=1;
   561 										numberOfTweet+=1;
   561 								}
   562 								}
   562 						}else{
   563 						}else{
   563 							//trace("k = ",i);
   564 							//trace("k = ",i);
   564 							tweets[numberOfTweet] = {
   565 							tweets[numberOfTweet] = {
   566 										qualification:colorTranslation(""),
   567 										qualification:colorTranslation(""),
   567 										yIndicator:MyTime,
   568 										yIndicator:MyTime,
   568 										yframe:Myframe,
   569 										yframe:Myframe,
   569 										title:item.content['title'],
   570 										title:item.content['title'],
   570 										timeframe:item.begin
   571 										timeframe:item.begin
   571 							}
   572 							};
   572 							numberOfTweet+=1;
   573 							numberOfTweet+=1;
   573 						}
   574 						}
   574 						
   575 						
   575 					} else {
   576 					} else {
   576 						//trace("tweet qualification = ","null");
   577 						//trace("tweet qualification = ","null");
   623 			for(var i=0; i<nbrframes; i++) {
   624 			for(var i=0; i<nbrframes; i++) {
   624 				var moy	= 0;
   625 				var moy	= 0;
   625 				for (var j=0; j<6; j++){		
   626 				for (var j=0; j<6; j++){		
   626 					if (frames[i]!=undefined){
   627 					if (frames[i]!=undefined){
   627 						if (frames[i].qualifVol[j]!=undefined){
   628 						if (frames[i].qualifVol[j]!=undefined){
   628 							moy += frames[i].qualifVol[j]
   629 							moy += frames[i].qualifVol[j];
   629 						}
   630 						}
   630 					}
   631 					}
   631 				}
   632 				}
   632 				//trace("frame "+i,moy);
   633 				//trace("frame "+i,moy);
   633 				if (moy>max){max=moy;}
   634 				if (moy>max){max=moy;}
   634 			}
   635 			}
   635 		
   636 		
   636 			var tweetDrawed = new Array();
   637 			var tweetDrawed = new Array();
   637 			var TweetHeight = 5;
   638 			var TweetHeight = 5;			
   638 			// DRAW  TWEETS ============================================
   639 			// DRAW  TWEETS ============================================
   639 			for(var i=0; i<nbrframes;i++) {
   640 			for(var i=0; i<nbrframes;i++) {
   640 				var addEheight = 5;
   641 				var addEheight = 5;
   641 				if (frames[i]!=undefined){
   642 				if (frames[i]!=undefined){
   642 					trace (i+" k=",frames[i].mytweetsID.length);
   643 					trace (i+" k=",frames[i].mytweetsID.length);
   653 													).attr({stroke:"#00","stroke-width":0.1,  fill: colors[j]});	
   654 													).attr({stroke:"#00","stroke-width":0.1,  fill: colors[j]});	
   654 									addEheight +=TweetHeight;
   655 									addEheight +=TweetHeight;
   655 									e.time= frames[i].mytweetsID[k].timeframe;
   656 									e.time= frames[i].mytweetsID[k].timeframe;
   656 									e.title= frames[i].mytweetsID[k].title;
   657 									e.title= frames[i].mytweetsID[k].title;
   657 									e.mouseover(function () {
   658 									e.mouseover(function () {
   658 										this.attr({stroke:"#fff","stroke-width":5});
   659 										if(this != current) {
   659 										this.toFront();
   660 											to = this.attr("timeout");
       
   661 											if(to != null) {
       
   662 												clearTimeout(to);
       
   663 											}
       
   664 											if(current != null) {
       
   665 												current.attr({stroke:"#00","stroke-width":0.1});
       
   666 											}
       
   667 											this.attr({stroke:"#fff","stroke-width":5});
       
   668 											this.toFront();
       
   669 											var elem = this;
       
   670 											this.attr("timeout", 
       
   671 												setTimeout(function() {
       
   672 													elem.attr({stroke:"#00","stroke-width":0.1});
       
   673 													current = null;
       
   674 												}, 10000));
       
   675 											current = this;
       
   676 										}
   660 									}).mouseout(function () {
   677 									}).mouseout(function () {
   661 										this.attr({stroke:"#00","stroke-width":0.1});	
   678 										this.attr({stroke:"#00","stroke-width":0.1});
       
   679 										current = null;
       
   680 										clearTimeout(this.attr("timeout"));
   662 									}).mousedown(function () {
   681 									}).mousedown(function () {
   663 										__IriSP.MyApiPlayer.seek(this.time/1000)
   682 										__IriSP.MyApiPlayer.seek(this.time/1000);
   664 									});
   683 									});
   665 									$(e.node).attr('id', 't'+k+'');
   684 									$(e.node).attr('id', 't'+k+'');
   666 									$(e.node).attr('title', frames[i].mytweetsID[k].title);
   685 									$(e.node).attr('title', frames[i].mytweetsID[k].title);
   667 									$(e.node).attr('begin',  frames[i].mytweetsID[k].timeframe);
   686 									$(e.node).attr('begin',  frames[i].mytweetsID[k].timeframe);
   668 									addTip(e.node, frames[i].mytweetsID[k].title,colors[j]);
   687 									addTip(e.node, frames[i].mytweetsID[k].title,colors[j]);