src/js/serializers/JSONSerializer.js
branchpopcorn-port
changeset 595 29d86e6c61a6
parent 591 e0df88905af8
child 601 02b857c0c9f1
equal deleted inserted replaced
594:96af41097260 595:29d86e6c61a6
   226 /** returns all the annotations that are displayable at the moment 
   226 /** returns all the annotations that are displayable at the moment 
   227    NB: only takes account the first type of annotations - ignores tweets 
   227    NB: only takes account the first type of annotations - ignores tweets 
   228    currentTime is in seconds.
   228    currentTime is in seconds.
   229    
   229    
   230    @param currentTime the time at which we search.
   230    @param currentTime the time at which we search.
       
   231    @param (optional) the if of the type of the annotations we want to get.
   231  */
   232  */
   232 
   233 
   233 IriSP.JSONSerializer.prototype.currentAnnotations = function(currentTime) {
   234 IriSP.JSONSerializer.prototype.currentAnnotations = function(currentTime, id) {
   234   var view;
   235   var view;
   235   var currentTimeMs = 1000 * currentTime;
   236   var currentTimeMs = 1000 * currentTime;
   236 
   237 
   237   var id = this.getChapitrage();
   238   if (typeof(id) === "undefined") {
   238   /* FIXME: ugly */
   239     id = this.getChapitrage();
   239   if (typeof(id) === "undefined")    
   240   
   240     var legal_ids = this.getNonTweetIds();
   241     if (typeof(id) === "undefined")    
   241   else 
   242       var legal_ids = this.getNonTweetIds();
   242     legal_ids = [id];
   243     else 
       
   244       legal_ids = [id];
       
   245   }
   243   
   246   
   244   var ret_array = [];
   247   var ret_array = [];
   245   
   248   
   246   var i;
   249   var i;
   247   
   250