src/js/widgets/polemicWidget.js
branchpopcorn-port
changeset 188 f1f4b1e44456
parent 187 6f1def85018a
child 189 1a7bd51e7e46
equal deleted inserted replaced
187:6f1def85018a 188:f1f4b1e44456
    19 // CHART TIMELINE / VERSION PROTOTYPE  ::
    19 // CHART TIMELINE / VERSION PROTOTYPE  ::
    20 
    20 
    21 IriSP.PolemicWidget = function(Popcorn, config, Serializer) {
    21 IriSP.PolemicWidget = function(Popcorn, config, Serializer) {
    22   IriSP.Widget.call(this, Popcorn, config, Serializer);
    22   IriSP.Widget.call(this, Popcorn, config, Serializer);
    23  
    23  
    24   this.RAWTweets;
       
    25 	this.userPol    = new Array();
    24 	this.userPol    = new Array();
    26 	this.userNoPol  = new Array();
    25 	this.userNoPol  = new Array();
    27 	this.userst 	   = new Array();
    26 	this.userst 	   = new Array();
    28 	this.numberOfTweet = 0;
    27 	this.numberOfTweet = 0;
    29 	this.Users;
    28 	this.Users;
   136 		    // the tweets are by definition of the second annotation type
   135 		    // the tweets are by definition of the second annotation type
   137 		    tweet_annot_type = null;
   136 		    tweet_annot_type = null;
   138 		    if(typeof(view.annotation_types) !== "undefined" && view.annotation_types.length > 1) {
   137 		    if(typeof(view.annotation_types) !== "undefined" && view.annotation_types.length > 1) {
   139 		    	tweet_annot_type = view.annotation_types[1];
   138 		    	tweet_annot_type = view.annotation_types[1];
   140 		    }
   139 		    }
   141 			RAWTweets = json.annotations;
       
   142 			
   140 			
   143       for(var i = 0; i < json.annotations.length; i++) {
   141       for(var i = 0; i < json.annotations.length; i++) {
   144         var item = json.annotations[i];							
   142         var item = json.annotations[i];							
   145 				var MyTime  = Math.floor(item.begin/duration*lineSize);
   143 				var MyTime  = Math.floor(item.begin/duration*lineSize);
   146 				var Myframe = Math.floor(MyTime/lineSize*frameLenght);
   144 				var Myframe = Math.floor(MyTime/lineSize*frameLenght);