src/js/widgets/annotationsListWidget.js
branchembed-playerapi-rewrite
changeset 703 9341d858bf8e
parent 698 329333e07267
child 714 9056928c46de
equal deleted inserted replaced
702:f1225d38c150 703:9341d858bf8e
   121   var view_types = serializer.getIds("Contributions");
   121   var view_types = serializer.getIds("Contributions");
   122   var l = [];
   122   var l = [];
   123   
   123   
   124   for (i = 0; i < annotations.length; i++) {
   124   for (i = 0; i < annotations.length; i++) {
   125       var annotation = annotations[i];
   125       var annotation = annotations[i];
   126       console.log(annotation);
   126 
   127       console.log(view_types, annotation.meta["id-ref"]);
       
   128       /* filter the annotations whose type is not the one we want */
   127       /* filter the annotations whose type is not the one we want */
   129       /* We want _all_ the annotations.
   128       /* We want _all_ the annotations.
   130       if (typeof(annotation.meta) !== "undefined" && typeof(annotation.meta["id-ref"]) !== "undefined"
   129       if (typeof(annotation.meta) !== "undefined" && typeof(annotation.meta["id-ref"]) !== "undefined"
   131             && !IriSP.underscore.include(view_types, annotation.meta["id-ref"])) {
   130             && !IriSP.underscore.include(view_types, annotation.meta["id-ref"])) {
   132           continue;
   131           continue;
   141       obj["begin"] = IriSP.msToTime(annotation.begin);
   140       obj["begin"] = IriSP.msToTime(annotation.begin);
   142       obj["end"] = IriSP.msToTime(annotation.end);
   141       obj["end"] = IriSP.msToTime(annotation.end);
   143       obj["url"] = document.location.href.split("#")[0] + "/" + annotation.meta["project"];
   142       obj["url"] = document.location.href.split("#")[0] + "/" + annotation.meta["project"];
   144       l.push(obj);
   143       l.push(obj);
   145   }
   144   }
   146   console.log(l);
   145 
   147   this.do_redraw(l);
   146   this.do_redraw(l);
   148 };
   147 };
   149 IriSP.AnnotationsListWidget.prototype.draw = function() {
   148 IriSP.AnnotationsListWidget.prototype.draw = function() {
   150 
   149 
   151   this.drawList();
   150   this.drawList();