22 var t = myMedia.duration * parseInt(ui.helper.css("left")) / ( $(".timeline-annotations").width() - 2 * ui.helper.width() ); |
22 var t = myMedia.duration * parseInt(ui.helper.css("left")) / ( $(".timeline-annotations").width() - 2 * ui.helper.width() ); |
23 myMedia.setCurrentTime(t); |
23 myMedia.setCurrentTime(t); |
24 } |
24 } |
25 }); |
25 }); |
26 |
26 |
27 $('.timeline-annotations').bind('click', function(e){ |
27 $('.timeline-annotations').on('click', '.annotation', function(e){ |
28 var x = e.pageX - $(this).offset().left; |
28 e.preventDefault(); |
|
29 |
29 myMedia.setCurrentTime(myMedia.duration * x / $(this).width()); |
30 myMedia.setCurrentTime(myMedia.duration * x / $(this).width()); |
30 }); |
31 }); |
31 |
32 |
32 myProject.onLoad(function() { |
33 myProject.onLoad(function() { |
33 |
34 |
441 left = Math.floor(v.begin * wTimeline / myMedia.duration), |
442 left = Math.floor(v.begin * wTimeline / myMedia.duration), |
442 segment = $('<div>').css({ |
443 segment = $('<div>').css({ |
443 left : left, |
444 left : left, |
444 width : width, |
445 width : width, |
445 backgroundColor : v.color |
446 backgroundColor : v.color |
446 }).addClass('annotation').attr('id', 'annotation-timeline-'+v.id); |
447 }).addClass('annotation') |
|
448 .attr('data-id', v.id) |
|
449 .attr('id', 'annotation-timeline-'+v.id); |
447 |
450 |
448 var isInTimeline = false; |
451 var isInTimeline = false; |
449 $.each(timeline.find('li'), function(a, b){ |
452 $.each(timeline.find('li'), function(a, b){ |
450 if(isInTimeline) return; |
453 if(isInTimeline) return; |
451 var row = $(this); |
454 var row = $(this); |
506 value = $(this).val(); |
509 value = $(this).val(); |
507 currentAnnotation[name] = value; |
510 currentAnnotation[name] = value; |
508 if(name == 'title'){ |
511 if(name == 'title'){ |
509 var idAnnotation = $(this).parents('form').attr('data-id'); |
512 var idAnnotation = $(this).parents('form').attr('data-id'); |
510 $('#onglet-title-'+idAnnotation).text(value); |
513 $('#onglet-title-'+idAnnotation).text(value); |
|
514 $(this).parents('form').find('.btn-delete-annotation').attr('data-title', value); |
511 } |
515 } |
512 }); |
516 }); |
513 |
517 |
514 //delete annotation |
518 //delete annotation |
515 $(document).on('click','.btn-delete-annotation', function(e){ |
519 $(document).on('click','.btn-delete-annotation', function(e){ |
708 |
712 |
709 videoWrap = videoWrap.find(".video-container"); |
713 videoWrap = videoWrap.find(".video-container"); |
710 getVideoPlayer(dataVideo.url, videoWrap); |
714 getVideoPlayer(dataVideo.url, videoWrap); |
711 |
715 |
712 } |
716 } |
713 $('.popup').on('click', '.bibliotheque-video a', function(e){ |
717 $('.popup').on('click', '.bibliotheque-video a:not(.pagination a)', function(e){ |
714 e.preventDefault(); |
718 e.preventDefault(); |
715 |
719 |
716 var url = $(this).attr('data-url'), |
720 var url = $(this).attr('data-url'), |
717 title = $(this).attr('data-title'), |
721 title = $(this).attr('data-title'), |
718 description = $(this).attr('data-description'); |
722 description = $(this).attr('data-description'); |
723 |
727 |
724 $('.popup').modal('hide'); |
728 $('.popup').modal('hide'); |
725 |
729 |
726 var videoWrap = $('#tab-annotation-'+currentAnnotation.id).find('.annotation-video-content'); |
730 var videoWrap = $('#tab-annotation-'+currentAnnotation.id).find('.annotation-video-content'); |
727 renderVideoInfo(videoWrap, currentAnnotation.content); |
731 renderVideoInfo(videoWrap, currentAnnotation.content); |
728 |
|
729 |
732 |
730 }); |
733 }); |
731 |
734 |
732 //diaporama |
735 //diaporama |
733 |
736 |
734 //bibliotheque |
737 //bibliotheque |
735 $('.popup').on('click', '.bibliotheque-image a', function(e){ |
738 $('.popup').on('click', '.bibliotheque-image a:not(.pagination a)', function(e){ |
736 e.preventDefault(); |
739 e.preventDefault(); |
737 |
740 |
738 var url = $(this).attr('data-url'), |
741 var url = $(this).attr('data-url'), |
739 title = $(this).attr('data-title'), |
742 title = $(this).attr('data-title'), |
740 description = $(this).attr('data-description'), |
743 description = $(this).attr('data-description'), |
952 controls: "bold italic underline strikethrough | font size " + |
955 controls: "bold italic underline strikethrough | font size " + |
953 "style | color highlight removeformat | bullets numbering | source", |
956 "style | color highlight removeformat | bullets numbering | source", |
954 fonts: "Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond," + |
957 fonts: "Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond," + |
955 "Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana", |
958 "Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana", |
956 sizes: "1,2,3,4,5,6,7", |
959 sizes: "1,2,3,4,5,6,7", |
957 styles: [["Paragraph", "<p>"], ["Header 1", "<h1>"], ["Header 2", "<h2>"], |
960 styles: [["Paragraph", "<p>"], ["Header 2", "<h2>"], |
958 ["Header 3", "<h3>"], ["Header 4","<h4>"], ["Header 5","<h5>"], |
961 ["Header 3", "<h3>"], ["Header 4","<h4>"], ["Header 5","<h5>"], |
959 ["Header 6","<h6>"]], |
962 ["Header 6","<h6>"]], |
960 docType: '<!DOCTYPE HTML>', |
963 docType: '<!DOCTYPE HTML>', |
961 bodyStyle: "margin:0; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif;", |
964 bodyStyle: "margin:0; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif;", |
962 updateTextArea : function(text){ |
965 updateTextArea : function(text){ |