src/js/widgets/polemicWidget.js
branchpopcorn-port
changeset 192 d8a826f35aac
parent 191 43a86ab7703c
child 194 f5d86e5c4a56
equal deleted inserted replaced
191:43a86ab7703c 192:d8a826f35aac
    50 		var margin 	  		= 1;						// marge between frame
    50 		var margin 	  		= 1;						// marge between frame
    51 		var lineSize  		= this.width;				// timeline pixel width 
    51 		var lineSize  		= this.width;				// timeline pixel width 
    52 		var nbrframes 		= lineSize/frameSize; 		// frame numbers
    52 		var nbrframes 		= lineSize/frameSize; 		// frame numbers
    53 		var numberOfTweet 	= 0;						// number of tweet overide later 
    53 		var numberOfTweet 	= 0;						// number of tweet overide later 
    54 		var duration  		= +this._serializer.currentMedia().meta["dc:duration"];			// timescale width 
    54 		var duration  		= +this._serializer.currentMedia().meta["dc:duration"];			// timescale width 
    55 		var frameLenght 	= lineSize/frameSize;		// frame timescale	    
    55 		var frameLength 	= lineSize/frameSize;		// frame timescale	    
    56 		var timeline;
    56 		var timeline;
    57 		var colors  = new Array("","#1D973D","#C5A62D","#CE0A15","#036AAE","#585858");
    57 		var colors  = new Array("","#1D973D","#C5A62D","#CE0A15","#036AAE","#585858");
    58 		
    58 		
    59 		// array 
    59 		// array 
    60 		//var tweets  = new Array();
    60 		//var tweets  = new Array();
    61 		var element = new Array();
    61 		var element = new Array();
    62 		var cluster = new Array();
    62 		var cluster = new Array();
    63 		var frames  = new Array(frameLenght);
    63 		var frames  = new Array(frameLength);
    64 		var slices  = new Array();
    64 		var slices  = new Array();
    65 		
    65 		
    66 		
    66 		
    67 		// Classes =======================================================================
    67 		// Classes =======================================================================
    68 		var Frames = function(){
    68 		var Frames = function(){
   139 		    }
   139 		    }
   140 			
   140 			
   141       for(var i = 0; i < json.annotations.length; i++) {
   141       for(var i = 0; i < json.annotations.length; i++) {
   142         var item = json.annotations[i];							
   142         var item = json.annotations[i];							
   143 				var MyTime  = Math.floor(item.begin/duration*lineSize);
   143 				var MyTime  = Math.floor(item.begin/duration*lineSize);
   144 				var Myframe = Math.floor(MyTime/lineSize*frameLenght);
   144 				var Myframe = Math.floor(MyTime/lineSize*frameLength);
   145 
   145 
   146 				if (typeof(item.meta) !== "undefined" 
   146 				if (typeof(item.meta) !== "undefined" 
   147 					&& typeof(item.meta["id-ref"]) !== "undefined"
   147 					&& typeof(item.meta["id-ref"]) !== "undefined"
   148 					&& item.meta["id-ref"] === tweet_annot_type) {
   148 					&& item.meta["id-ref"] === tweet_annot_type) {
   149 						
   149