integration/js/editor.js
changeset 97 213e81430f7a
parent 92 54cd42adea33
child 104 1b84c7b2aeee
equal deleted inserted replaced
96:c16dbaa98389 97:213e81430f7a
    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         mediasegmentscache = {},
    49         addMode, currentMedia, currentSegment;
    49         mashupModeAfterSave = false,
       
    50         addMode = false,
       
    51         currentMedia, currentSegment;
    50         
    52         
    51     IriSP.mashupcore(project, mashup);
    53     IriSP.mashupcore(project, mashup);
    52     
    54     
    53     /* Validation of segments and mashup */
    55     /* Validation of segments and mashup */
    54     
    56     
   519             setMedia(currentMedia);
   521             setMedia(currentMedia);
   520         } else {
   522         } else {
   521             mashup.trigger("change");
   523             mashup.trigger("change");
   522             var segment = mashup.getAnnotation(currentSegment);
   524             var segment = mashup.getAnnotation(currentSegment);
   523             currentSegment = undefined;
   525             currentSegment = undefined;
   524             setMedia(mashup);
   526             if (mashupModeAfterSave) {
   525             if (segment) {
   527                 setMedia(mashup);
   526                 mashup.setCurrentTime(segment.begin);
   528                 if (segment) {
   527                 mashup.trigger("enter-annotation",segment);
   529                     mashup.setCurrentTime(segment.begin);
       
   530                     mashup.trigger("enter-annotation",segment);
       
   531                 }
       
   532             } else {
       
   533                 
   528             }
   534             }
   529         }
   535         }
   530         return false;
   536         return false;
   531     });
   537     });
   532     
   538     
   624     })
   630     })
   625     .on("click", ".edit", function(e) {
   631     .on("click", ".edit", function(e) {
   626         var currentItem = $(this).parents(".item-video"),
   632         var currentItem = $(this).parents(".item-video"),
   627             media = project.getElement(currentItem.attr("data-media-id")),
   633             media = project.getElement(currentItem.attr("data-media-id")),
   628             segment = project.getElement(currentItem.attr("data-segment-id"));
   634             segment = project.getElement(currentItem.attr("data-segment-id"));
       
   635         mashupModeAfterSave = !!(currentMedia === mashup);
   629         currentSegment = segment;
   636         currentSegment = segment;
   630         setMedia(media);
   637         setMedia(media);
   631         return false;
   638         return false;
   632     })
   639     })
   633     .on("click", ".top", function(e){
   640     .on("click", ".top", function(e){
   729     
   736     
   730     /* Click on current segment in Preview */
   737     /* Click on current segment in Preview */
   731     
   738     
   732     $(".mashup-description .edit").click(function() {
   739     $(".mashup-description .edit").click(function() {
   733         if (mashup.currentAnnotation) {
   740         if (mashup.currentAnnotation) {
       
   741             mashupModeAfterSave = !!(currentMedia === mashup);
   734             currentSegment = mashup.currentAnnotation.annotation;
   742             currentSegment = mashup.currentAnnotation.annotation;
   735             setMedia(mashup.currentAnnotation.getMedia());
   743             setMedia(mashup.currentAnnotation.getMedia());
   736         }
   744         }
   737         return false;
   745         return false;
   738     });
   746     });