integration/js/edition.js
changeset 16 c66274d0d850
parent 9 e3d551eda5a6
child 18 16b482c153fd
equal deleted inserted replaced
14:9fd6247d8c87 16:c66274d0d850
     1 $(function(){
     1 $(function(){
     2 
     2 
     3 var global = {
     3 var global = {
     4     diaporama : null,
     4     diaporama : null,
     5     idAnnotation : null
     5     idAnnotation : null
     6 };
     6 },
       
     7 chapitres = {},
       
     8 annotations = {};
       
     9 
       
    10 //onLoad
       
    11 myProject.onLoad(function() {
       
    12 
       
    13     $(".project-title").text(myProject.title);
       
    14     
       
    15     myMedia = myProject.getCurrentMedia();
       
    16     
       
    17     IriSP.htmlPlayer(
       
    18         myMedia,
       
    19         $(".main-video"),
       
    20         {
       
    21             width: 460,
       
    22             height: 345,
       
    23             controls: true,
       
    24             autostart: true
       
    25         }
       
    26     );
       
    27 
       
    28     myMedia.on("timeupdate", function(t) {
       
    29 
       
    30         //curseur chapitre
       
    31         var pos = $(".chapitre-cut-wrap").width() * t / myMedia.duration,
       
    32             wContainer = $('.chapitre-cut-wrap').width(),
       
    33             btnCutChapter = $('.btn-cut-chapter'),
       
    34             wBtnCutChapter = btnCutChapter.outerWidth();
       
    35             
       
    36         $(".indicateur-chapter").css("left",pos);
       
    37         if(pos+wBtnCutChapter>wContainer){
       
    38             btnCutChapter.css("left",(pos - wBtnCutChapter));
       
    39         }else{
       
    40             btnCutChapter.css("left",pos);
       
    41         }
       
    42             
       
    43     });
       
    44     
       
    45 });//myProject.onLoad
       
    46 
     7 
    47 
     8 //modal
    48 //modal
     9     $(document).on('click', 'a.open-modal', function(e){
    49     $(document).on('click', 'a.open-modal', function(e){
    10         var diaporama = $(this).attr('data-diaporama'),
    50         var diaporama = $(this).attr('data-diaporama'),
    11             idAnnotation = $(this).attr('data-id');
    51             idAnnotation = $(this).attr('data-id');
   107         });
   147         });
   108     });
   148     });
   109     //nouveau chapitre
   149     //nouveau chapitre
   110     $('.chapter-widget').on('click', '.btn-cut-chapter', function(e){
   150     $('.chapter-widget').on('click', '.btn-cut-chapter', function(e){
   111         e.preventDefault();
   151         e.preventDefault();
       
   152 
   112         var uniqId = 'id' + (new Date()).getTime();
   153         var uniqId = 'id' + (new Date()).getTime();
   113         $.get('template.html', function(templates){
   154         $.get('template.html', function(templates){
   114             var viewChapterRow = {
   155             var viewChapterRow = {
   115                     id : uniqId
   156                     id : uniqId
   116                 };
   157                 };
   259 
   300 
   260     apercuWrap.empty().html(htmlTextarea.val());
   301     apercuWrap.empty().html(htmlTextarea.val());
   261 });
   302 });
   262 
   303 
   263 //annotation > diaporama (spin)
   304 //annotation > diaporama (spin)
   264 var spinParam = {
   305 
   265     imageBasePath :'lib/spin/img/',
       
   266     max:60,
       
   267     min:0
       
   268 };
       
   269 
   306 
   270 //config
   307 //config
   271 //CLEditor annotation > text (wysiwyg)
   308 //CLEditor annotation > text (wysiwyg)
   272 //http://premiumsoftware.net/cleditor/docs/GettingStarted.html#optionalParameters
   309 //http://premiumsoftware.net/cleditor/docs/GettingStarted.html#optionalParameters
   273 var wysiwygConfig = {
   310 var wysiwygConfig = {
   369 
   406 
   370 $('.slider-duration').slider(configSlider);
   407 $('.slider-duration').slider(configSlider);
   371 
   408 
   372 $('#annotation-tab a:last-child').tab('show');
   409 $('#annotation-tab a:last-child').tab('show');
   373 
   410 
   374 });
   411 });//ready