integration/js/editor.js
changeset 92 54cd42adea33
parent 73 475e5fb0ea2b
child 97 213e81430f7a
equal deleted inserted replaced
91:a94f5c62e4d7 92:54cd42adea33
    43         ),
    43         ),
    44         mediafoundlisttemplate = _.template(
    44         mediafoundlisttemplate = _.template(
    45             '<div class="media-found-list" style="height: <%= height %>px"><div class="media-segment-list-inner"></div><%= segments %></div>'
    45             '<div class="media-found-list" style="height: <%= height %>px"><div class="media-segment-list-inner"></div><%= segments %></div>'
    46         ),
    46         ),
    47         mashupstatus = '',
    47         mashupstatus = '',
       
    48         mediasegmentscache = {},
    48         addMode, currentMedia, currentSegment;
    49         addMode, currentMedia, currentSegment;
    49         
    50         
    50     IriSP.mashupcore(project, mashup);
    51     IriSP.mashupcore(project, mashup);
    51     
    52     
    52     /* Validation of segments and mashup */
    53     /* Validation of segments and mashup */
   125                     limit: 0
   126                     limit: 0
   126                 },
   127                 },
   127                 serializer: IriSP.serializers.segmentapi
   128                 serializer: IriSP.serializers.segmentapi
   128             }).onLoad(function() {
   129             }).onLoad(function() {
   129                 var medias = this.getMedias(),
   130                 var medias = this.getMedias(),
   130                     annotations = this.getAnnotations();
   131                     annotations = this.getAnnotations().filter(function(annotation) {
       
   132                         return annotation.getDuration() > 0;
       
   133                     });;
   131                 if (medias && medias.length) {
   134                 if (medias && medias.length) {
   132                     var mediaid = medias[0].id;
   135                     var mediaid = medias[0].id;
   133                     el = $(".item-video[data-media-id='" + mediaid + "'] .media-count");
   136                     el = $(".item-video[data-media-id='" + mediaid + "'] .media-count");
   134                     el.text(annotations.length).parent().show();
   137                     el.text(annotations.length).parent().show();
   135                     mediasegmentscache[mediaid] = annotations;
   138                     mediasegmentscache[mediaid] = annotations;
   350             $(".segmentation .validate").removeClass("critical warning valid").addClass(currentSegment.status);
   353             $(".segmentation .validate").removeClass("critical warning valid").addClass(currentSegment.status);
   351             $(".segmentation .validate-tooltip").html("<ul><li>" + currentSegment.status_messages.join("</li><li>")+"</li></ul>");
   354             $(".segmentation .validate-tooltip").html("<ul><li>" + currentSegment.status_messages.join("</li><li>")+"</li></ul>");
   352         }
   355         }
   353     }
   356     }
   354     
   357     
   355     var mediasegmentscache = {};
       
   356     
       
   357     function setMedia(media) {
   358     function setMedia(media) {
   358         if (currentMedia) {
   359         if (currentMedia) {
   359             currentMedia.pause();
   360             currentMedia.pause();
   360         }
   361         }
   361         currentMedia = media;
   362         currentMedia = media;